Search in sources :

Example 11 with I_M_HU_LUTU_Configuration

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;
}
Also used : I_M_HU_LUTU_Configuration(de.metas.handlingunits.model.I_M_HU_LUTU_Configuration)

Example 12 with I_M_HU_LUTU_Configuration

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;
}
Also used : I_M_HU_LUTU_Configuration(de.metas.handlingunits.model.I_M_HU_LUTU_Configuration) FillMandatoryException(org.adempiere.exceptions.FillMandatoryException) BigDecimal(java.math.BigDecimal)

Aggregations

I_M_HU_LUTU_Configuration (de.metas.handlingunits.model.I_M_HU_LUTU_Configuration)12 I_M_ReceiptSchedule (de.metas.handlingunits.model.I_M_ReceiptSchedule)3 IHUPPOrderBL (de.metas.handlingunits.pporder.api.IHUPPOrderBL)2 RunOutOfTrx (de.metas.process.RunOutOfTrx)2 BigDecimal (java.math.BigDecimal)2 FillMandatoryException (org.adempiere.exceptions.FillMandatoryException)2 TerminalException (de.metas.adempiere.form.terminal.TerminalException)1 IHUPIItemProductDAO (de.metas.handlingunits.IHUPIItemProductDAO)1 IHandlingUnitsDAO (de.metas.handlingunits.IHandlingUnitsDAO)1 ILUTUConfigurationFactory (de.metas.handlingunits.allocation.ILUTUConfigurationFactory)1 ILUTUProducerAllocationDestination (de.metas.handlingunits.allocation.ILUTUProducerAllocationDestination)1 I_M_HU (de.metas.handlingunits.model.I_M_HU)1 I_M_HU_PI (de.metas.handlingunits.model.I_M_HU_PI)1 I_M_HU_PI_Item (de.metas.handlingunits.model.I_M_HU_PI_Item)1 I_M_HU_PI_Item_Product (de.metas.handlingunits.model.I_M_HU_PI_Item_Product)1 I_M_HU_PI_Version (de.metas.handlingunits.model.I_M_HU_PI_Version)1 IPPOrderReceiptHUProducer (de.metas.handlingunits.pporder.api.IPPOrderReceiptHUProducer)1 ReceiptScheduleHUGenerator (de.metas.handlingunits.receiptschedule.impl.ReceiptScheduleHUGenerator)1 Quantity (de.metas.quantity.Quantity)1 PPOrderLineRow (de.metas.ui.web.pporder.PPOrderLineRow)1