use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.
the class HUsToPickViewBasedProcess method addHUIdToCurrentPickingSlot.
protected final void addHUIdToCurrentPickingSlot(final int huId) {
final PickingSlotView pickingSlotsView = getPickingSlotView();
final PickingSlotRow pickingSlotRow = getPickingSlotRow();
final int pickingSlotId = pickingSlotRow.getPickingSlotId();
final int shipmentScheduleId = pickingSlotsView.getCurrentShipmentScheduleId();
pickingCandidateService.addHUToPickingSlot(huId, pickingSlotId, shipmentScheduleId);
}
use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.
the class WEBUI_HUsToPick_PickCU method pickCUs.
private void pickCUs() {
final I_M_Product product = getProduct();
final I_C_UOM uom = productBL.getStockingUOM(product);
final Date date = SystemTime.asDate();
final int huIdToSplit = retrieveHUIdToSplit();
final List<I_M_HU> splitHUs = HUSplitBuilderCoreEngine.builder().huToSplit(load(huIdToSplit, I_M_HU.class)).requestProvider(huContext -> AllocationUtils.createAllocationRequestBuilder().setHUContext(huContext).setProduct(product).setQuantity(getQtyCU(), uom).setDate(date).setFromReferencedModel(// N/A
null).setForceQtyAllocation(false).create()).destination(HUProducerDestination.ofVirtualPI()).build().withPropagateHUValues().withAllowPartialUnloads(// we allow partial loads and unloads so if a user enters a very large number, then that will just account to "all of it" and there will be no error
true).performSplit();
final I_M_HU splitCU = ListUtils.singleElement(splitHUs);
addHUIdToCurrentPickingSlot(splitCU.getM_HU_ID());
if (isAutoProcess) {
final PickingSlotRow rowToProcess = getPickingSlotRow();
pickingCandidateService.processForHUIds(ImmutableList.of(rowToProcess.getHuId()), rowToProcess.getPickingSlotId(), OptionalInt.empty());
}
}
use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.
the class WEBUI_PickingSlotsClearingView_TakeOutTUAndAddToLU method doIt.
@Override
protected String doIt() throws Exception {
final PickingSlotRow pickingSlotRow = getSingleSelectedPickingSlotRow();
Check.assume(pickingSlotRow.isTU(), "Picking slot HU shall be a TU: {}", pickingSlotRow);
final I_M_HU tuHU = InterfaceWrapperHelper.load(pickingSlotRow.getHuId(), I_M_HU.class);
final HUEditorRow packingHURow = getSingleSelectedPackingHUsRow();
Check.assume(packingHURow.isLU(), "Pack to HU shall be a LU: {}", packingHURow);
final I_M_HU luHU = packingHURow.getM_HU();
final BigDecimal qtyTU = BigDecimal.ONE;
final List<Integer> huIdsDestroyedCollector = new ArrayList<>();
HUTransformService.builder().emptyHUListener(EmptyHUListener.doBeforeDestroyed(hu -> huIdsDestroyedCollector.add(hu.getM_HU_ID()))).build().tuToExistingLU(tuHU, qtyTU, luHU);
// Remove from picking slots all destroyed HUs
pickingCandidateService.inactivateForHUIds(huIdsDestroyedCollector);
return MSG_OK;
}
use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.
the class WEBUI_PickingSlotsClearingView_TakeOutTUAndAddToLU method checkPreconditionsApplicable.
@Override
protected ProcessPreconditionsResolution checkPreconditionsApplicable() {
// Validate the picking slots clearing selected row (left side)
if (!isSingleSelectedPickingSlotRow()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select one and only one picking slots HU");
}
final PickingSlotRow pickingSlotRow = getSingleSelectedPickingSlotRow();
if (!pickingSlotRow.isTU()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select a TU");
}
// Validate the packing HUs selected row (right side)
if (!isSingleSelectedPackingHUsRow()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select one and only one HU to pack to");
}
final HUEditorRow packingHURow = getSingleSelectedPackingHUsRow();
if (!packingHURow.isLU()) {
return ProcessPreconditionsResolution.rejectWithInternalReason("select a LU to pack too");
}
//
return ProcessPreconditionsResolution.accept();
}
use of de.metas.ui.web.picking.pickingslot.PickingSlotRow in project metasfresh-webui-api by metasfresh.
the class WEBUI_Picking_TU_Label method doIt.
@Override
protected String doIt() throws Exception {
final PickingSlotRow rowToProcess = getSingleSelectedRow();
final I_M_HU hu = load(rowToProcess.getHuId(), I_M_HU.class);
final HUToReportWrapper huToReport = HUToReportWrapper.of(hu);
printPickingLabel(huToReport);
return MSG_OK;
}
Aggregations