Author: lektran
Date: Sat Jul 7 16:17:23 2007 New Revision: 554277 URL: http://svn.apache.org/viewvc?view=rev&rev=554277 Log: Removed a couple more BigDecimal.ZERO's and a minor method signature change from trunk rev. 541311 Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=554277&r1=554276&r2=554277 ============================================================================== --- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Jul 7 16:17:23 2007 @@ -3248,7 +3248,7 @@ toStore.addAll(cart.makeOrderItems()); toStore.addAll(cart.makeAllAdjustments()); toStore.addAll(cart.makeAllShipGroupInfos()); - toStore.addAll(cart.makeAllOrderPaymentInfos()); + toStore.addAll(cart.makeAllOrderPaymentInfos(dispatcher)); // set the orderId & other information on all new value objects List dropShipGroupIds = FastList.newInstance(); // this list will contain the ids of all the ship groups for drop shipments (no reservations) 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?view=diff&rev=554277&r1=554276&r2=554277 ============================================================================== --- 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 Jul 7 16:17:23 2007 @@ -908,12 +908,9 @@ Map paymentFields = UtilMisc.toMap("statusId", "PAYMENT_NOT_AUTH"); List onlinePaymentPrefs = EntityUtil.filterByAnd(allPaymentPreferences, paymentFields); - if (onlinePaymentPrefs != null && onlinePaymentPrefs.size() > 0) { - requireAuth = true; - } - + // Check the payment preferences; if we have ANY w/ status PAYMENT_NOT_AUTH invoke payment service. // Invoke payment processing. - if (requireAuth) { + if (onlinePaymentPrefs != null && onlinePaymentPrefs.size() > 0) { boolean autoApproveOrder = UtilValidate.isEmpty(productStore.get("autoApproveOrder")) || "Y".equalsIgnoreCase(productStore.getString("autoApproveOrder")); if (orderTotal == 0 && autoApproveOrder) { // if there is nothing to authorize; don't bother @@ -1391,7 +1388,7 @@ return result; } - public double availableAccountBalance(String billingAccountId) { + public static double availableAccountBalance(String billingAccountId, LocalDispatcher dispatcher) { if (billingAccountId == null) return 0.0; try { Map res = dispatcher.runSync("calcBillingAccountBalance", UtilMisc.toMap("billingAccountId", billingAccountId)); @@ -1403,6 +1400,10 @@ Debug.logError(e, module); } return 0.0; + } + + public double availableAccountBalance(String billingAccountId) { + return availableAccountBalance(billingAccountId, dispatcher); } public Map makeBillingAccountMap(List paymentPrefs) { Modified: ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?view=diff&rev=554277&r1=554276&r2=554277 ============================================================================== --- ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/branches/release4.0/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sat Jul 7 16:17:23 2007 @@ -3346,8 +3346,8 @@ opp.set("statusId", "PAYMENT_NOT_RECEIVED"); allOpPrefs.add(opp); remainingAmount = remainingAmount.subtract(billingAccountAmountSelected); - if (remainingAmount.compareTo(BigDecimal.ZERO) < 0) { - remainingAmount = BigDecimal.ZERO; + if (remainingAmount.compareTo(ZERO) < 0) { + remainingAmount = ZERO; } } Iterator i = paymentInfo.iterator(); @@ -3355,7 +3355,7 @@ CartPaymentInfo inf = (CartPaymentInfo) i.next(); if (inf.amount == null) { inf.amount = new Double(remainingAmount.doubleValue()); - remainingAmount = BigDecimal.ZERO; + remainingAmount = ZERO; } allOpPrefs.addAll(inf.makeOrderPaymentInfos(this.getDelegator())); } |
Free forum by Nabble | Edit this page |