Author: jleroux
Date: Sat Nov 17 09:22:57 2007
New Revision: 595974
URL:
http://svn.apache.org/viewvc?rev=595974&view=revLog:
Applied fix from trunk for revision: 591283
Modified:
ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=595974&r1=595973&r2=595974&view=diff==============================================================================
--- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original)
+++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Sat Nov 17 09:22:57 2007
@@ -42,6 +42,7 @@
import org.ofbiz.entity.util.EntityUtil;
import org.ofbiz.order.finaccount.FinAccountHelper;
import org.ofbiz.order.order.OrderChangeHelper;
+import org.ofbiz.order.shoppingcart.shipping.ShippingEvents;
import org.ofbiz.party.contact.ContactHelper;
import org.ofbiz.product.store.ProductStoreWorker;
import org.ofbiz.service.GenericServiceException;
@@ -361,7 +362,21 @@
// set the shipping address
errorMessages.addAll(setCheckOutShippingAddressInternal(shippingContactMechId));
+
+ // Recalc shipping costs before setting payment
+ Map shipEstimateMap = ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0);
+ Double shippingTotal = (Double) shipEstimateMap.get("shippingTotal");
+ if (shippingTotal == null) {
+ shippingTotal = new Double(0.00);
+ }
+ cart.setItemShipGroupEstimate(shippingTotal.doubleValue(), 0);
+ //Recalc tax before setting payment
+ try {
+ this.calcAndAddTax();
+ } catch (GeneralException e) {
+ Debug.logError(e, module);
+ }
// set the payment method(s) option
errorMessages.addAll(setCheckOutPaymentInternal(selectedPaymentMethods, singleUsePayments, billingAccountId));