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");
}
}
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");
}
}
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");
}
}
Aggregations