use of de.metas.ui.web.picking.pickingslot.PickingSlotRowId in project metasfresh-webui-api by metasfresh.
the class PickingSlotsClearingViewBasedProcess method getRootRowForSelectedPickingSlotRows.
/**
* @return the actual picking slow row (the top level row)
*/
protected final PickingSlotRow getRootRowForSelectedPickingSlotRows() {
final Set<PickingSlotRowId> rootRowIds = getRootRowIdsForSelectedPickingSlotRows();
Check.assumeNotEmpty(rootRowIds, "rootRowIds is not empty");
if (rootRowIds.size() > 1) {
throw new AdempiereException("Select rows from one picking slot");
}
final PickingSlotRowId rootRowId = rootRowIds.iterator().next();
final PickingSlotsClearingView pickingSlotsClearingView = getPickingSlotsClearingView();
return pickingSlotsClearingView.getById(rootRowId);
}
use of de.metas.ui.web.picking.pickingslot.PickingSlotRowId in project metasfresh-webui-api by metasfresh.
the class WEBUI_PickingSlotsClearingView_TakeOutMultiHUsAndAddToNewHU method checkPreconditionsApplicable.
@Override
public final ProcessPreconditionsResolution checkPreconditionsApplicable() {
final List<PickingSlotRow> pickingSlotRows = getSelectedPickingSlotRows();
if (pickingSlotRows.size() <= 1) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select more than one HU");
}
final Set<PickingSlotRowId> rootRowIds = getRootRowIdsForSelectedPickingSlotRows();
if (rootRowIds.size() > 1) {
return ProcessPreconditionsResolution.rejectWithInternalReason("all selected HU rows shall be from one picking slot");
}
for (final PickingSlotRow pickingSlotRow : pickingSlotRows) {
if (!pickingSlotRow.isPickedHURow()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select an HU");
}
if (!pickingSlotRow.isTopLevelHU()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select an top level HU");
}
}
//
return ProcessPreconditionsResolution.accept();
}
Aggregations