Author: ashish
Date: Sat Nov 21 10:44:53 2009
New Revision: 882880
URL: http://svn.apache.org/viewvc?rev=882880&view=rev
Log:
Reverting changes done at r882456 - reported by Scott.
It was giving compilation problem - I will try to apply updated patch in next
week any time soon.
Modified:
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
Modified:
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=882880&r1=882879&r2=882880&view=diff
==============================================================================
---
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
(original)
+++
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
Sat Nov 21 10:44:53 2009
@@ -826,7 +826,6 @@
return null;
}
return (ShoppingCartItem) cartLines.get(index);
-
}
public ShoppingCartItem findCartItem(String orderItemSeqId) {
@@ -2010,10 +2009,7 @@
}
public void setItemShipGroupQty(int itemIndex, BigDecimal quantity, int
idx) {
- ShoppingCartItem itemIdx = this.findCartItem(itemIndex);
- if(itemIdx != null) {
- this.setItemShipGroupQty(itemIdx, itemIndex, quantity, idx);
- }
+ this.setItemShipGroupQty(this.findCartItem(itemIndex), itemIndex,
quantity, idx);
}
public void setItemShipGroupQty(ShoppingCartItem item, BigDecimal
quantity, int idx) {
@@ -2030,19 +2026,16 @@
}
// never set more than quantity ordered
- if (item != null) {
- if (quantity.compareTo(item.getQuantity()) > 0) {
- quantity = item.getQuantity();
- }
-
-
- // re-set the ship group's before and after dates based on the
item's
- csi.resetShipBeforeDateIfAfter(item.getShipBeforeDate());
- csi.resetShipAfterDateIfBefore(item.getShipAfterDate());
-
- CartShipInfo.CartShipItemInfo csii = csi.setItemInfo(item,
quantity);
- this.checkShipItemInfo(csi, csii);
- }
+ if (quantity.compareTo(item.getQuantity()) > 0) {
+ quantity = item.getQuantity();
+ }
+
+ // re-set the ship group's before and after dates based on the
item's
+ csi.resetShipBeforeDateIfAfter(item.getShipBeforeDate());
+ csi.resetShipAfterDateIfBefore(item.getShipAfterDate());
+
+ CartShipInfo.CartShipItemInfo csii = csi.setItemInfo(item,
quantity);
+ this.checkShipItemInfo(csi, csii);
}
}
Modified:
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=882880&r1=882879&r2=882880&view=diff
==============================================================================
---
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
(original)
+++
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
Sat Nov 21 10:44:53 2009
@@ -20,21 +20,20 @@
import java.math.BigDecimal;
import java.math.MathContext;
-import java.sql.Timestamp;
import java.text.NumberFormat;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import javolution.util.FastMap;
+import java.sql.Timestamp;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javolution.util.FastList;
-import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.UtilDateTime;
@@ -1289,7 +1288,6 @@
LocalDispatcher dispatcher = (LocalDispatcher)
request.getAttribute("dispatcher");
HttpSession session = request.getSession();
GenericValue userLogin =
(GenericValue)session.getAttribute("userLogin");
- Delegator delegator = (Delegator) request.getAttribute("delegator");
String quoteId = request.getParameter("orderId");
@@ -1305,49 +1303,7 @@
}
cart = (ShoppingCart) outMap.get("shoppingCart");
-
- cart.removeAdjustmentByType("SALES_TAX");
- cart.removeAdjustmentByType("PROMOTION_ADJUSTMENT");
- String shipGroupSeqId = null;
- long groupIndex = cart.getShipInfoSize();
- List orderAdjustmentList = new ArrayList();
- List orderAdjustments = new ArrayList();
- orderAdjustments = cart.getAdjustments();
- try {
- orderAdjustmentList = delegator.findList("OrderAdjustment",
EntityCondition.makeCondition("orderId", EntityOperator.EQUALS, orderId), null,
null, null, false);
- } catch (Exception e) {
- Debug.logError(e, module);
- }
- for (long itr = 1; itr <= groupIndex; itr++) {
- shipGroupSeqId = UtilFormatOut.formatPaddedNumber(1, 5);
- List<GenericValue> duplicateAdjustmentList = new
ArrayList<GenericValue>();
- for (GenericValue adjustment:
(List<GenericValue>)orderAdjustmentList) {
- if
("PROMOTION_ADJUSTMENT".equals(adjustment.get("orderAdjustmentTypeId"))) {
- cart.addAdjustment(adjustment);
- }
- if
("SALES_TAX".equals(adjustment.get("orderAdjustmentTypeId"))) {
- if (adjustment.get("description") != null
- &&
((String)adjustment.get("description")).startsWith("Tax adjustment due")) {
- cart.addAdjustment(adjustment);
- }
- if ( adjustment.get("comments") != null
- &&
((String)adjustment.get("comments")).startsWith("Added manually by")) {
- cart.addAdjustment(adjustment);
- }
- }
- }
- for (GenericValue orderAdjustment:
(List<GenericValue>)orderAdjustments) {
- if
("OrderAdjustment".equals(orderAdjustment.getEntityName())) {
- if
(("SHIPPING_CHARGES".equals(orderAdjustment.get("orderAdjustmentTypeId"))) &&
- orderAdjustment.get("orderId").equals(orderId)
&&
-
orderAdjustment.get("shipGroupSeqId").equals(shipGroupSeqId) &&
orderAdjustment.get("comments") == null) {
- // Removing objects from list for old Shipping and
Handling Charges Adjustment and Sales Tax Adjustment.
- duplicateAdjustmentList.add(orderAdjustment);
- }
- }
- }
- orderAdjustments.removeAll(duplicateAdjustmentList);
- }
+
} catch (GenericServiceException exc) {
request.setAttribute("_ERROR_MESSAGE_", exc.getMessage());
return "error";