use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class PackingInfoProcessParams method createNewLUTUConfigFromDefaultsOnly.
public I_M_HU_LUTU_Configuration createNewLUTUConfigFromDefaultsOnly() {
final I_M_HU_LUTU_Configuration defaultLUTUConfigNewCopy = InterfaceWrapperHelper.copy().setFrom(getDefaultLUTUConfig()).copyToNew(I_M_HU_LUTU_Configuration.class);
lutuConfigurationFactory.save(defaultLUTUConfigNewCopy);
return defaultLUTUConfigNewCopy;
}
use of de.metas.handlingunits.model.I_M_HU_LUTU_Configuration in project metasfresh-webui-api by metasfresh.
the class PackingInfoProcessParams method createAndSaveNewLUTUConfig.
public I_M_HU_LUTU_Configuration createAndSaveNewLUTUConfig() {
final I_M_HU_LUTU_Configuration defaultLUTUConfig = getDefaultLUTUConfig();
// Validate parameters
// not mandatory
final int lu_PI_Item_ID = getLuPiItemId();
final int M_HU_PI_Item_Product_ID = getTU_HU_PI_Item_Product_ID();
final BigDecimal qtyCU = getQtyCU();
final boolean isVirtualHU = M_HU_PI_Item_Product_ID == IHUPIItemProductDAO.VIRTUAL_HU_PI_Item_Product_ID;
final BigDecimal qtyTU = isVirtualHU ? BigDecimal.ONE : this.qtyTU;
if (M_HU_PI_Item_Product_ID <= 0) {
throw new FillMandatoryException(PARAM_M_HU_PI_Item_Product_ID);
}
if (qtyCU == null || qtyCU.signum() <= 0) {
throw new FillMandatoryException(PARAM_QtyCU);
}
if (qtyTU == null || qtyTU.signum() <= 0) {
throw new FillMandatoryException(PARAM_QtyTU);
}
final I_M_HU_LUTU_Configuration lutuConfigNew = InterfaceWrapperHelper.copy().setFrom(defaultLUTUConfig).copyToNew(I_M_HU_LUTU_Configuration.class);
// CU
lutuConfigNew.setQtyCU(qtyCU);
lutuConfigNew.setIsInfiniteQtyCU(false);
// TU
configureLUTUConfigTU(lutuConfigNew, M_HU_PI_Item_Product_ID, qtyTU);
// LU
configureLUTUConfigLU(lutuConfigNew, lu_PI_Item_ID);
lutuConfigurationFactory.save(lutuConfigNew);
return lutuConfigNew;
}
Aggregations