Class InventoryWorker
java.lang.Object
org.apache.ofbiz.product.inventory.InventoryWorker
-
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,
BigDecimal> getOutstandingProductQuantities
(Collection<String> productIds, 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 Map<String,
BigDecimal> getOutstandingProductQuantitiesForPurchaseOrders
(Collection<String> productIds, Delegator delegator) As above, but for purchase ordersstatic Map<String,
BigDecimal> getOutstandingProductQuantitiesForSalesOrders
(Collection<String> productIds, Delegator delegator) As above, but for sales ordersstatic BigDecimal
getOutstandingPurchasedQuantity
(String productId, Delegator delegator) Finds the net outstanding ordered quantity for a productId, netting quantity on outstanding purchase orders against cancelQuantitystatic List<GenericValue>
getOutstandingPurchaseOrders
(String productId, Delegator delegator) Finds all outstanding Purchase orders for a productId.
-
Method Details
-
getOutstandingPurchaseOrders
public static List<GenericValue> getOutstandingPurchaseOrders(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 iddelegator
- the delegator- Returns:
- returns all outstanding Purchase orders for a productId
-
getOutstandingPurchasedQuantity
Finds the net outstanding ordered quantity for a productId, netting quantity on outstanding purchase orders against cancelQuantity- Parameters:
productId
- the product iddelegator
- the delegator- Returns:
- returns the net outstanding ordered quantity for a productId
-
getOutstandingProductQuantities
public static Map<String,BigDecimal> getOutstandingProductQuantities(Collection<String> productIds, 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 Map<String,BigDecimal> getOutstandingProductQuantitiesForSalesOrders(Collection<String> productIds, Delegator delegator) As above, but for sales orders -
getOutstandingProductQuantitiesForPurchaseOrders
public static Map<String,BigDecimal> getOutstandingProductQuantitiesForPurchaseOrders(Collection<String> productIds, Delegator delegator) As above, but for purchase orders
-