Search in sources :

Example 1 with I_DD_OrderLine

use of org.eevolution.model.I_DD_OrderLine in project adempiere by adempiere.

the class GenerateInOutBound method createBasedOnDemand.

private void createBasedOnDemand(MWMInOutBound outBoundOrder, List<MPPMRP> demands) {
    demands.stream().forEach(demand -> {
        MWMInOutBoundLine outBoundOrderLine = new MWMInOutBoundLine(outBoundOrder);
        outBoundOrderLine.setLine(getLineNo(outBoundOrder));
        outBoundOrderLine.setMovementQty(demand.getQty());
        outBoundOrderLine.setDescription(demand.getDescription());
        outBoundOrderLine.setPP_MRP_ID(demand.getPP_MRP_ID());
        outBoundOrderLine.setM_Product_ID(demand.getM_Product_ID());
        if (MPPMRP.ORDERTYPE_SalesOrder.equals(demand.getOrderType())) {
            I_C_OrderLine orderLine = demand.getC_OrderLine();
            outBoundOrderLine.setC_OrderLine_ID(demand.getC_OrderLine_ID());
            outBoundOrderLine.setC_Order_ID(demand.getC_Order_ID());
            outBoundOrderLine.setC_UOM_ID(orderLine.getC_UOM_ID());
            outBoundOrderLine.setM_AttributeSetInstance_ID(orderLine.getM_AttributeSetInstance_ID());
        }
        if (MPPMRP.ORDERTYPE_DistributionOrder.equals(demand.getOrderType())) {
            I_DD_OrderLine orderLine = demand.getDD_OrderLine();
            outBoundOrderLine.setDD_Order_ID(demand.getDD_Order_ID());
            outBoundOrderLine.setDD_OrderLine_ID(demand.getDD_OrderLine_ID());
            outBoundOrderLine.setC_UOM_ID(orderLine.getC_UOM_ID());
            outBoundOrderLine.setM_AttributeSetInstance_ID(orderLine.getM_AttributeSetInstance_ID());
        }
        if (MPPMRP.ORDERTYPE_ManufacturingOrder.equals(demand.getOrderType())) {
            I_PP_Order_BOMLine orderBomLine = demand.getPP_Order_BOMLine();
            outBoundOrderLine.setPP_Order_ID(demand.getPP_Order_ID());
            outBoundOrderLine.setPP_Order_BOMLine_ID(demand.getPP_Order_BOMLine_ID());
            outBoundOrderLine.setC_UOM_ID(orderBomLine.getC_UOM_ID());
            outBoundOrderLine.setM_AttributeSetInstance_ID(orderBomLine.getM_AttributeSetInstance_ID());
        }
        outBoundOrderLine.setPickDate(outBoundOrder.getPickDate());
        outBoundOrderLine.setShipDate(outBoundOrder.getShipDate());
        outBoundOrderLine.saveEx();
    });
}
Also used : MWMInOutBoundLine(org.eevolution.model.MWMInOutBoundLine) I_C_OrderLine(org.compiere.model.I_C_OrderLine) I_DD_OrderLine(org.eevolution.model.I_DD_OrderLine) I_PP_Order_BOMLine(org.eevolution.model.I_PP_Order_BOMLine)

Example 2 with I_DD_OrderLine

use of org.eevolution.model.I_DD_OrderLine in project metasfresh-webui-api by metasfresh.

the class WEBUI_DD_OrderLine_MoveHU method doIt.

@Override
@RunOutOfTrx
protected String doIt() throws Exception {
    final int ddOrderLineId = getSingleSelectedRow().getId().toInt();
    final I_DD_OrderLine ddOrderLine = load(ddOrderLineId, I_DD_OrderLine.class);
    final I_M_HU hu = load(p_M_HU_ID, I_M_HU.class);
    huDDOrderBL.createMovements().setDDOrderLines(ImmutableList.of(ddOrderLine)).setLocatorToIdOverride(p_M_LocatorTo_ID).setDoDirectMovements(true).setFailIfCannotAllocate(true).allocateHU(hu).processWithinOwnTrx();
    return MSG_OK;
}
Also used : I_M_HU(de.metas.handlingunits.model.I_M_HU) I_DD_OrderLine(org.eevolution.model.I_DD_OrderLine) RunOutOfTrx(de.metas.process.RunOutOfTrx)

Aggregations

I_DD_OrderLine (org.eevolution.model.I_DD_OrderLine)2 I_M_HU (de.metas.handlingunits.model.I_M_HU)1 RunOutOfTrx (de.metas.process.RunOutOfTrx)1 I_C_OrderLine (org.compiere.model.I_C_OrderLine)1 I_PP_Order_BOMLine (org.eevolution.model.I_PP_Order_BOMLine)1 MWMInOutBoundLine (org.eevolution.model.MWMInOutBoundLine)1