Search in sources :

Example 1 with I_S_Resource

use of org.compiere.model.I_S_Resource in project adempiere by adempiere.

the class DefaultRoutingServiceImplTest method assertCalculateDuration.

/**
	 * @see RoutingService#calculateDuration(I_AD_Workflow, I_S_Resource, BigDecimal)
	 */
protected void assertCalculateDuration(I_AD_Workflow wf, int qty, double durationExpected) {
    I_S_Resource plant = getCreatePlant();
    BigDecimal durationReal = routingService.calculateDuration(wf, plant, BigDecimal.valueOf(qty));
    assertEquals(durationExpected, durationReal.doubleValue());
}
Also used : I_S_Resource(org.compiere.model.I_S_Resource) BigDecimal(java.math.BigDecimal)

Example 2 with I_S_Resource

use of org.compiere.model.I_S_Resource in project adempiere by adempiere.

the class MRPUtil method getPlanning.

/**
	 * Helper Method : Create Product Planning
	 */
public static I_PP_Product_Planning getPlanning(String productValue, String Order_Policy, int Order_Min, int Order_Max, int Order_Pack, int SafetyStock, int Order_Period, int LeadTime) {
    boolean isPurchased = true;
    int PlanningHorizon = 365;
    //
    Properties ctx = Env.getCtx();
    //		int AD_Client_ID = Env.getAD_Client_ID(ctx);
    int AD_Org_ID = MRPUtil.getFirst_Org_ID();
    I_M_Warehouse wh = MRPUtil.getCreateWarehouse(AD_Org_ID, productValue);
    I_S_Resource plant = MRPUtil.getCreatePlant(productValue, wh.getM_Warehouse_ID(), PlanningHorizon);
    I_M_Product product = MRPUtil.getCreateProduct(ctx, productValue, isPurchased);
    //
    MPPProductPlanning pp = new MPPProductPlanning(ctx, 0, null);
    pp.setIsCreatePlan(true);
    pp.setIsRequiredMRP(true);
    pp.setIsRequiredDRP(false);
    pp.setM_Product_ID(product.getM_Product_ID());
    pp.setAD_Org_ID(AD_Org_ID);
    pp.setM_Warehouse_ID(wh.getM_Warehouse_ID());
    pp.setS_Resource_ID(plant.getS_Resource_ID());
    //
    pp.setOrder_Policy(Order_Policy);
    pp.setOrder_Min(BigDecimal.valueOf(Order_Min));
    pp.setOrder_Max(BigDecimal.valueOf(Order_Max));
    pp.setOrder_Pack(BigDecimal.valueOf(Order_Pack));
    pp.setSafetyStock(BigDecimal.valueOf(SafetyStock));
    pp.setOrder_Period(BigDecimal.valueOf(Order_Period));
    pp.setDeliveryTime_Promised(BigDecimal.valueOf(LeadTime));
    //
    return pp;
}
Also used : I_S_Resource(org.compiere.model.I_S_Resource) I_M_Product(org.compiere.model.I_M_Product) MPPProductPlanning(org.eevolution.model.MPPProductPlanning) Properties(java.util.Properties) I_M_Warehouse(org.compiere.model.I_M_Warehouse)

Aggregations

I_S_Resource (org.compiere.model.I_S_Resource)2 BigDecimal (java.math.BigDecimal)1 Properties (java.util.Properties)1 I_M_Product (org.compiere.model.I_M_Product)1 I_M_Warehouse (org.compiere.model.I_M_Warehouse)1 MPPProductPlanning (org.eevolution.model.MPPProductPlanning)1