svn commit: r576285 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java order/src/org/ofbiz/order/order/OrderReadHelper.java order/src/org/ofbiz/order/order/OrderServices.java

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

svn commit: r576285 - in /ofbiz/trunk/applications: accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java order/src/org/ofbiz/order/order/OrderReadHelper.java order/src/org/ofbiz/order/order/OrderServices.java

lektran
Author: lektran
Date: Mon Sep 17 00:16:05 2007
New Revision: 576285

URL: http://svn.apache.org/viewvc?rev=576285&view=rev
Log:
Removed the following deprecated double methods and renamed their BigDecimal equivalents:
getItemPendingShipmentQuantity
getTotalOrderItemsQuantity
getTotalOrderItemsOrderedQuantity
getOrderItemsSubTotal
getOrderItemSubTotal

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=576285&r1=576284&r2=576285&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Mon Sep 17 00:16:05 2007
@@ -217,11 +217,11 @@
             String billFromVendorPartyId = orh.getBillFromParty().getString("partyId");
 
             // get some quantity totals
-            BigDecimal totalItemsInOrder = orh.getTotalOrderItemsQuantityBd();
+            BigDecimal totalItemsInOrder = orh.getTotalOrderItemsQuantity();
 
             // get some price totals
             BigDecimal shippableAmount = orh.getShippableTotal(null);
-            BigDecimal orderSubTotal = orh.getOrderItemsSubTotalBd();
+            BigDecimal orderSubTotal = orh.getOrderItemsSubTotal();
 
             // these variables are for pro-rating order amounts across invoices, so they should not be rounded off for maximum accuracy
             BigDecimal invoiceShipProRateAmount = ZERO;

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=576285&r1=576284&r2=576285&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Mon Sep 17 00:16:05 2007
@@ -753,15 +753,15 @@
     }
 
     public BigDecimal getShippingTotal() {
-        return OrderReadHelper.calcOrderAdjustmentsBd(getOrderHeaderAdjustments(), getOrderItemsSubTotalBd(), false, false, true);
+        return OrderReadHelper.calcOrderAdjustmentsBd(getOrderHeaderAdjustments(), getOrderItemsSubTotal(), false, false, true);
     }
 
     public BigDecimal getHeaderTaxTotal() {
-        return OrderReadHelper.calcOrderAdjustmentsBd(getOrderHeaderAdjustments(), getOrderItemsSubTotalBd(), false, true, false);
+        return OrderReadHelper.calcOrderAdjustmentsBd(getOrderHeaderAdjustments(), getOrderItemsSubTotal(), false, true, false);
     }
 
     public BigDecimal getTaxTotal() {
-        return OrderReadHelper.calcOrderAdjustmentsBd(getAdjustments(), getOrderItemsSubTotalBd(), false, true, false);
+        return OrderReadHelper.calcOrderAdjustmentsBd(getAdjustments(), getOrderItemsSubTotal(), false, true, false);
     }
 
     public Set getItemFeatureSet(GenericValue item) {
@@ -929,7 +929,7 @@
                 }
                 if (product != null) {
                     if (ProductWorker.shippingApplies(product)) {
-                        shippableTotal = shippableTotal.add(OrderReadHelper.getOrderItemSubTotalBd(item, getAdjustments(), false, true)).setScale(scale, rounding);
+                        shippableTotal = shippableTotal.add(OrderReadHelper.getOrderItemSubTotal(item, getAdjustments(), false, true)).setScale(scale, rounding);
                     }
                 }
             }
@@ -1331,7 +1331,7 @@
     }
 
     public BigDecimal getOrderAdjustmentTotal(GenericValue adjustment) {
-        return calcOrderAdjustmentBd(adjustment, getOrderItemsSubTotalBd());
+        return calcOrderAdjustmentBd(adjustment, getOrderItemsSubTotal());
     }
 
     public int hasSurvey() {
@@ -1876,7 +1876,7 @@
                 continue;
             }
             BigDecimal itemQuantity = itemQuantityDbl;
-            BigDecimal itemSubTotal = this.getOrderItemSubTotalBd(orderItem);
+            BigDecimal itemSubTotal = this.getOrderItemSubTotal(orderItem);
             BigDecimal itemTaxes = this.getOrderItemTaxBd(orderItem);
             BigDecimal itemShipping = this.getOrderItemShippingBd(orderItem);
 
@@ -1903,7 +1903,7 @@
         }
 
         // calculate tax and shipping adjustments for entire order, add to result
-        BigDecimal orderItemsSubTotal = this.getOrderItemsSubTotalBd();
+        BigDecimal orderItemsSubTotal = this.getOrderItemsSubTotal();
         BigDecimal orderFactorNotReturned = ZERO;
         if (orderItemsSubTotal.signum() != 0) {
             // pro-rated factor (subtotal not returned / item subtotal), which shouldn't be rounded to 2 decimals
@@ -2076,24 +2076,19 @@
         return backOrdered;
     }
 
-    public BigDecimal getItemPendingShipmentQuantityBd(GenericValue orderItem) {
+    public BigDecimal getItemPendingShipmentQuantity(GenericValue orderItem) {
         BigDecimal reservedQty = getItemReservedQuantity(orderItem);
         BigDecimal backordered = getItemBackorderedQuantity(orderItem);
         return reservedQty.subtract(backordered).setScale(scale, rounding);
     }
 
-    /** @deprecated */
-    public double getItemPendingShipmentQuantity(GenericValue orderItem) {
-        return getItemPendingShipmentQuantityBd(orderItem).doubleValue();
-    }
-
     public double getItemCanceledQuantity(GenericValue orderItem) {
         Double cancelQty = orderItem.getDouble("cancelQuantity");
         if (cancelQty == null) cancelQty = new Double(0);
         return cancelQty.doubleValue();
     }
 
-    public BigDecimal getTotalOrderItemsQuantityBd() {
+    public BigDecimal getTotalOrderItemsQuantity() {
         List orderItems = getValidOrderItems();
         BigDecimal totalItems = ZERO;
 
@@ -2105,12 +2100,7 @@
         return totalItems.setScale(scale, rounding);
     }
 
-    /** @deprecated */
-    public double getTotalOrderItemsQuantity() {
-        return getTotalOrderItemsQuantityBd().doubleValue();
-    }
-
-    public BigDecimal getTotalOrderItemsOrderedQuantityBd() {
+    public BigDecimal getTotalOrderItemsOrderedQuantity() {
         List orderItems = getValidOrderItems();
         BigDecimal totalItems = ZERO;
 
@@ -2122,27 +2112,12 @@
         return totalItems;
     }
 
-    /** @deprecated */
-    public double getTotalOrderItemsOrderedQuantity() {
-        return getTotalOrderItemsOrderedQuantityBd().doubleValue();
-    }
-
-    public BigDecimal getOrderItemsSubTotalBd() {
-        return getOrderItemsSubTotalBd(getValidOrderItems(), getAdjustments());
+    public BigDecimal getOrderItemsSubTotal() {
+        return getOrderItemsSubTotal(getValidOrderItems(), getAdjustments());
     }
 
-    /** @deprecated */
-    public double getOrderItemsSubTotal() {
-        return getOrderItemsSubTotalBd().doubleValue();
-    }
-
-    public BigDecimal getOrderItemSubTotalBd(GenericValue orderItem) {
-        return getOrderItemSubTotalBd(orderItem, getAdjustments());
-    }
-
-    /** @deprecated */
-    public double getOrderItemSubTotal(GenericValue orderItem) {
-        return getOrderItemSubTotalBd(orderItem).doubleValue();
+    public BigDecimal getOrderItemSubTotal(GenericValue orderItem) {
+        return getOrderItemSubTotal(orderItem, getAdjustments());
     }
 
     public BigDecimal getOrderItemsTotalBd() {
@@ -2373,7 +2348,7 @@
     }
 
     public static BigDecimal getOrderAdjustmentsTotal(List orderItems, List adjustments) {
-        return calcOrderAdjustmentsBd(getOrderHeaderAdjustments(adjustments, null), getOrderItemsSubTotalBd(orderItems, adjustments), true, true, true);
+        return calcOrderAdjustmentsBd(getOrderHeaderAdjustments(adjustments, null), getOrderItemsSubTotal(orderItems, adjustments), true, true, true);
     }
 
     public static List getOrderSurveyResponses(GenericValue orderHeader) {
@@ -2455,22 +2430,17 @@
     }
 
     // ================= Order Item Adjustments =================
-    public static BigDecimal getOrderItemsSubTotalBd(List orderItems, List adjustments) {
-        return getOrderItemsSubTotalBd(orderItems, adjustments, null);
-    }
-
-    /** @deprecated */
-    public static double getOrderItemsSubTotal(List orderItems, List adjustments) {
-        return getOrderItemsSubTotalBd(orderItems, adjustments).doubleValue();
+    public static BigDecimal getOrderItemsSubTotal(List orderItems, List adjustments) {
+        return getOrderItemsSubTotal(orderItems, adjustments, null);
     }
 
-    public static BigDecimal getOrderItemsSubTotalBd(List orderItems, List adjustments, List workEfforts) {
+    public static BigDecimal getOrderItemsSubTotal(List orderItems, List adjustments, List workEfforts) {
         BigDecimal result = ZERO;
         Iterator itemIter = UtilMisc.toIterator(orderItems);
 
         while (itemIter != null && itemIter.hasNext()) {
             GenericValue orderItem = (GenericValue) itemIter.next();
-            BigDecimal itemTotal = getOrderItemSubTotalBd(orderItem, adjustments);
+            BigDecimal itemTotal = getOrderItemSubTotal(orderItem, adjustments);
             // Debug.log("Item : " + orderItem.getString("orderId") + " / " + orderItem.getString("orderItemSeqId") + " = " + itemTotal, module);
 
             if (workEfforts != null && orderItem.getString("orderItemTypeId").compareTo("RENTAL_ORDER_ITEM") == 0) {
@@ -2490,23 +2460,13 @@
         return result.setScale(scale, rounding);
     }
 
-    /** @deprecated */
-    public static double getOrderItemsSubTotal(List orderItems, List adjustments, List workEfforts) {
-        return getOrderItemsSubTotalBd(orderItems, adjustments, workEfforts).doubleValue();
-    }
-
     /** The passed adjustments can be all adjustments for the order, ie for all line items */
-    public static BigDecimal getOrderItemSubTotalBd(GenericValue orderItem, List adjustments) {
-        return getOrderItemSubTotalBd(orderItem, adjustments, false, false);
-    }
-
-    /** @deprecated */
-    public static double getOrderItemSubTotal(GenericValue orderItem, List adjustments) {
-        return getOrderItemSubTotalBd(orderItem, adjustments).doubleValue();
+    public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, List adjustments) {
+        return getOrderItemSubTotal(orderItem, adjustments, false, false);
     }
 
     /** The passed adjustments can be all adjustments for the order, ie for all line items */
-    public static BigDecimal getOrderItemSubTotalBd(GenericValue orderItem, List adjustments, boolean forTax, boolean forShipping) {
+    public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, List adjustments, boolean forTax, boolean forShipping) {
         BigDecimal unitPrice = orderItem.getBigDecimal("unitPrice");
         BigDecimal quantity = getOrderItemQuantityBd(orderItem);
         BigDecimal result = ZERO;
@@ -2541,11 +2501,6 @@
         return result.setScale(scale, rounding);
     }
 
-    /** @deprecated */
-    public static double getOrderItemSubTotal(GenericValue orderItem, List adjustments, boolean forTax, boolean forShipping) {
-        return getOrderItemSubTotalBd(orderItem, adjustments, forTax, forShipping).doubleValue();
-    }
-
     public static BigDecimal getOrderItemsTotalBd(List orderItems, List adjustments) {
         BigDecimal result = ZERO;
         Iterator itemIter = UtilMisc.toIterator(orderItems);
@@ -2563,7 +2518,7 @@
 
     public static BigDecimal getOrderItemTotalBd(GenericValue orderItem, List adjustments) {
         // add tax and shipping to subtotal
-        return getOrderItemSubTotalBd(orderItem, adjustments).add(getOrderItemAdjustmentsTotalBd(orderItem, adjustments, false, true, true));
+        return getOrderItemSubTotal(orderItem, adjustments).add(getOrderItemAdjustmentsTotalBd(orderItem, adjustments, false, true, true));
     }
 
     /** @deprecated */

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=576285&r1=576284&r2=576285&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Mon Sep 17 00:16:05 2007
@@ -1335,7 +1335,7 @@
                     // adjustments and total
                     List allAdjustments = orh.getAdjustments();
                     List orderHeaderAdjustments = OrderReadHelper.getOrderHeaderAdjustments(allAdjustments, shipGroupSeqId);
-                    BigDecimal orderSubTotal = OrderReadHelper.getOrderItemsSubTotalBd(validOrderItems, allAdjustments);
+                    BigDecimal orderSubTotal = OrderReadHelper.getOrderItemsSubTotal(validOrderItems, allAdjustments);
 
                     // shipping amount
                     BigDecimal orderShipping = OrderReadHelper.calcOrderAdjustmentsBd(orderHeaderAdjustments, orderSubTotal, false, false, true);
@@ -1346,7 +1346,7 @@
                         String productId = orderItem.getString("productId");
                         try {
                             products.add(i, delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", productId)));  // get the product entity
-                            amounts.add(i, OrderReadHelper.getOrderItemSubTotalBd(orderItem, allAdjustments, true, false)); // get the item amount
+                            amounts.add(i, OrderReadHelper.getOrderItemSubTotal(orderItem, allAdjustments, true, false)); // get the item amount
                             shipAmts.add(i, OrderReadHelper.getOrderItemAdjustmentsTotalBd(orderItem, allAdjustments, false, false, true)); // get the shipping amount
                             itPrices.add(i, orderItem.getBigDecimal("unitPrice"));
                         } catch (GenericEntityException e) {
@@ -1541,7 +1541,7 @@
                 }
 
                 BigDecimal currentShipping = OrderReadHelper.getAllOrderItemsAdjustmentsTotalBd(orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId), orh.getAdjustments(), false, false, true);
-                currentShipping = currentShipping.add(OrderReadHelper.calcOrderAdjustmentsBd(orh.getOrderHeaderAdjustments(shipGroupSeqId), orh.getOrderItemsSubTotalBd(), false, false, true));
+                currentShipping = currentShipping.add(OrderReadHelper.calcOrderAdjustmentsBd(orh.getOrderHeaderAdjustments(shipGroupSeqId), orh.getOrderItemsSubTotal(), false, false, true));
 
                 if (Debug.infoOn()) {
                     Debug.log("Old Shipping Total [" + orderId + " / " + shipGroupSeqId + "] : " + currentShipping, module);
@@ -2484,7 +2484,7 @@
             List orderItems = orh.getValidOrderItems();
             List orderAdjustments = orh.getAdjustments();
             List orderHeaderAdjustments = orh.getOrderHeaderAdjustments();
-            BigDecimal orderSubTotal = orh.getOrderItemsSubTotalBd();
+            BigDecimal orderSubTotal = orh.getOrderItemsSubTotal();
 
             BigDecimal shippingAmount = OrderReadHelper.getAllOrderItemsAdjustmentsTotalBd(orderItems, orderAdjustments, false, false, true);
             shippingAmount = shippingAmount.add(OrderReadHelper.calcOrderAdjustmentsBd(orderHeaderAdjustments, orderSubTotal, false, false, true));