Class ProposedOrder


  • public class ProposedOrder
    extends java.lang.Object
    Proposed Order Object generated by the MRP process or other re-Order process
    • Constructor Summary

      Constructors 
      Constructor Description
      ProposedOrder​(GenericValue product, java.lang.String facilityId, java.lang.String manufacturingFacilityId, boolean isBuilt, java.sql.Timestamp requiredByDate, java.math.BigDecimal quantity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void calculateQuantityToSupply​(java.math.BigDecimal reorderQuantity, java.math.BigDecimal minimumStock, java.util.ListIterator<GenericValue> listIterIEP)
      calculate the ProposedOrder quantity and update the quantity property.
      java.util.Map<java.lang.String,​java.lang.Object> calculateStartDate​(int daysToShip, GenericValue routing, Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin)
      calculate the ProposedOrder requirementStartDate and update the requirementStartDate property.
      java.lang.String create​(DispatchContext ctx, GenericValue userLogin)
      create a ProposedOrder in the Requirement Entity calling the createRequirement service.
      java.math.BigDecimal getQuantity()
      get the quantity property.
      java.sql.Timestamp getRequirementStartDate()
      get the requirementStartDate property.
      void setMrpName​(java.lang.String mrpName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
      • isBuilt

        protected boolean isBuilt
      • productId

        protected java.lang.String productId
      • facilityId

        protected java.lang.String facilityId
      • manufacturingFacilityId

        protected java.lang.String manufacturingFacilityId
      • mrpName

        protected java.lang.String mrpName
      • requiredByDate

        protected java.sql.Timestamp requiredByDate
      • requirementStartDate

        protected java.sql.Timestamp requirementStartDate
      • quantity

        protected java.math.BigDecimal quantity
    • Constructor Detail

      • ProposedOrder

        public ProposedOrder​(GenericValue product,
                             java.lang.String facilityId,
                             java.lang.String manufacturingFacilityId,
                             boolean isBuilt,
                             java.sql.Timestamp requiredByDate,
                             java.math.BigDecimal quantity)
    • Method Detail

      • getQuantity

        public java.math.BigDecimal getQuantity()
        get the quantity property.
        Returns:
        the quantity property
      • getRequirementStartDate

        public java.sql.Timestamp getRequirementStartDate()
        get the requirementStartDate property.
        Returns:
        the quantity property
      • calculateStartDate

        public java.util.Map<java.lang.String,​java.lang.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.
      • calculateQuantityToSupply

        public void calculateQuantityToSupply​(java.math.BigDecimal reorderQuantity,
                                              java.math.BigDecimal minimumStock,
                                              java.util.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 java.lang.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​(java.lang.String mrpName)