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;
}
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;
}
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();
}
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);
}
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();
}
Aggregations