You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/05/19 03:37:27 UTC
svn commit: r539666 -
/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/shipment/ShipmentServices.java
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();