Class ProposedOrder
java.lang.Object
org.apache.ofbiz.manufacturing.mrp.ProposedOrder
Proposed Order Object generated by the MRP process or other re-Order process
-
Constructor Summary
ConstructorDescriptionProposedOrder
(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, BigDecimal quantity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateQuantityToSupply
(BigDecimal reorderQuantity, BigDecimal minimumStock, ListIterator<GenericValue> listIterIEP) calculate the ProposedOrder quantity and update the quantity property.calculateStartDate
(int daysToShip, GenericValue routing, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin) calculate the ProposedOrder requirementStartDate and update the requirementStartDate property.create
(DispatchContext ctx, GenericValue userLogin) create a ProposedOrder in the Requirement Entity calling the createRequirement service.get the quantity property.get the requirementStartDate property.void
setMrpName
(String mrpName) Sets mrp name.
-
Constructor Details
-
ProposedOrder
public ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, BigDecimal quantity)
-
-
Method Details
-
getQuantity
get the quantity property.- Returns:
- the quantity property
-
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
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
Sets mrp name.- Parameters:
mrpName
- the mrp name
-