You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ap...@apache.org on 2007/10/21 09:28:07 UTC

svn commit: r586859 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh

Author: apatel
Date: Sun Oct 21 00:28:03 2007
New Revision: 586859

URL: http://svn.apache.org/viewvc?rev=586859&view=rev
Log:
Minor NOE fixes.

Modified:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh?rev=586859&r1=586858&r2=586859&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.bsh Sun Oct 21 00:28:03 2007
@@ -63,20 +63,31 @@
                         }
                     }
                 }
-                
-                totalCostPrice = costPrice * quantityOnHandTotal;
-                totalRetailPrice = retailPrice * availableToPromiseTotal;
-                qohGrandTotal += quantityOnHandTotal;
-                atpGrandTotal += availableToPromiseTotal;
-                costPriceGrandTotal += costPrice;
-                retailPriceGrandTotal += retailPrice;
-                totalCostPriceGrandTotal += totalCostPrice;
-                totalRetailPriceGrandTotal += totalRetailPrice;
+                if(costPrice != null && quantityOnHandTotal != null){
+                    totalCostPrice = costPrice * quantityOnHandTotal;
+                    resultMap.put("totalCostPrice", totalCostPrice);
+                    totalCostPriceGrandTotal += totalCostPrice;
+                }
+                if(retailPrice != null && quantityOnHandTotal != null){
+                    totalRetailPrice = retailPrice * quantityOnHandTotal;
+                    resultMap.put("totalRetailPrice", totalRetailPrice);
+                    totalRetailPriceGrandTotal += totalRetailPrice;
+                }
+                if(quantityOnHandTotal != null){
+                    qohGrandTotal += quantityOnHandTotal;
+                }
+                if(availableToPromiseTotal != null){
+                    atpGrandTotal += availableToPromiseTotal;
+                }
+                if(costPrice != null){
+                    costPriceGrandTotal += costPrice;
+                }
+                if(retailPrice != null){
+                    retailPriceGrandTotal += retailPrice;
+                }
                 
                 resultMap = UtilMisc.toMap("productId", product.getString("productId"), "quantityOnHand", quantityOnHandTotal, "availableToPromise", availableToPromiseTotal, 
                         "costPrice", costPrice, "retailPrice", retailPrice);
-                resultMap.put("totalCostPrice", totalCostPrice);
-                resultMap.put("totalRetailPrice", totalRetailPrice);
                 inventoryItemTotals.add(resultMap);
             }
         }