use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_ReceiptSchedule_ReceiveHUs_Base method doIt.
@Override
@RunOutOfTrx
protected final String doIt() throws Exception {
final I_M_ReceiptSchedule receiptSchedule = getM_ReceiptSchedule();
final ReceiptScheduleHUGenerator huGenerator = ReceiptScheduleHUGenerator.newInstance(this).addM_ReceiptSchedule(receiptSchedule).setUpdateReceiptScheduleDefaultConfiguration(isUpdateReceiptScheduleDefaultConfiguration());
//
// Get/Create the initial LU/TU configuration
final I_M_HU_LUTU_Configuration lutuConfigurationOrig = getCurrentLUTUConfiguration(receiptSchedule);
//
// Create the effective LU/TU configuration
final I_M_HU_LUTU_Configuration lutuConfiguration = createM_HU_LUTU_Configuration(lutuConfigurationOrig);
Services.get(ILUTUConfigurationFactory.class).save(lutuConfiguration);
huGenerator.setM_HU_LUTU_Configuration(lutuConfiguration);
//
// Calculate the target CUs that we want to allocate
final ILUTUProducerAllocationDestination lutuProducer = huGenerator.getLUTUProducerAllocationDestination();
final Quantity qtyCUsTotal = lutuProducer.calculateTotalQtyCU();
if (qtyCUsTotal.isInfinite()) {
throw new TerminalException("LU/TU configuration is resulting to infinite quantity: " + lutuConfiguration);
}
huGenerator.setQtyToAllocateTarget(qtyCUsTotal);
//
// Generate the HUs
final List<I_M_HU> hus = huGenerator.generateWithinOwnTransaction();
openHUsToReceive(hus);
return MSG_OK;
}
use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_ReceiptSchedule_ReceiveHUs_UsingDefaults method buildDefaultPackingInfo.
private String buildDefaultPackingInfo(final IProcessPreconditionsContext context) {
final I_M_ReceiptSchedule receiptSchedule = context.getSelectedModel(I_M_ReceiptSchedule.class);
if (receiptSchedule == null) {
// no override
return null;
}
final I_M_HU_LUTU_Configuration lutuConfig = getCurrentLUTUConfiguration(receiptSchedule);
adjustLUTUConfiguration(lutuConfig, receiptSchedule);
return HUPackingInfoFormatter.newInstance().setShowLU(// NOTE: don't show LU info because makes the whole label to long. see https://github.com/metasfresh/metasfresh-webui-frontend/issues/315#issuecomment-280624562
false).format(HUPackingInfos.of(lutuConfig));
}
use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_ReceiptSchedule_ReceiveHUs_UsingDefaults method createM_HU_LUTU_Configuration.
@Override
protected I_M_HU_LUTU_Configuration createM_HU_LUTU_Configuration(final I_M_HU_LUTU_Configuration template) {
final I_M_HU_LUTU_Configuration lutuConfigurationNew = InterfaceWrapperHelper.copy().setFrom(template).copyToNew(I_M_HU_LUTU_Configuration.class);
adjustLUTUConfiguration(lutuConfigurationNew, getM_ReceiptSchedule());
// NOTE: don't save it
return lutuConfigurationNew;
}
use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class WEBUI_M_ReceiptSchedule_ReceiveHUs_UsingConfig method getDefaultLUTUConfiguration.
private I_M_HU_LUTU_Configuration getDefaultLUTUConfiguration() {
if (_defaultLUTUConfiguration == null) {
final I_M_ReceiptSchedule receiptSchedule = getM_ReceiptSchedule();
final I_M_HU_LUTU_Configuration defaultLUTUConfiguration = getCurrentLUTUConfiguration(receiptSchedule);
adjustLUTUConfiguration(defaultLUTUConfiguration, receiptSchedule);
_defaultLUTUConfiguration = defaultLUTUConfiguration;
}
return _defaultLUTUConfiguration;
}
use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class PPOrderLinesLoader method computePackingInfo.
private String computePackingInfo(@NonNull final I_PP_Order_BOMLine ppOrderBOMLine) {
final IHUPPOrderBL huPPOrderBL = Services.get(IHUPPOrderBL.class);
final I_M_HU_LUTU_Configuration lutuConfig = huPPOrderBL.createReceiptLUTUConfigurationManager(ppOrderBOMLine).getCreateLUTUConfiguration();
return extractPackingInfoString(lutuConfig);
}
Aggregations