Class InventoryWorker


  • public final class InventoryWorker
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantities​(java.util.Collection<java.lang.String> productIds, java.lang.String orderTypeId, Delegator delegator)
      Gets the quanitty of each product in the order that is outstanding across all orders of the given input type.
      static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantitiesForPurchaseOrders​(java.util.Collection<java.lang.String> productIds, Delegator delegator)
      As above, but for purchase orders
      static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantitiesForSalesOrders​(java.util.Collection<java.lang.String> productIds, Delegator delegator)
      As above, but for sales orders
      static java.math.BigDecimal getOutstandingPurchasedQuantity​(java.lang.String productId, Delegator delegator)
      Finds the net outstanding ordered quantity for a productId, netting quantity on outstanding purchase orders against cancelQuantity
      static java.util.List<GenericValue> getOutstandingPurchaseOrders​(java.lang.String productId, Delegator delegator)
      Finds all outstanding Purchase orders for a productId.
      • 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
    • Method Detail

      • getOutstandingPurchaseOrders

        public static java.util.List<GenericValue> getOutstandingPurchaseOrders​(java.lang.String productId,
                                                                                Delegator delegator)
        Finds all outstanding Purchase orders for a productId. The orders and the items cannot be completed, cancelled, or rejected
        Parameters:
        productId - the product id
        delegator - the delegator
        Returns:
        returns all outstanding Purchase orders for a productId
      • getOutstandingPurchasedQuantity

        public static java.math.BigDecimal getOutstandingPurchasedQuantity​(java.lang.String productId,
                                                                           Delegator delegator)
        Finds the net outstanding ordered quantity for a productId, netting quantity on outstanding purchase orders against cancelQuantity
        Parameters:
        productId - the product id
        delegator - the delegator
        Returns:
        returns the net outstanding ordered quantity for a productId
      • getOutstandingProductQuantities

        public static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantities​(java.util.Collection<java.lang.String> productIds,
                                                                                                                 java.lang.String orderTypeId,
                                                                                                                 Delegator delegator)
        Gets the quanitty of each product in the order that is outstanding across all orders of the given input type. Uses the OrderItemQuantityReportGroupByProduct view entity.
        Parameters:
        productIds - Collection of disticnt productIds in an order. Use OrderReadHelper.getOrderProductIds()
        orderTypeId - Either "SALES_ORDER" or "PURCHASE_ORDER"
        delegator - The delegator to use
        Returns:
        Map of productIds to quantities outstanding.
      • getOutstandingProductQuantitiesForSalesOrders

        public static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantitiesForSalesOrders​(java.util.Collection<java.lang.String> productIds,
                                                                                                                               Delegator delegator)
        As above, but for sales orders
      • getOutstandingProductQuantitiesForPurchaseOrders

        public static java.util.Map<java.lang.String,​java.math.BigDecimal> getOutstandingProductQuantitiesForPurchaseOrders​(java.util.Collection<java.lang.String> productIds,
                                                                                                                                  Delegator delegator)
        As above, but for purchase orders