svn commit: r983920 - in /ofbiz/trunk: framework/base/src/org/ofbiz/base/util/UtilFormatOut.java specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

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

svn commit: r983920 - in /ofbiz/trunk: framework/base/src/org/ofbiz/base/util/UtilFormatOut.java specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

jleroux@apache.org
Author: jleroux
Date: Tue Aug 10 10:43:01 2010
New Revision: 983920

URL: http://svn.apache.org/viewvc?rev=983920&view=rev
Log:
A patch from René Scheibe ""setShippingOption" service called from one page checkout throws Exception" (https://issues.apache.org/jira/browse/OFBIZ-3886) - OFBIZ-3886

The shippingTotal has to be a BigDecimal for the methods called...

    * org.ofbiz.base.util.UtilFormatOut.formatCurrency(...)
    * org.ofbiz.order.shoppingcart.ShoppingCart.setItemShipGroupEstimate(...)

...so in case it's null, initialize it with BigDecimal.ZERO instead of 0.00

Fixes also some JavaDoc in UtilFormatOut.java

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
    ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java?rev=983920&r1=983919&r2=983920&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilFormatOut.java Tue Aug 10 10:43:01 2010
@@ -99,7 +99,7 @@ public class UtilFormatOut {
     }
 
     /** Formats a BigDecimal into a properly formatted currency string based on isoCode and Locale
-     * @param price The price double to be formatted
+     * @param price The price BigDecimal to be formatted
      * @param isoCode the currency ISO code
      * @param locale The Locale used to format the number
      * @param maximumFractionDigits The maximum number of fraction digits used; if set to -1 than the default value for the locale is used
@@ -124,8 +124,8 @@ public class UtilFormatOut {
         return nbParsing;
     }
 
-    /** Formats a double into a properly formatted currency string based on isoCode and Locale
-     * @param price The price double to be formatted
+    /** Formats a BigDecimal into a properly formatted currency string based on isoCode and Locale
+     * @param price The price BigDecimal to be formatted
      * @param isoCode the currency ISO code
      * @param locale The Locale used to format the number
      * @return A String with the formatted price

Modified: ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=983920&r1=983919&r2=983920&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml Tue Aug 10 10:43:01 2010
@@ -1053,7 +1053,7 @@ under the License.
             Map shipCost = org.ofbiz.order.shoppingcart.shipping.ShippingEvents.getShipGroupEstimate(dispatcher, delegator, shoppingCart, 0);
             shippingTotal = shipCost.get("shippingTotal");
             if (shippingTotal == null) {
-                shippingTotal = 0.00;
+                shippingTotal = java.math.BigDecimal.ZERO;
             }
             shoppingCart.setItemShipGroupEstimate(shippingTotal, 0);
             parameters.put("shippingTotal", org.ofbiz.base.util.UtilFormatOut.formatCurrency(shippingTotal, isoCode, locale));
@@ -1068,7 +1068,6 @@ under the License.
 
             cartGrandTotal = org.ofbiz.base.util.UtilFormatOut.formatCurrency(shoppingCart.getGrandTotal(), isoCode, locale);
             parameters.put("cartGrandTotal", cartGrandTotal);
-
         ]]></call-bsh>
         <call-class-method method-name="doPromotions" class-name="org.ofbiz.order.shoppingcart.product.ProductPromoWorker">
             <field field="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/>
@@ -1245,4 +1244,4 @@ under the License.
             <store-value value-field="loggedInUser"/>
         </if-compare-field>
     </simple-method>
-</simple-methods>
\ No newline at end of file
+</simple-methods>