svn commit: r560642 - in /ofbiz/trunk/applications/order: src/org/ofbiz/order/shoppingcart/ShoppingCart.java webapp/ordermgr/order/editorderitems.ftl webapp/ordermgr/order/orderitems.ftl

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

svn commit: r560642 - in /ofbiz/trunk/applications/order: src/org/ofbiz/order/shoppingcart/ShoppingCart.java webapp/ordermgr/order/editorderitems.ftl webapp/ordermgr/order/orderitems.ftl

lektran
Author: lektran
Date: Sat Jul 28 16:07:53 2007
New Revision: 560642

URL: http://svn.apache.org/viewvc?view=rev&rev=560642
Log:
Replaced all remaining calls to OrderReadHelper.calcItemAdjustment() with it's BigDecimal equivalent, OFBIZ-880

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
    ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?view=diff&rev=560642&r1=560641&r2=560642
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sat Jul 28 16:07:53 2007
@@ -3341,7 +3341,7 @@
                             /*
                             if ((productPromoAction.get("productId") == null || productPromoAction.getString("productId").equals(item.getShipmentMethodTypeId())) &&
                                 (productPromoAction.get("partyId") == null || productPromoAction.getString("partyId").equals(item.getCarrierPartyId()))) {
-                                Double shippingAmount = new Double(-OrderReadHelper.calcItemAdjustment(orderAdjustment, new Double(item.getQuantity()), new Double(item.getItemSubTotal())));
+                                Double shippingAmount = new Double(OrderReadHelper.calcItemAdjustmentBd(orderAdjustment, new BigDecimal(item.getQuantity()), new BigDecimal(item.getItemSubTotal())).negate().doubleValue());
                                 // always set orderAdjustmentTypeId to SHIPPING_CHARGES for free shipping adjustments
                                 GenericValue fsOrderAdjustment = getDelegator().makeValue("OrderAdjustment",
                                         UtilMisc.toMap("orderItemSeqId", orderAdjustment.get("orderItemSeqId"), "orderAdjustmentTypeId", "SHIPPING_CHARGES", "amount", shippingAmount,
@@ -4227,14 +4227,14 @@
             public double quantity = 0;
 
             public double getItemTax(ShoppingCart cart) {
-                double itemTax = 0.00;
+                BigDecimal itemTax = ZERO;
 
                 for (int i = 0; i < itemTaxAdj.size(); i++) {
                     GenericValue v = (GenericValue) itemTaxAdj.get(i);
-                    itemTax += OrderReadHelper.calcItemAdjustment(v, new Double(quantity), new Double(item.getBasePrice()));
+                    itemTax = itemTax.add(OrderReadHelper.calcItemAdjustmentBd(v, new BigDecimal(quantity), new BigDecimal(item.getBasePrice())));
                 }
 
-                return itemTax;
+                return itemTax.setScale(taxCalcScale, taxRounding).doubleValue();
             }
 
             public double getItemQuantity() {

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl?view=diff&rev=560642&r1=560641&r2=560642
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl Sat Jul 28 16:07:53 2007
@@ -186,7 +186,7 @@
                     <td>&nbsp;</td>
                     <td>&nbsp;</td>
                     <td class="align-text">
-                        <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcItemAdjustment(orderItemAdjustment, orderItem) isoCode=currencyUomId/>
+                        <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcItemAdjustmentBd(orderItemAdjustment, orderItem) isoCode=currencyUomId/>
                     </td>
                     <td colspan="3">&nbsp;</td>
                 </tr>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl?view=diff&rev=560642&r1=560641&r2=560642
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl Sat Jul 28 16:07:53 2007
@@ -337,7 +337,7 @@
                     <td>&nbsp;</td>
                     <td align="right">
                       <div class="tabletext" style="font-size: xx-small;">
-                        <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcItemAdjustment(orderItemAdjustment, orderItem) isoCode=currencyUomId/>
+                        <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].calcItemAdjustmentBd(orderItemAdjustment, orderItem) isoCode=currencyUomId/>
                       </div>
                      </td>
                     <td>&nbsp;</td>