Author: jaz
Date: Fri May 18 18:37:26 2007
New Revision: 539666

URL: http://svn.apache.org/viewvc?view=rev&rev=539666
Log:
added initialEstimateAmt to the percent calc; also moved the percent calc to 
the end so all estimates get included

Modified:
    
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java?view=diff&rev=539666&r1=539665&r2=539666
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
 Fri May 18 18:37:26 2007
@@ -434,10 +434,6 @@
         if (estimate.getDouble("orderPricePercent") != null)
             orderPercent = 
estimate.getDouble("orderPricePercent").doubleValue();
 
-        double shippingPricePercent = 0.00;
-        if (estimate.getDouble("shippingPricePercent") != null)
-            shippingPricePercent = 
estimate.getDouble("shippingPricePercent").doubleValue();
-
         double itemFlatAmount = shippableQuantity.doubleValue() * 
orderItemFlat;
         double orderPercentage = shippableTotal.doubleValue() * (orderPercent 
/ 100);
 
@@ -517,8 +513,16 @@
         // surcharges total
         double surchargeTotal = featureSurcharge + sizeSurcharge;
 
+        // shipping subtotal
+        double subTotal = spanTotal + flatTotal + surchargeTotal;
+
+        // percent add-on
+        double shippingPricePercent = 0.00;
+        if (estimate.getDouble("shippingPricePercent") != null)
+            shippingPricePercent = 
estimate.getDouble("shippingPricePercent").doubleValue();
+
         // shipping total
-        double shippingTotal = spanTotal + flatTotal + surchargeTotal;
+        double shippingTotal = subTotal + ((subTotal + 
initialEstimateAmt.doubleValue()) * (shippingPricePercent / 100));
 
         // prepare the return result
         Map responseResult = ServiceUtil.returnSuccess();


Reply via email to