Class ProposedOrder
- java.lang.Object
-
- org.apache.ofbiz.manufacturing.mrp.ProposedOrder
-
public class ProposedOrder extends Object
Proposed Order Object generated by the MRP process or other re-Order process
-
-
Field Summary
Fields Modifier and Type Field Description protected String
facilityId
protected boolean
isBuilt
protected String
manufacturingFacilityId
static String
module
protected String
mrpName
protected GenericValue
product
protected String
productId
protected BigDecimal
quantity
protected Timestamp
requiredByDate
protected Timestamp
requirementStartDate
static String
resource
-
Constructor Summary
Constructors Constructor Description ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, BigDecimal quantity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateQuantityToSupply(BigDecimal reorderQuantity, BigDecimal minimumStock, ListIterator<GenericValue> listIterIEP)
calculate the ProposedOrder quantity and update the quantity property.Map<String,Object>
calculateStartDate(int daysToShip, GenericValue routing, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin)
calculate the ProposedOrder requirementStartDate and update the requirementStartDate property.String
create(DispatchContext ctx, GenericValue userLogin)
create a ProposedOrder in the Requirement Entity calling the createRequirement service.BigDecimal
getQuantity()
get the quantity property.Timestamp
getRequirementStartDate()
get the requirementStartDate property.void
setMrpName(String mrpName)
-
-
-
Field Detail
-
module
public static final String module
-
resource
public static final String resource
- See Also:
- Constant Field Values
-
product
protected GenericValue product
-
isBuilt
protected boolean isBuilt
-
productId
protected String productId
-
facilityId
protected String facilityId
-
manufacturingFacilityId
protected String manufacturingFacilityId
-
mrpName
protected String mrpName
-
requiredByDate
protected Timestamp requiredByDate
-
requirementStartDate
protected Timestamp requirementStartDate
-
quantity
protected BigDecimal quantity
-
-
Constructor Detail
-
ProposedOrder
public ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, BigDecimal quantity)
-
-
Method Detail
-
getQuantity
public BigDecimal getQuantity()
get the quantity property.- Returns:
- the quantity property
-
getRequirementStartDate
public Timestamp getRequirementStartDate()
get the requirementStartDate property.- Returns:
- the quantity property
-
calculateStartDate
public Map<String,Object> calculateStartDate(int daysToShip, GenericValue routing, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin)
calculate the ProposedOrder requirementStartDate and update the requirementStartDate property.- For the build product,
- read the routing associated to the product,
- read the routingTask associated to the routing
- step by step calculate from the endDate the startDate
- For the bought product, the first ProductFacility.daysToShip is used to calculated the startDate
- Returns:
- if ProposedOrder.isBuild a Map with all the routingTaskId as keys and estimatedStartDate as value.
- else null.
- For the build product,
-
calculateQuantityToSupply
public void calculateQuantityToSupply(BigDecimal reorderQuantity, BigDecimal minimumStock, ListIterator<GenericValue> listIterIEP)
calculate the ProposedOrder quantity and update the quantity property. Read the first ProductFacility.reorderQuantity and calculate the quantity : if (quantity < reorderQuantity) quantity = reorderQuantity;
-
create
public String create(DispatchContext ctx, GenericValue userLogin)
create a ProposedOrder in the Requirement Entity calling the createRequirement service.- Parameters:
ctx
- The DispatchContext used to call service to create the Requirement Entity record.- Returns:
- String the requirementId
-
setMrpName
public void setMrpName(String mrpName)
-
-