use of de.metas.handlingunits.allocation.transfer.impl.LUTUProducerDestination in project metasfresh-webui-api by metasfresh.
the class PickingSlotsClearingViewBasedProcess method createNewHUProducer.
protected final LUTUProducerDestination createNewHUProducer(@NonNull final PickingSlotRow pickingRow, @NonNull final I_M_HU_PI targetHUPI) {
final int bpartnerId = pickingRow.getBPartnerId();
final I_C_BPartner bpartner = bpartnerId > 0 ? load(bpartnerId, I_C_BPartner.class) : null;
final int bpartnerLocationId = pickingRow.getBPartnerLocationId();
final int locatorId = pickingRow.getPickingSlotLocatorId();
final I_M_Locator locator = load(locatorId, I_M_Locator.class);
if (!locator.isAfterPickingLocator()) {
throw new AdempiereException("Picking slot's locator is not an after picking locator: " + locator.getValue());
}
final LUTUProducerDestination lutuProducer = new LUTUProducerDestination();
lutuProducer.setC_BPartner(bpartner).setC_BPartner_Location_ID(bpartnerLocationId).setM_Locator(locator).setHUStatus(X_M_HU.HUSTATUS_Picked);
final String targetHuType = Services.get(IHandlingUnitsBL.class).getHU_UnitType(targetHUPI);
if (X_M_HU_PI_Version.HU_UNITTYPE_LoadLogistiqueUnit.equals(targetHuType)) {
lutuProducer.setLUPI(targetHUPI);
} else if (X_M_HU_PI_Version.HU_UNITTYPE_TransportUnit.equals(targetHuType)) {
pickingRow.getHuProductId();
lutuProducer.setNoLU();
lutuProducer.setTUPI(targetHUPI);
}
return lutuProducer;
}
use of de.metas.handlingunits.allocation.transfer.impl.LUTUProducerDestination in project metasfresh-webui-api by metasfresh.
the class WEBUI_PickingSlotsClearingView_TakeOutHUAndAddToNewHU method createHUProducer.
private IHUProducerAllocationDestination createHUProducer(@NonNull final I_M_HU fromHU) {
final PickingSlotRow pickingRow = getRootRowForSelectedPickingSlotRows();
final IHUStorageFactory storageFactory = Services.get(IHandlingUnitsBL.class).getStorageFactory();
final IHUStorage storage = storageFactory.getStorage(fromHU);
final I_M_Product singleProduct = storage.getSingleProductOrNull();
final LUTUProducerDestination lutuProducerDestination = createNewHUProducer(pickingRow, targetHUPI);
lutuProducerDestination.addCUPerTU(singleProduct, qtyCU, singleProduct.getC_UOM());
return lutuProducerDestination;
}
Aggregations