Search in sources :

Example 16 with PickingSlotRow

use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_HUEditor_Launcher method createHUEditorView.

private IView createHUEditorView(@NonNull final List<Integer> availableHUIdsToPick) {
    final PickingSlotRow pickingSlotRow = getSingleSelectedRow();
    final ViewId pickingSlotViewId = getView().getViewId();
    final IView husToPickView = viewsRepo.createView(CreateViewRequest.builder(HUsToPickViewFactory.WINDOW_ID, JSONViewDataType.includedView).setParentViewId(pickingSlotViewId).setParentRowId(pickingSlotRow.getId()).addStickyFilters(HUIdsFilterHelper.createFilter(availableHUIdsToPick)).build());
    return husToPickView;
}
Also used : PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow) IView(de.metas.ui.web.view.IView) ViewId(de.metas.ui.web.view.ViewId)

Example 17 with PickingSlotRow

use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_M_Source_HU_Delete method doIt.

@Override
protected String doIt() throws Exception {
    final PickingSlotRow rowToProcess = getSingleSelectedRow();
    final int huId = rowToProcess.getHuId();
    this.sourceWasDeleted = SourceHUsService.get().deleteSourceHuMarker(huId);
    return MSG_OK;
}
Also used : PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow)

Example 18 with PickingSlotRow

use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.

the class WEBUI_Picking_ReturnQtyToSourceHU method checkPreconditionsApplicable.

@Override
protected ProcessPreconditionsResolution checkPreconditionsApplicable() {
    if (!getSelectedRowIds().isSingleDocumentId()) {
        return ProcessPreconditionsResolution.rejectBecauseNotSingleSelection();
    }
    final PickingSlotRow pickingSlotRow = getSingleSelectedRow();
    if (!pickingSlotRow.isPickedHURow()) {
        return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_SELECT_PICKED_HU));
    }
    final String rowType = pickingSlotRow.getType().getName();
    final boolean cuRow = Objects.equals(rowType, HUEditorRowType.VHU.getName()) || Objects.equals(rowType, HUEditorRowType.HUStorage.getName());
    if (cuRow) {
        return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_SELECT_PICKED_CU));
    }
    if (!checkSourceHuPreconditionIncludingEmptyHUs()) {
        return ProcessPreconditionsResolution.reject(msgBL.getTranslatableMsgText(MSG_WEBUI_PICKING_MISSING_SOURCE_HU));
    }
    return ProcessPreconditionsResolution.accept();
}
Also used : PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow)

Example 19 with PickingSlotRow

use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.

the class PickingSlotsClearingView method getPackingHUsViewIfExists.

public Optional<HUEditorView> getPackingHUsViewIfExists(final PickingSlotRowId rowId) {
    final PickingSlotRow rootRow = getRootRowWhichIncludesRowId(rowId);
    final PackingHUsViewKey key = extractPackingHUsViewKey(rootRow);
    return packingHUsViewsCollection.getByKeyIfExists(key);
}
Also used : PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow)

Example 20 with PickingSlotRow

use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.

the class WEBUI_PickingSlotsClearingView_TakeOutCUsAndAddToTU method checkPreconditionsApplicable.

@Override
protected ProcessPreconditionsResolution checkPreconditionsApplicable() {
    // 
    // Validate the picking slots clearing selected row (left side)
    // i.e. the ones which we will Take Out
    final List<PickingSlotRow> pickingSlotRows = getSelectedPickingSlotRows();
    if (pickingSlotRows.isEmpty()) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("select some picking slots CUs");
    }
    for (final PickingSlotRow pickingSlotRow : pickingSlotRows) {
        if (!pickingSlotRow.isCU()) {
            return ProcessPreconditionsResolution.rejectWithInternalReason("select a CU");
        }
    }
    // i.e. the HU where we will pack to
    if (!isSingleSelectedPackingHUsRow()) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("select one and only one TU to pack to");
    }
    final HUEditorRow packingHURow = getSingleSelectedPackingHUsRow();
    if (!packingHURow.isTU()) {
        return ProcessPreconditionsResolution.rejectWithInternalReason("select a TU to pack too");
    }
    // 
    return ProcessPreconditionsResolution.accept();
}
Also used : PickingSlotRow(de.metas.ui.web.picking.pickingslot.PickingSlotRow) HUEditorRow(de.metas.ui.web.handlingunits.HUEditorRow)

Aggregations

PickingSlotRow (de.metas.ui.web.picking.pickingslot.PickingSlotRow)21 I_M_HU (de.metas.handlingunits.model.I_M_HU)6 HUEditorRow (de.metas.ui.web.handlingunits.HUEditorRow)4 PickingCandidateService (de.metas.handlingunits.picking.PickingCandidateService)2 HUToReportWrapper (de.metas.handlingunits.report.HUToReportWrapper)2 IProcessPrecondition (de.metas.process.IProcessPrecondition)2 ProcessPreconditionsResolution (de.metas.process.ProcessPreconditionsResolution)2 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)2 BigDecimal (java.math.BigDecimal)2 List (java.util.List)2 AdempiereException (org.adempiere.exceptions.AdempiereException)2 ImmutableList (com.google.common.collect.ImmutableList)1 I_M_Product (de.metas.adempiere.model.I_M_Product)1 IHUContext (de.metas.handlingunits.IHUContext)1 IHandlingUnitsBL (de.metas.handlingunits.IHandlingUnitsBL)1 AllocationUtils (de.metas.handlingunits.allocation.impl.AllocationUtils)1 HUProducerDestination (de.metas.handlingunits.allocation.impl.HUProducerDestination)1 HUTransformService (de.metas.handlingunits.allocation.transfer.HUTransformService)1 HUSplitBuilderCoreEngine (de.metas.handlingunits.allocation.transfer.impl.HUSplitBuilderCoreEngine)1 LUTUProducerDestination (de.metas.handlingunits.allocation.transfer.impl.LUTUProducerDestination)1