Search in sources :

Example 1 with I_PP_Order

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

the class MakeToOrderNotStandardBOMandWF method test01.

public void test01() throws Exception {
    Qty = new BigDecimal(10);
    //Define Product
    product = MProduct.get(getCtx(), M_Product_ID);
    //Define Business Partner
    BPartner = new MBPartner(getCtx(), C_BPartner_ID, trxName);
    //force not BOM Standard
    bom = new MPPProductBOM(getCtx(), PP_Product_BOM_ID, trxName);
    if (bom != null) {
        bom.setValue(product.getValue() + "-Alternate");
        bom.setBOMType(MPPProductBOM.BOMTYPE_Make_To_Order);
        bom.setBOMUse(MPPProductBOM.BOMUSE_Manufacturing);
        bom.saveEx();
    }
    createOrder();
    MPPOrder expected = createPPOrder();
    I_PP_Order actual = MPPOrder.forC_OrderLine_ID(getCtx(), oline.get_ID(), oline.getM_Product_ID(), trxName);
    if (actual == null) {
        throw new AdempiereException("@NotFound@ @PP_Order_ID@ not was generate");
    }
    assertEquals("Confirming Manufacturing Order", expected, actual);
}
Also used : I_PP_Order(org.eevolution.model.I_PP_Order) AdempiereException(org.adempiere.exceptions.AdempiereException) MBPartner(org.compiere.model.MBPartner) MPPProductBOM(org.eevolution.model.MPPProductBOM) BigDecimal(java.math.BigDecimal) MPPOrder(org.eevolution.model.MPPOrder)

Example 2 with I_PP_Order

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

the class MakeToOrderStandardBOMNotWF method test01.

public void test01() throws Exception {
    Qty = new BigDecimal(10);
    //Define Product
    product = MProduct.get(getCtx(), M_Product_ID);
    //Define Business Partner
    BPartner = new MBPartner(getCtx(), C_BPartner_ID, trxName);
    //Setting the BOM
    int PP_Product_BOM_ID = MPPProductBOM.getBOMSearchKey(product);
    if (PP_Product_BOM_ID > 0)
        bom = new MPPProductBOM(getCtx(), PP_Product_BOM_ID, trxName);
    else
        throw new AdempiereException("@NotFound@ @PP_ProductBOM_ID@");
    if (bom != null) {
        bom.setBOMType(MPPProductBOM.BOMTYPE_Make_To_Order);
        bom.setBOMUse(MPPProductBOM.BOMUSE_Manufacturing);
        bom.saveEx();
    }
    createOrder();
    MPPOrder expected = createPPOrder();
    I_PP_Order actual = MPPOrder.forC_OrderLine_ID(getCtx(), oline.get_ID(), oline.getM_Product_ID(), trxName);
    if (actual == null) {
        throw new AdempiereException("@NotFound@ @PP_Order_ID@ not was generate");
    }
    assertEquals("Confirming Manufacturing Order", expected, actual);
}
Also used : I_PP_Order(org.eevolution.model.I_PP_Order) AdempiereException(org.adempiere.exceptions.AdempiereException) MBPartner(org.compiere.model.MBPartner) MPPProductBOM(org.eevolution.model.MPPProductBOM) BigDecimal(java.math.BigDecimal) MPPOrder(org.eevolution.model.MPPOrder)

Example 3 with I_PP_Order

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

the class AbstractMakeToOrder method test01.

public void test01() throws Exception {
    Qty = new BigDecimal(10);
    //Define Product
    product = MProduct.get(getCtx(), M_Product_ID);
    //Define Business Partner
    BPartner = new MBPartner(getCtx(), C_BPartner_ID, trxName);
    //Setting the BOM
    int PP_Product_BOM_ID = MPPProductBOM.getBOMSearchKey(product);
    if (PP_Product_BOM_ID > 0)
        bom = new MPPProductBOM(getCtx(), PP_Product_BOM_ID, trxName);
    else
        throw new AdempiereException("@NotFound@ @PP_ProductBOM_ID@");
    if (bom != null) {
        bom.setBOMType(MPPProductBOM.BOMTYPE_Make_To_Order);
        bom.setBOMUse(MPPProductBOM.BOMUSE_Manufacturing);
        bom.saveEx();
    }
    //Define Workflow as standardd
    workflow = new MWorkflow(getCtx(), AD_Workflow_ID, trxName);
    workflow.setValue(product.getValue());
    workflow.saveEx();
    //int workflow_id =  MWorkflow.getWorkflowSearchKey(product);
    if (AD_Workflow_ID > 0)
        workflow = MWorkflow.get(getCtx(), AD_Workflow_ID);
    else
        throw new AdempiereException("@NotFound@ @AD_Workflow_ID@");
    createOrder();
    MPPOrder expected = createPPOrder();
    I_PP_Order actual = MPPOrder.forC_OrderLine_ID(getCtx(), oline.get_ID(), oline.getM_Product_ID(), trxName);
    if (actual == null) {
        throw new AdempiereException("@NotFound@ @PP_Order_ID@ not was generate");
    }
    assertEquals("Confirming Manufacturing Order", expected, actual);
}
Also used : I_PP_Order(org.eevolution.model.I_PP_Order) AdempiereException(org.adempiere.exceptions.AdempiereException) MWorkflow(org.compiere.wf.MWorkflow) MBPartner(org.compiere.model.MBPartner) MPPProductBOM(org.eevolution.model.MPPProductBOM) BigDecimal(java.math.BigDecimal) MPPOrder(org.eevolution.model.MPPOrder)

Example 4 with I_PP_Order

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

the class WEBUI_PP_Order_M_Source_HU_IssueTuQty method retrieveActiveSourceHus.

private static List<I_M_Source_HU> retrieveActiveSourceHus(@NonNull final PPOrderLineRow row) {
    final I_PP_Order ppOrder = load(row.getPP_Order_ID(), I_PP_Order.class);
    final MatchingSourceHusQuery query = MatchingSourceHusQuery.builder().productId(row.getM_Product_ID()).warehouseId(ppOrder.getM_Warehouse_ID()).build();
    return SourceHUsService.get().retrieveMatchingSourceHuMarkers(query);
}
Also used : MatchingSourceHusQuery(de.metas.handlingunits.sourcehu.SourceHUsService.MatchingSourceHusQuery) I_PP_Order(org.eevolution.model.I_PP_Order)

Example 5 with I_PP_Order

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

the class MakeToOrderStandardBOMandWF method test01.

public void test01() throws Exception {
    Qty = new BigDecimal(10);
    //Define Product
    product = MProduct.get(getCtx(), M_Product_ID);
    //Define Business Partner
    BPartner = new MBPartner(getCtx(), C_BPartner_ID, trxName);
    //Setting the BOM
    int PP_Product_BOM_ID = MPPProductBOM.getBOMSearchKey(product);
    if (PP_Product_BOM_ID > 0)
        bom = new MPPProductBOM(getCtx(), PP_Product_BOM_ID, trxName);
    else
        throw new AdempiereException("@NotFound@ @PP_ProductBOM_ID@");
    if (bom != null) {
        bom.setValue(product.getValue());
        bom.setBOMType(MPPProductBOM.BOMTYPE_Make_To_Order);
        bom.setBOMUse(MPPProductBOM.BOMUSE_Manufacturing);
        bom.saveEx();
    }
    //force Workflow as standard
    workflow = new MWorkflow(getCtx(), AD_Workflow_ID, trxName);
    workflow.setValue(product.getValue());
    workflow.saveEx();
    if (AD_Workflow_ID > 0)
        workflow = MWorkflow.get(getCtx(), AD_Workflow_ID);
    else
        throw new AdempiereException("@NotFound@ @AD_Workflow_ID@");
    /* Validate Exception if a Planning data is no defined
		MPPProductPlanning pp = MPPProductPlanning.find(getCtx(), AD_Org_ID, M_Warehouse_ID , S_Resource_ID , M_Product_ID, trxName); 	
		pp.setS_Resource_ID(50000);
		pp.saveEx();*/
    createOrder();
    MPPOrder expected = createPPOrder();
    I_PP_Order actual = MPPOrder.forC_OrderLine_ID(getCtx(), oline.get_ID(), oline.getM_Product_ID(), trxName);
    if (actual == null) {
        throw new AdempiereException("@NotFound@ @PP_Order_ID@ not was generate");
    }
    assertEquals("Confirming Manufacturing Order", expected, actual);
}
Also used : I_PP_Order(org.eevolution.model.I_PP_Order) AdempiereException(org.adempiere.exceptions.AdempiereException) MWorkflow(org.compiere.wf.MWorkflow) MBPartner(org.compiere.model.MBPartner) MPPProductBOM(org.eevolution.model.MPPProductBOM) BigDecimal(java.math.BigDecimal) MPPOrder(org.eevolution.model.MPPOrder)

Aggregations

I_PP_Order (org.eevolution.model.I_PP_Order)7 BigDecimal (java.math.BigDecimal)4 AdempiereException (org.adempiere.exceptions.AdempiereException)4 MBPartner (org.compiere.model.MBPartner)4 MPPOrder (org.eevolution.model.MPPOrder)4 MPPProductBOM (org.eevolution.model.MPPProductBOM)4 MWorkflow (org.compiere.wf.MWorkflow)2 Test (org.junit.Test)2 MatchingSourceHusQuery (de.metas.handlingunits.sourcehu.SourceHUsService.MatchingSourceHusQuery)1 I_PP_Order_BOMLine (org.eevolution.model.I_PP_Order_BOMLine)1