You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/08/09 15:16:26 UTC
svn commit: r1616948 -
/ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Author: jleroux
Date: Sat Aug 9 13:16:25 2014
New Revision: 1616948
URL: http://svn.apache.org/r1616948
Log:
Fixes bad indentation resulting from merging
Modified:
ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Modified: ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1616948&r1=1616947&r2=1616948&view=diff
==============================================================================
--- ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java Sat Aug 9 13:16:25 2014
@@ -3558,30 +3558,30 @@ public class OrderServices {
// go through the item map and obtain the totals per item
Map<String, BigDecimal> itemTotals = new HashMap<String, BigDecimal>();
- for (String key : itemQtyMap.keySet()) {
- String quantityStr = itemQtyMap.get(key);
- BigDecimal groupQty = BigDecimal.ZERO;
- try {
- groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
- } catch (GeneralException e) {
- Debug.logError(e, module);
- return ServiceUtil.returnError(e.getMessage());
- }
-
- if (groupQty.compareTo(BigDecimal.ONE) < 0) {
- return ServiceUtil.returnError(UtilProperties.getMessage(resource,
- "OrderItemQtyMustBePositive", locale));
- }
-
- String[] itemInfo = key.split(":");
- BigDecimal tally = itemTotals.get(itemInfo[0]);
- if (tally == null) {
- tally = groupQty;
- } else {
- tally = tally.add(groupQty);
- }
- itemTotals.put(itemInfo[0], tally);
+ for (String key : itemQtyMap.keySet()) {
+ String quantityStr = itemQtyMap.get(key);
+ BigDecimal groupQty = BigDecimal.ZERO;
+ try {
+ groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+ } catch (GeneralException e) {
+ Debug.logError(e, module);
+ return ServiceUtil.returnError(e.getMessage());
+ }
+
+ if (groupQty.compareTo(BigDecimal.ONE) < 0) {
+ return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ "OrderItemQtyMustBePositive", locale));
+ }
+
+ String[] itemInfo = key.split(":");
+ BigDecimal tally = itemTotals.get(itemInfo[0]);
+ if (tally == null) {
+ tally = groupQty;
+ } else {
+ tally = tally.add(groupQty);
}
+ itemTotals.put(itemInfo[0], tally);
+ }
// set the items amount/price
Iterator<String> iai = itemTotals.keySet().iterator();
@@ -3694,35 +3694,35 @@ public class OrderServices {
}
// update the group amounts
- for (String key : itemQtyMap.keySet()) {
- String quantityStr = itemQtyMap.get(key);
- BigDecimal groupQty = BigDecimal.ZERO;
- try {
- groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
- } catch (GeneralException e) {
- Debug.logError(e, module);
- return ServiceUtil.returnError(e.getMessage());
- }
+ for (String key : itemQtyMap.keySet()) {
+ String quantityStr = itemQtyMap.get(key);
+ BigDecimal groupQty = BigDecimal.ZERO;
+ try {
+ groupQty = (BigDecimal) ObjectType.simpleTypeConvert(quantityStr, "BigDecimal", null, locale);
+ } catch (GeneralException e) {
+ Debug.logError(e, module);
+ return ServiceUtil.returnError(e.getMessage());
+ }
- String[] itemInfo = key.split(":");
- @SuppressWarnings("unused")
- int groupIdx = -1;
- try {
- groupIdx = Integer.parseInt(itemInfo[1]);
- } catch (NumberFormatException e) {
- Debug.logError(e, module);
- return ServiceUtil.returnError(e.getMessage());
- }
+ String[] itemInfo = key.split(":");
+ @SuppressWarnings("unused")
+ int groupIdx = -1;
+ try {
+ groupIdx = Integer.parseInt(itemInfo[1]);
+ } catch (NumberFormatException e) {
+ Debug.logError(e, module);
+ return ServiceUtil.returnError(e.getMessage());
+ }
- // set the group qty
- ShoppingCartItem cartItem = cart.findCartItem(itemInfo[0]);
- if (cartItem != null) {
- Debug.logInfo("Shipping info (before) for group #" + (groupIdx-1) + " [" + cart.getShipmentMethodTypeId(groupIdx-1) + " / " + cart.getCarrierPartyId(groupIdx-1) + "]", module);
- cart.setItemShipGroupQty(cartItem, groupQty, groupIdx - 1);
- Debug.logInfo("Set ship group qty: [" + itemInfo[0] + " / " + itemInfo[1] + " (" + (groupIdx-1) + ")] " + groupQty, module);
- Debug.logInfo("Shipping info (after) for group #" + (groupIdx-1) + " [" + cart.getShipmentMethodTypeId(groupIdx-1) + " / " + cart.getCarrierPartyId(groupIdx-1) + "]", module);
- }
+ // set the group qty
+ ShoppingCartItem cartItem = cart.findCartItem(itemInfo[0]);
+ if (cartItem != null) {
+ Debug.logInfo("Shipping info (before) for group #" + (groupIdx-1) + " [" + cart.getShipmentMethodTypeId(groupIdx-1) + " / " + cart.getCarrierPartyId(groupIdx-1) + "]", module);
+ cart.setItemShipGroupQty(cartItem, groupQty, groupIdx - 1);
+ Debug.logInfo("Set ship group qty: [" + itemInfo[0] + " / " + itemInfo[1] + " (" + (groupIdx-1) + ")] " + groupQty, module);
+ Debug.logInfo("Shipping info (after) for group #" + (groupIdx-1) + " [" + cart.getShipmentMethodTypeId(groupIdx-1) + " / " + cart.getCarrierPartyId(groupIdx-1) + "]", module);
}
+ }
// save all the updated information
try {
@@ -4882,8 +4882,7 @@ public class OrderServices {
// the original method did a "\d+" regexp to decide which is the case, this version is more explicit with its lookup of PaymentMethodType
if (checkOutPaymentId != null) {
List<GenericValue> paymentMethodTypes = delegator.findList("PaymentMethodType", null, null, null, null, true);
- for (Iterator<GenericValue> iter = paymentMethodTypes.iterator(); iter.hasNext();) {
- GenericValue type = iter.next();
+ for (GenericValue type : paymentMethodTypes) {
if (type.get("paymentMethodTypeId").equals(checkOutPaymentId)) {
paymentMethodTypeId = (String) type.get("paymentMethodTypeId");
break;