Search in sources :

Example 1 with PPOrderLineType

use of de.metas.ui.web.pporder.PPOrderLineType in project metasfresh-webui-api by metasfresh.

the class WEBUI_PP_Order_Receipt method createDefaultLUTUConfigManager.

private IDocumentLUTUConfigurationManager createDefaultLUTUConfigManager(@NonNull final PPOrderLineRow row) {
    final PPOrderLineType type = row.getType();
    if (type == PPOrderLineType.MainProduct) {
        final PPOrderId ppOrderId = row.getOrderId();
        final I_PP_Order ppOrder = Services.get(IPPOrderDAO.class).getById(ppOrderId, I_PP_Order.class);
        return huPPOrderBL.createReceiptLUTUConfigurationManager(ppOrder);
    } else if (type == PPOrderLineType.BOMLine_ByCoProduct) {
        final PPOrderBOMLineId ppOrderBOMLineId = row.getOrderBOMLineId();
        final I_PP_Order_BOMLine ppOrderBOMLine = Services.get(IPPOrderBOMDAO.class).getOrderBOMLineById(ppOrderBOMLineId);
        return huPPOrderBL.createReceiptLUTUConfigurationManager(ppOrderBOMLine);
    } else {
        throw new AdempiereException("Receiving is not allowed");
    }
}
Also used : PPOrderBOMLineId(de.metas.material.planning.pporder.PPOrderBOMLineId) I_PP_Order(de.metas.handlingunits.model.I_PP_Order) IPPOrderDAO(org.eevolution.api.IPPOrderDAO) AdempiereException(org.adempiere.exceptions.AdempiereException) PPOrderLineType(de.metas.ui.web.pporder.PPOrderLineType) PPOrderId(de.metas.material.planning.pporder.PPOrderId) I_PP_Order_BOMLine(org.eevolution.model.I_PP_Order_BOMLine)

Example 2 with PPOrderLineType

use of de.metas.ui.web.pporder.PPOrderLineType in project metasfresh-webui-api by metasfresh.

the class WEBUI_PP_Order_Receipt method createReceiptCandidatesProducer.

private final IPPOrderReceiptHUProducer createReceiptCandidatesProducer(final PPOrderLineRow row) {
    final PPOrderLineType type = row.getType();
    if (type == PPOrderLineType.MainProduct) {
        final int ppOrderId = row.getPP_Order_ID();
        final I_PP_Order ppOrder = load(ppOrderId, I_PP_Order.class);
        return IPPOrderReceiptHUProducer.receiveMainProduct(ppOrder);
    } else if (type == PPOrderLineType.BOMLine_ByCoProduct) {
        final int ppOrderBOMLineId = row.getPP_Order_BOMLine_ID();
        final I_PP_Order_BOMLine ppOrderBOMLine = load(ppOrderBOMLineId, I_PP_Order_BOMLine.class);
        return IPPOrderReceiptHUProducer.receiveByOrCoProduct(ppOrderBOMLine);
    } else {
        throw new AdempiereException("Receiving is not allowed");
    }
}
Also used : I_PP_Order(de.metas.handlingunits.model.I_PP_Order) AdempiereException(org.adempiere.exceptions.AdempiereException) PPOrderLineType(de.metas.ui.web.pporder.PPOrderLineType) I_PP_Order_BOMLine(org.eevolution.model.I_PP_Order_BOMLine)

Example 3 with PPOrderLineType

use of de.metas.ui.web.pporder.PPOrderLineType in project metasfresh-webui-api by metasfresh.

the class WEBUI_PP_Order_Receipt method newReceiptCandidatesProducer.

private final IPPOrderReceiptHUProducer newReceiptCandidatesProducer() {
    final PPOrderLineRow row = getSingleSelectedRow();
    final PPOrderLineType type = row.getType();
    if (type == PPOrderLineType.MainProduct) {
        final PPOrderId ppOrderId = row.getOrderId();
        return huPPOrderBL.receivingMainProduct(ppOrderId);
    } else if (type == PPOrderLineType.BOMLine_ByCoProduct) {
        final PPOrderBOMLineId ppOrderBOMLineId = row.getOrderBOMLineId();
        return huPPOrderBL.receivingByOrCoProduct(ppOrderBOMLineId);
    } else {
        throw new AdempiereException("Receiving is not allowed");
    }
}
Also used : PPOrderBOMLineId(de.metas.material.planning.pporder.PPOrderBOMLineId) AdempiereException(org.adempiere.exceptions.AdempiereException) PPOrderLineType(de.metas.ui.web.pporder.PPOrderLineType) PPOrderLineRow(de.metas.ui.web.pporder.PPOrderLineRow) PPOrderId(de.metas.material.planning.pporder.PPOrderId)

Aggregations

PPOrderLineType (de.metas.ui.web.pporder.PPOrderLineType)3 AdempiereException (org.adempiere.exceptions.AdempiereException)3 I_PP_Order (de.metas.handlingunits.model.I_PP_Order)2 PPOrderBOMLineId (de.metas.material.planning.pporder.PPOrderBOMLineId)2 PPOrderId (de.metas.material.planning.pporder.PPOrderId)2 I_PP_Order_BOMLine (org.eevolution.model.I_PP_Order_BOMLine)2 PPOrderLineRow (de.metas.ui.web.pporder.PPOrderLineRow)1 IPPOrderDAO (org.eevolution.api.IPPOrderDAO)1