svn commit: r537084 - in /ofbiz/trunk/applications/product: servicedef/ src/org/ofbiz/product/inventory/ webapp/facility/WEB-INF/actions/facility/ webapp/facility/facility/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r537084 - in /ofbiz/trunk/applications/product: servicedef/ src/org/ofbiz/product/inventory/ webapp/facility/WEB-INF/actions/facility/ webapp/facility/facility/

hansbak-2
Author: hansbak
Date: Thu May 10 21:28:54 2007
New Revision: 537084

URL: http://svn.apache.org/viewvc?view=rev&rev=537084
Log:
the facility inventory list is very slow when there are a lot of products in inventory. With 15000 products, the system crashes and run out of memory. This update is a refactoring so that the inventory quanties are only retrieved for the products which are on screen. Previously this was done for all products which were in inventory. Work from my employee Wisut

Modified:
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
    ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?view=diff&rev=537084&r1=537083&r2=537084
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Thu May 10 21:28:54 2007
@@ -182,7 +182,24 @@
         <attribute name="mktgPkgQOHMap" type="Map" mode="OUT" optional="false"/>
         <attribute name="mktgPkgATPMap" type="Map" mode="OUT" optional="false"/>
     </service>
-
+    <service name="getProductInventoryAndFacilitySummary" engine="java"
+                location="org.ofbiz.product.inventory.InventoryServices" invoke="getProductInventoryAndFacilitySummary" auth="false" use-transaction="false">
+        <description>Get ATP/QOH Availability for a list of OrderItems by summing over all facilities.  If the item is a MARKETING_PKG_AUTO, then put its quantity available from components
+            in the mktgPkgATPMap and mktgPkgQOHMap.</description>
+        <attribute name="checkTime" type="Timestamp" mode="IN" optional="true"/>
+        <attribute name="facilityId" type="String" mode="IN" optional="false"/>
+        <attribute name="productId" type="String" mode="IN" optional="false"/>
+        <attribute name="minimumStock" mode="IN" type="String" optional="true"/>
+        <attribute name="totalQuantityOnHand" mode="OUT" type="String" optional="true"/>
+        <attribute name="totalAvailableToPromise" mode="OUT" type="String" optional="true"/>
+        <attribute name="quantityOnOrder" mode="OUT" type="Double" optional="true"/>
+        <attribute name="offsetQOHQtyAvailable" mode="OUT" type="Integer" optional="true"/>
+        <attribute name="offsetATPQtyAvailable" mode="OUT" type="Integer" optional="true"/>
+        <attribute name="defultPrice" mode="OUT" type="Double" optional="true"/>
+        <attribute name="listPrice" mode="OUT" type="Double" optional="true"/>
+        <attribute name="wholeSalePrice" mode="OUT" type="Double" optional="true"/>
+        <attribute name="usageQuantity" mode="OUT" type="Double" optional="true"/>
+    </service>
     <service name="checkInventoryAvailability" engine="java"
             location="org.ofbiz.product.inventory.InventoryServices" invoke="checkInventoryAvailability">
         <description>Batch service for checking and sending backorder notifications.  Will also set an autoCancelDate for sales orders to 30 days (hard coded)

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?view=diff&rev=537084&r1=537083&r2=537084
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Thu May 10 21:28:54 2007
@@ -30,11 +30,16 @@
 import org.ofbiz.base.util.Debug;
 import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
 import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.condition.EntityConditionList;
 import org.ofbiz.entity.condition.EntityExpr;
 import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.model.DynamicViewEntity;
+import org.ofbiz.entity.model.ModelKeyMap;
+import org.ofbiz.entity.util.EntityListIterator;
 import org.ofbiz.service.DispatchContext;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.LocalDispatcher;
@@ -786,4 +791,206 @@
         results.put("mktgPkgQOHMap", mktgPkgQohMap);
         return results;
     }
+    
+
+    public static Map getProductInventoryAndFacilitySummary(DispatchContext dctx, Map context) {
+        GenericDelegator delegator = dctx.getDelegator();
+        LocalDispatcher dispatcher = dctx.getDispatcher();
+        Timestamp checkTime = (Timestamp)context.get("checkTime");
+        String facilityId = (String)context.get("facilityId");
+        String productId = (String)context.get("productId");
+        String minimumStock = (String)context.get("minimumStock");
+
+        Map result = new HashMap();
+        Map resultOutput = new HashMap();
+
+        Map contextInput = UtilMisc.toMap("productId", productId, "facilityId", facilityId);
+        GenericValue product = null;
+        try {
+            product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId));
+        } catch (GenericEntityException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        if ("MARKETING_PKG_AUTO".equals(product.getString("productTypeId"))) {
+            try {
+                resultOutput = dispatcher.runSync("getMktgPackagesAvailable", contextInput);
+            } catch (GenericServiceException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        } else {
+            try {
+                resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", contextInput);
+            } catch (GenericServiceException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+        // filter for quantities
+        int minimumStockInt = 0;
+        if (minimumStock != null) {
+            minimumStockInt = new Double(minimumStock).intValue();
+        }
+
+        int quantityOnHandTotalInt = 0;
+        if (resultOutput.get("quantityOnHandTotal") != null) {
+            quantityOnHandTotalInt = ((Double)resultOutput.get("quantityOnHandTotal")).intValue();
+        }
+        int offsetQOHQtyAvailable = quantityOnHandTotalInt - minimumStockInt;
+
+        int availableToPromiseTotalInt = 0;
+        if (resultOutput.get("availableToPromiseTotal") != null) {
+            availableToPromiseTotalInt = ((Double)resultOutput.get("availableToPromiseTotal")).intValue();
+        }
+        int offsetATPQtyAvailable = availableToPromiseTotalInt - minimumStockInt;
+    
+        double quantityOnOrder = InventoryWorker.getOutstandingPurchasedQuantity(productId, delegator);
+        result.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal").toString());
+        result.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal").toString());
+        result.put("quantityOnOrder", new Double(quantityOnOrder));
+    
+        result.put("offsetQOHQtyAvailable", new Integer(offsetQOHQtyAvailable));
+        result.put("offsetATPQtyAvailable", new Integer(offsetATPQtyAvailable));
+    
+        List productPrices = null;
+        try {
+            productPrices = (List)delegator.findByAndCache("ProductPrice", UtilMisc.toMap("productId",productId), UtilMisc.toList("-fromDate"));
+        } catch (GenericEntityException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        Iterator pricesIt = productPrices.iterator();
+        //change this for product price
+        while (pricesIt.hasNext()) {
+            GenericValue onePrice = (GenericValue)pricesIt.next();
+            if(onePrice.getString("productPriceTypeId").equals("DEFAULT_PRICE")){ //defaultPrice
+                result.put("defultPrice", onePrice.getDouble("price"));
+            }else if(onePrice.getString("productPriceTypeId").equals("WHOLESALE_PRICE")){//
+                result.put("wholeSalePrice", onePrice.getDouble("price"));
+            }else if(onePrice.getString("productPriceTypeId").equals("LIST_PRICE")){//listPrice
+                result.put("listPrice", onePrice.getDouble("price"));
+            }else{
+                result.put("defultPrice", onePrice.getDouble("price"));
+                result.put("listPrice", onePrice.getDouble("price"));
+                result.put("wholeSalePrice", onePrice.getDouble("price"));
+            }
+        }
+    
+        DynamicViewEntity salesUsageViewEntity = new DynamicViewEntity();
+        DynamicViewEntity productionUsageViewEntity = new DynamicViewEntity();
+        if (! UtilValidate.isEmpty(checkTime)) {
+    
+            // Construct a dynamic view entity to search against for sales usage quantities
+            salesUsageViewEntity.addMemberEntity("OI", "OrderItem");
+            salesUsageViewEntity.addMemberEntity("OH", "OrderHeader");
+            salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance");
+            salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem");
+            salesUsageViewEntity.addViewLink("OI", "OH", new Boolean(false), ModelKeyMap.makeKeyMapList("orderId"));
+            salesUsageViewEntity.addViewLink("OI", "ItIss", new Boolean(false), ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"));
+            salesUsageViewEntity.addViewLink("ItIss", "InvIt", new Boolean(false), ModelKeyMap.makeKeyMapList("inventoryItemId"));
+            salesUsageViewEntity.addAlias("OI", "productId");
+            salesUsageViewEntity.addAlias("OH", "statusId");
+            salesUsageViewEntity.addAlias("OH", "orderTypeId");
+            salesUsageViewEntity.addAlias("OH", "orderDate");
+            salesUsageViewEntity.addAlias("ItIss", "inventoryItemId");
+            salesUsageViewEntity.addAlias("ItIss", "quantity");
+            salesUsageViewEntity.addAlias("InvIt", "facilityId");
+        
+            // Construct a dynamic view entity to search against for production usage quantities
+            productionUsageViewEntity.addMemberEntity("WEIA", "WorkEffortInventoryAssign");
+            productionUsageViewEntity.addMemberEntity("WE", "WorkEffort");
+            productionUsageViewEntity.addMemberEntity("II", "InventoryItem");
+            productionUsageViewEntity.addViewLink("WEIA", "WE", new Boolean(false), ModelKeyMap.makeKeyMapList("workEffortId"));
+            productionUsageViewEntity.addViewLink("WEIA", "II", new Boolean(false), ModelKeyMap.makeKeyMapList("inventoryItemId"));
+            productionUsageViewEntity.addAlias("WEIA", "quantity");
+            productionUsageViewEntity.addAlias("WE", "actualCompletionDate");
+            productionUsageViewEntity.addAlias("WE", "workEffortTypeId");
+            productionUsageViewEntity.addAlias("II", "facilityId");
+            productionUsageViewEntity.addAlias("II", "productId");
+
+        }
+        if (! UtilValidate.isEmpty(checkTime)) {
+            
+            // Make a query against the sales usage view entity
+            EntityListIterator salesUsageIt = null;
+            try {
+                salesUsageIt = delegator.findListIteratorByCondition(salesUsageViewEntity,
+                        new EntityConditionList(
+                            UtilMisc.toList(
+                                new EntityExpr("facilityId", EntityOperator.EQUALS, "WebStoreWarehouse"),
+                                new EntityExpr("productId", EntityOperator.EQUALS, productId),
+                                new EntityExpr("statusId", EntityOperator.IN, UtilMisc.toList("ORDER_COMPLETED", "ORDER_APPROVED", "ORDER_HELD")),
+                                new EntityExpr("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"),
+                                new EntityExpr("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)
+                            ),
+                        EntityOperator.AND),
+                    null, null, null, null);
+            } catch (GenericEntityException e2) {
+                // TODO Auto-generated catch block
+                e2.printStackTrace();
+            }
+    
+            // Sum the sales usage quantities found
+            double salesUsageQuantity = 0;
+            GenericValue salesUsageItem = null;
+            while((salesUsageItem = (GenericValue) salesUsageIt.next()) != null) {
+                if (salesUsageItem.get("quantity") != null) {
+                    try {
+                        salesUsageQuantity += salesUsageItem.getDouble("quantity").doubleValue();
+                    } catch (Exception e) {
+                        // Ignore
+                    }
+                }
+            }
+            try {
+                salesUsageIt.close();
+            } catch (GenericEntityException e2) {
+                // TODO Auto-generated catch block
+                e2.printStackTrace();
+            }
+    
+            // Make a query against the production usage view entity
+            EntityListIterator productionUsageIt = null;
+            try {
+                productionUsageIt = delegator.findListIteratorByCondition(productionUsageViewEntity,
+                        new EntityConditionList(
+                            UtilMisc.toList(
+                                new EntityExpr("facilityId", EntityOperator.EQUALS, "WebStoreWarehouse"),
+                                new EntityExpr("productId", EntityOperator.EQUALS, productId),
+                                new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"),
+                                new EntityExpr("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)
+                            ),
+                        EntityOperator.AND),
+                    null, null, null, null);
+            } catch (GenericEntityException e1) {
+                // TODO Auto-generated catch block
+                e1.printStackTrace();
+            }
+    
+            // Sum the production usage quantities found
+            double productionUsageQuantity = 0;
+            GenericValue productionUsageItem = null;
+            while((productionUsageItem = (GenericValue) productionUsageIt.next()) != null) {
+                if (productionUsageItem.get("quantity") != null) {
+                    try {
+                        productionUsageQuantity += productionUsageItem.getDouble("quantity").doubleValue();
+                    } catch (Exception e) {
+                        // Ignore
+                    }
+                }
+            }
+            try {
+                productionUsageIt.close();
+            } catch (GenericEntityException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+    
+            result.put("usageQuantity", new Double((salesUsageQuantity + productionUsageQuantity)));
+
+        }
+        return result;
+    }
+
 }

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh?view=diff&rev=537084&r1=537083&r2=537084
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh Thu May 10 21:28:54 2007
@@ -29,6 +29,7 @@
 import org.ofbiz.product.inventory.*;
 
 import org.ofbiz.widget.html.*;
+import java.sql.Timestamp;
 
 delegator = request.getAttribute("delegator");
 dispatcher = request.getAttribute("dispatcher");
@@ -151,7 +152,7 @@
     }
 
     // If the user has specified a number of months over which to sum usage quantities, define the correct timestamp
-    checkTime = null;
+    Timestamp checkTime = null;
     monthsInPastLimitStr = request.getParameter("monthsInPastLimit");
     if (UtilValidate.isNotEmpty(monthsInPastLimitStr)) {
         try {
@@ -165,142 +166,16 @@
         }
     }
 
-    if (! UtilValidate.isEmpty(checkTime)) {
-
-        // Construct a dynamic view entity to search against for sales usage quantities
-        salesUsageViewEntity = new DynamicViewEntity();
-        salesUsageViewEntity.addMemberEntity("OI", "OrderItem");
-        salesUsageViewEntity.addMemberEntity("OH", "OrderHeader");
-        salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance");
-        salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem");
-        salesUsageViewEntity.addViewLink("OI", "OH", false, ModelKeyMap.makeKeyMapList("orderId"));
-        salesUsageViewEntity.addViewLink("OI", "ItIss", false, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"));
-        salesUsageViewEntity.addViewLink("ItIss", "InvIt", false, ModelKeyMap.makeKeyMapList("inventoryItemId"));
-        salesUsageViewEntity.addAlias("OI", "productId");
-        salesUsageViewEntity.addAlias("OH", "statusId");
-        salesUsageViewEntity.addAlias("OH", "orderTypeId");
-        salesUsageViewEntity.addAlias("OH", "orderDate");
-        salesUsageViewEntity.addAlias("ItIss", "inventoryItemId");
-        salesUsageViewEntity.addAlias("ItIss", "quantity");
-        salesUsageViewEntity.addAlias("InvIt", "facilityId");
-    
-        // Construct a dynamic view entity to search against for production usage quantities
-        productionUsageViewEntity = new DynamicViewEntity();
-        productionUsageViewEntity.addMemberEntity("WEIA", "WorkEffortInventoryAssign");
-        productionUsageViewEntity.addMemberEntity("WE", "WorkEffort");
-        productionUsageViewEntity.addMemberEntity("II", "InventoryItem");
-        productionUsageViewEntity.addViewLink("WEIA", "WE", false, ModelKeyMap.makeKeyMapList("workEffortId"));
-        productionUsageViewEntity.addViewLink("WEIA", "II", false, ModelKeyMap.makeKeyMapList("inventoryItemId"));
-        productionUsageViewEntity.addAlias("WEIA", "quantity");
-        productionUsageViewEntity.addAlias("WE", "actualCompletionDate");
-        productionUsageViewEntity.addAlias("WE", "workEffortTypeId");
-        productionUsageViewEntity.addAlias("II", "facilityId");
-        productionUsageViewEntity.addAlias("II", "productId");
-
-    }
-
     prodsIt = prods.iterator();
-
     while (prodsIt.hasNext()) {
         oneProd = prodsIt.next();
-        contextInput = UtilMisc.toMap("productId",oneProd.getString("productId"), "facilityId", facilityId);
-        GenericValue product = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId",oneProd.getString("productId")));
-        if ("MARKETING_PKG_AUTO".equals(product.getString("productTypeId"))) {
-            resultOutput = dispatcher.runSync("getMktgPackagesAvailable", contextInput);
-        } else {
-            resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", contextInput);
-        }
-
-        // filter for quantities
-        minimumStockInt = 0;
-        if (oneProd.get("minimumStock") != null) {
-            minimumStockInt = (oneProd.getDouble("minimumStock")).intValue();
-        }
-
-        quantityOnHandTotalInt = 0;
-        if (resultOutput.get("quantityOnHandTotal") != null) {
-            quantityOnHandTotalInt = ((Double)resultOutput.get("quantityOnHandTotal")).intValue();
-        }
-        offsetQOHQtyAvailable = quantityOnHandTotalInt - minimumStockInt;
-        if (hasOffsetQOH && offsetQOHQtyAvailable > offsetQOH) continue;
-
-        availableToPromiseTotalInt = 0;
-        if (resultOutput.get("availableToPromiseTotal") != null) {
-            availableToPromiseTotalInt = ((Double)resultOutput.get("availableToPromiseTotal")).intValue();
-        }
-        offsetATPQtyAvailable = availableToPromiseTotalInt - minimumStockInt;
-        if (hasOffsetATP && offsetATPQtyAvailable > offsetATP) continue;
-        
-        quantityOnOrder = InventoryWorker.getOutstandingPurchasedQuantity(oneProd.getString("productId"), delegator);
-        
-        oneInventory = new HashMap();
+        Map oneInventory = new HashMap();
+        oneInventory.put("checkTime", checkTime);
+        oneInventory.put("facilityId", facilityId);
         oneInventory.put("productId", oneProd.getString("productId"));
         oneInventory.put("minimumStock", oneProd.getString("minimumStock"));
         oneInventory.put("reorderQuantity", oneProd.getString("reorderQuantity"));
         oneInventory.put("daysToShip", oneProd.getString("daysToShip"));
-        oneInventory.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal"));
-        oneInventory.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal"));
-        oneInventory.put("offsetQOHQtyAvailable", offsetQOHQtyAvailable);
-        oneInventory.put("offsetATPQtyAvailable", offsetATPQtyAvailable);
-        oneInventory.put("quantityOnOrder", quantityOnOrder);
-
-        if (! UtilValidate.isEmpty(checkTime)) {
-        
-            // Make a query against the sales usage view entity
-            salesUsageIt = delegator.findListIteratorByCondition(salesUsageViewEntity,
-                    new EntityConditionList(
-                        UtilMisc.toList(
-                            new EntityExpr("facilityId", EntityOperator.EQUALS, "WebStoreWarehouse"),
-                            new EntityExpr("productId", EntityOperator.EQUALS, oneProd.getString("productId")),
-                            new EntityExpr("statusId", EntityOperator.IN, UtilMisc.toList("ORDER_COMPLETED", "ORDER_APPROVED", "ORDER_HELD")),
-                            new EntityExpr("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"),
-                            new EntityExpr("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)
-                        ),
-                    EntityOperator.AND),
-                null, null, null, null);
-    
-            // Sum the sales usage quantities found
-            salesUsageQuantity = 0;
-            while((salesUsageItem = salesUsageIt.next()) != null) {
-                if (salesUsageItem.get("quantity") != null) {
-                    try {
-                        salesUsageQuantity += salesUsageItem.getDouble("quantity").doubleValue();
-                    } catch (Exception e) {
-                        // Ignore
-                    }
-                }
-            }
-            salesUsageIt.close();
-    
-            // Make a query against the production usage view entity
-            productionUsageIt = delegator.findListIteratorByCondition(productionUsageViewEntity,
-                    new EntityConditionList(
-                        UtilMisc.toList(
-                            new EntityExpr("facilityId", EntityOperator.EQUALS, "WebStoreWarehouse"),
-                            new EntityExpr("productId", EntityOperator.EQUALS, oneProd.getString("productId")),
-                            new EntityExpr("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"),
-                            new EntityExpr("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)
-                        ),
-                    EntityOperator.AND),
-                null, null, null, null);
-    
-            // Sum the production usage quantities found
-            productionUsageQuantity = 0;
-            while((productionUsageItem = productionUsageIt.next()) != null) {
-                if (productionUsageItem.get("quantity") != null) {
-                    try {
-                        productionUsageQuantity += productionUsageItem.getDouble("quantity").doubleValue();
-                    } catch (Exception e) {
-                        // Ignore
-                    }
-                }
-            }
-            productionUsageIt.close();
-    
-            oneInventory.put("usageQuantity", salesUsageQuantity + productionUsageQuantity);
-
-        }
-
         rows.add(oneInventory);
     }
 

Modified: ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml?view=diff&rev=537084&r1=537083&r2=537084
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Thu May 10 21:28:54 2007
@@ -108,6 +108,14 @@
     <form name="ListFacilityInventoryByProduct" type="list" target="" title="" list-name="inventoryByProduct"
         default-title-style="tableheadtext" default-widget-style="tabletext" default-tooltip-style="tabletext"
         paginate-target="${facilityInventoryByProductScreen}" override-list-size="${overrideListSize}">
+        <row-actions>
+            <service service-name="getProductInventoryAndFacilitySummary" result-map-name="resultMap">
+                <field-map field-name="minimumStock" env-name="minimumStock"/>
+                <field-map field-name="productId" env-name="productId"/>
+                <field-map field-name="facilityId" env-name="facilityId"/>
+                <field-map field-name="checkTime" env-name="checkTime"/>
+            </service>
+        </row-actions>
         <field name="items" title="${uiLabelMap.ProductProductId}" widget-style="buttontext">
             <hyperlink target="EditFacilityInventoryItems?productId=${productId}&amp;facilityId=${facilityId}" description="${productId}"/>    
         </field>
@@ -116,15 +124,18 @@
                 <sub-hyperlink target="/catalog/control/EditProduct?productId=${productId}" target-type="inter-app" description="${uiLabelMap.ProductCatalog}" link-style="buttontext"/>
             </display-entity>
         </field>
-        <field name="totalAvailableToPromise" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductAtp}" widget-area-style="tabletextright"><display/></field>
-        <field name="totalQuantityOnHand" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductQoh}" widget-area-style="tabletextright"><display/></field>
-        <field name="quantityOnOrder" title="${uiLabelMap.ProductOrderedQuantity}"  widget-area-style="tabletextright"><display/></field>
-        <field name="minimumStock" title="${uiLabelMap.ProductMinimumStock}" widget-area-style="tabletextright"><display/></field>
+        <field name="totalAvailableToPromise" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductAtp}" widget-area-style="tabletextright"><display description="${resultMap.totalAvailableToPromise}"/></field>
+        <field name="totalQuantityOnHand" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductQoh}" widget-area-style="tabletextright"><display description="${resultMap.totalQuantityOnHand}"/></field>
+        <field name="quantityOnOrder" title="${uiLabelMap.ProductOrderedQuantity}"  widget-area-style="tabletextright"><display description="${resultMap.quantityOnOrder}"/></field>
+        <field name="minimumStock" title="${uiLabelMap.ProductMinimumStock}" widget-area-style="tabletextright"><display /></field>
         <field name="reorderQuantity" title="${uiLabelMap.ProductReorderQuantity}" widget-area-style="tabletextright"><display/></field>
         <field name="daysToShip" title="${uiLabelMap.ProductDaysToShip}" widget-area-style="tabletextright"><display/></field>
-        <field name="offsetQOHQtyAvailable" title="${uiLabelMap.ProductQtyOffsetQOH}" widget-area-style="tabletextright"><display/></field>
-        <field name="offsetATPQtyAvailable" title="${uiLabelMap.ProductQtyOffsetATP}" widget-area-style="tabletextright"><display/></field>
-        <field name="usageQuantity" title="${uiLabelMap.ProductUsage}" widget-area-style="tabletextright"><display/></field>
+        <field name="offsetQOHQtyAvailable" title="${uiLabelMap.ProductQtyOffsetQOH}" widget-area-style="tabletextright"><display description="${resultMap.offsetQOHQtyAvailable}"/></field>
+        <field name="offsetATPQtyAvailable" title="${uiLabelMap.ProductQtyOffsetATP}" widget-area-style="tabletextright"><display description="${resultMap.offsetATPQtyAvailable}"/></field>
+        <field name="usageQuantity" title="${uiLabelMap.ProductUsage}" widget-area-style="tabletextright"><display description="${resultMap.usageQuantity}"/></field>
+        <field name="defultPrice" title="Default Price" widget-area-style="tabletextright"><display description="${resultMap.defultPrice}"/></field>
+        <field name="listPrice" title="List Price" widget-area-style="tabletextright"><display description="${resultMap.listPrice}"/></field>
+        <field name="wholeSalePrice" title="Whole Sale Price" widget-area-style="tabletextright"><display description="${resultMap.wholeSalePrice}"/></field>
     </form>
 
     <form name="SearchInventoryItemsParams" type="single" target="SearchInventoryItems"