Author: ashish
Date: Sat Aug 27 12:14:17 2016
New Revision: 1758006

URL: http://svn.apache.org/viewvc?rev=1758006&view=rev
Log:
Applied patch from jira issue - OFBIZ-7854 - Clean up commented out code in 
Java source for Order.
Thanks Harsh for the contribution.

Modified:
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderChangeHelper.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderListState.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CartEventListener.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListEvents.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/task/TaskWorker.java
    
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/thirdparty/taxware/TaxwareUTL.java

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderChangeHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderChangeHelper.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderChangeHelper.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderChangeHelper.java
 Sat Aug 27 12:14:17 2016
@@ -73,16 +73,6 @@ public final class OrderChangeHelper {
         try {
             OrderChangeHelper.orderStatusChanges(dispatcher, userLogin, 
orderId, HEADER_STATUS, "ITEM_CREATED", ITEM_STATUS, DIGITAL_ITEM_STATUS);
             OrderChangeHelper.releaseInitialOrderHold(dispatcher, orderId);
-
-            /*
-            // call the service to check/run digital fulfillment
-            Map checkDigi = dispatcher.runSync("checkDigitalItemFulfillment", 
UtilMisc.toMap("orderId", orderId, "userLogin", userLogin));
-            // this service will return a message with success if there were 
any problems. Get this message and return it to the user
-            String message = (String) 
checkDigi.get(ModelService.SUCCESS_MESSAGE);
-            if (UtilValidate.isNotEmpty(message)) {
-                throw new GeneralRuntimeException(message);
-            }
-            */
         } catch (GenericServiceException e) {
             Debug.logError(e, "Service invocation error, status changes were 
not updated for order #" + orderId, module);
             return false;
@@ -302,81 +292,10 @@ public final class OrderChangeHelper {
 
 
     public static boolean releaseInitialOrderHold(LocalDispatcher dispatcher, 
String orderId) {
-        /* NOTE DEJ20080609 commenting out this code because the old OFBiz 
Workflow Engine is being deprecated and this was only for that
-        // get the delegator from the dispatcher
-        Delegator delegator = dispatcher.getDelegator();
-
-        // find the workEffortId for this order
-        List workEfforts = null;
-        try {
-            workEfforts = 
EntityQuery.use(delegator).from("WorkEffort").where("currentStatusId", 
"WF_SUSPENDED", sourceReferenceId", orderId).queryList();
-        } catch (GenericEntityException e) {
-            Debug.logError(e, "Problems getting WorkEffort with order ref 
number: " + orderId, module);
-            return false;
-        }
-
-        if (workEfforts != null) {
-            // attempt to release the order workflow from 'Hold' status 
(resume workflow)
-            boolean allPass = true;
-            Iterator wei = workEfforts.iterator();
-            while (wei.hasNext()) {
-                GenericValue workEffort = (GenericValue) wei.next();
-                String workEffortId = workEffort.getString("workEffortId");
-                try {
-                    if 
(workEffort.getString("currentStatusId").equals("WF_SUSPENDED")) {
-                        WorkflowClient client = new 
WorkflowClient(dispatcher.getDispatchContext());
-                        client.resume(workEffortId);
-                    } else {
-                        Debug.logVerbose("Current : --{" + workEffort + "}-- 
not resuming", module);
-                    }
-                } catch (WfException e) {
-                    Debug.logError(e, "Problem resuming activity : " + 
workEffortId, module);
-                    allPass = false;
-                }
-            }
-            return allPass;
-        } else {
-            Debug.logWarning("No WF found for order ID : " + orderId, module);
-        }
-        return false;
-        */
         return true;
     }
 
     public static boolean abortOrderProcessing(LocalDispatcher dispatcher, 
String orderId) {
-        /* NOTE DEJ20080609 commenting out this code because the old OFBiz 
Workflow Engine is being deprecated and this was only for that
-        Debug.logInfo("Aborting workflow for order " + orderId, module);
-        Delegator delegator = dispatcher.getDelegator();
-
-        // find the workEffortId for this order
-        GenericValue workEffort = null;
-        try {
-            List workEfforts = 
EntityQuery.use(delegator).from("WorkEffort").where("workEffortTypeId", 
"WORK_FLOW", "sourceReferenceId", orderId).queryList();
-            if (workEfforts != null && workEfforts.size() > 1) {
-                Debug.logWarning("More then one workflow found for defined 
order: " + orderId, module);
-            }
-            workEffort = EntityUtil.getFirst(workEfforts);
-        } catch (GenericEntityException e) {
-            Debug.logError(e, "Problems getting WorkEffort with order ref 
number: " + orderId, module);
-            return false;
-        }
-
-        if (workEffort != null) {
-            String workEffortId = workEffort.getString("workEffortId");
-            if (workEffort.getString("currentStatusId").equals("WF_RUNNING")) {
-                Debug.logInfo("WF is running; trying to abort", module);
-                WorkflowClient client = new 
WorkflowClient(dispatcher.getDispatchContext());
-                try {
-                    client.abortProcess(workEffortId);
-                } catch (WfException e) {
-                    Debug.logError(e, "Problem aborting workflow", module);
-                    return false;
-                }
-                return true;
-            }
-        }
-        return false;
-        */
         return true;
     }
 }

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderListState.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderListState.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderListState.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderListState.java
 Sat Aug 27 12:14:17 2016
@@ -82,7 +82,6 @@ public class OrderListState implements S
         map.put("viewapproved", "ORDER_APPROVED");
         map.put("viewcreated", "ORDER_CREATED");
         map.put("viewprocessing", "ORDER_PROCESSING");
-        //map.put("viewsent", "ORDER_SENT");
         map.put("viewhold", "ORDER_HOLD");
         parameterToOrderStatusId = map;
 
@@ -269,7 +268,6 @@ public class OrderListState implements S
         List<GenericValue> orders = iterator.getPartialList(viewSize * 
viewIndex, viewSize);
         orderListSize = iterator.getResultsSizeAfterPartialList();
         iterator.close();
-        //Debug.logInfo("### size of list: " + orderListSize, module);
         return orders;
     }
 

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReadHelper.java
 Sat Aug 27 12:14:17 2016
@@ -270,7 +270,6 @@ public class OrderReadHelper {
                 refundedToPaymentPref = 
refundedToPaymentPref.add(returnItemResponse.getBigDecimal("responseAmount")).setScale(scale+1,
 rounding);
             }
 
-            // if refundedToPaymentPref > 0
             if (refundedToPaymentPref.compareTo(ZERO) == 1) {
                 String paymentMethodId = 
paymentPref.getString("paymentMethodId") != null ? 
paymentPref.getString("paymentMethodId") : 
paymentPref.getString("paymentMethodTypeId");
                 paymentMethodAmounts.put(paymentMethodId, 
refundedToPaymentPref.setScale(scale, rounding));
@@ -1372,18 +1371,6 @@ public class OrderReadHelper {
     }
 
     public boolean getPastEtaOrderItems(String orderId) {
-        /*List exprs = 
UtilMisc.toList(EntityCondition.makeCondition("statusId", 
EntityOperator.EQUALS, "ITEM_APPROVED"));
-        List itemsApproved = EntityUtil.filterByAnd(getOrderItems(), exprs);
-        Iterator i = itemsApproved.iterator();
-        while (i.hasNext()) {
-            GenericValue item = (GenericValue) i.next();
-            Timestamp estimatedDeliveryDate = (Timestamp) 
item.get("estimatedDeliveryDate");
-            if (estimatedDeliveryDate != null && 
UtilDateTime.nowTimestamp().after(estimatedDeliveryDate)) {
-            return true;
-            }
-        }
-        return false;
-    }*/
         Delegator delegator = orderHeader.getDelegator();
         GenericValue orderDeliverySchedule = null;
         try {
@@ -1419,19 +1406,6 @@ public class OrderReadHelper {
     }
 
     public boolean getPartiallyReceivedItems() {
-        /*List exprs = 
UtilMisc.toList(EntityCondition.makeCondition("statusId", 
EntityOperator.EQUALS, "ITEM_APPROVED"));
-        List itemsApproved = EntityUtil.filterByAnd(getOrderItems(), exprs);
-        Iterator i = itemsApproved.iterator();
-        while (i.hasNext()) {
-            GenericValue item = (GenericValue) i.next();
-            int shippedQuantity = (int) getItemShippedQuantity(item);
-            BigDecimal orderedQuantity = (BigDecimal) item.get("quantity");
-            if (shippedQuantity != orderedQuantity.intValue() && 
shippedQuantity > 0) {
-            return true;
-            }
-        }
-        return false;
-    }*/
         List<GenericValue> items = getOrderItems();
         for (GenericValue item : items) {
             List<GenericValue> receipts = null;
@@ -2401,7 +2375,6 @@ public class OrderReadHelper {
         while (itemIter != null && itemIter.hasNext()) {
             GenericValue orderItem = itemIter.next();
             BigDecimal itemTotal = getOrderItemSubTotal(orderItem, 
adjustments);
-            // Debug.logInfo("Item : " + orderItem.getString("orderId") + " / 
" + orderItem.getString("orderItemSeqId") + " = " + itemTotal, module);
 
             if (workEfforts != null && 
orderItem.getString("orderItemTypeId").compareTo("RENTAL_ORDER_ITEM") == 0) {
                 Iterator<GenericValue> weIter = 
UtilMisc.toIterator(workEfforts);
@@ -2411,7 +2384,6 @@ public class OrderReadHelper {
                         itemTotal = 
itemTotal.multiply(getWorkEffortRentalQuantity(workEffort)).setScale(scale, 
rounding);
                         break;
                     }
-//                    Debug.logInfo("Item : " + orderItem.getString("orderId") 
+ " / " + orderItem.getString("orderItemSeqId") + " = " + itemTotal, module);
                 }
             }
             result = result.add(itemTotal).setScale(scale, rounding);
@@ -2460,7 +2432,6 @@ public class OrderReadHelper {
         // subtotal also includes non tax and shipping adjustments; tax and 
shipping will be calculated using this adjusted value
         result = result.add(getOrderItemAdjustmentsTotal(orderItem, 
adjustments, true, false, false, forTax, forShipping));
 
-        // Debug.logInfo("In getOrderItemSubTotal result=" + result + ", 
rounded result=" + result.setScale(scale, rounding), module);
         return result.setScale(scale, rounding);
     }
 
@@ -2534,7 +2505,6 @@ public class OrderReadHelper {
         }
         rentalAdjustment = rentalAdjustment.add(new BigDecimal(100));  // add 
final 100 percent for first person
         rentalAdjustment = rentalAdjustment.divide(new BigDecimal(100), scale, 
rounding).multiply(new BigDecimal(String.valueOf(length)));
-//        Debug.logInfo("rental parameters....Nbr of persons:" + persons + " 
extra% 2nd person:" + secondPersonPerc + " extra% Nth person:" + nthPersonPerc 
+ " Length: " + length + "  total rental adjustment:" + rentalAdjustment 
,module);
         return rentalAdjustment; // return total rental adjustment
     }
 

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
 Sat Aug 27 12:14:17 2016
@@ -481,11 +481,6 @@ public class OrderReturnServices {
                     EntityCondition.makeCondition("orderId", 
EntityOperator.EQUALS, orderHeader.getString("orderId")),
                     EntityCondition.makeCondition("orderItemStatusId", 
EntityOperator.IN, UtilMisc.toList("ITEM_APPROVED", "ITEM_COMPLETED"))
                ), EntityOperator.AND);
-            /*
-            EntityConditionList havingConditions = 
EntityCondition.makeCondition(UtilMisc.toList(
-                    EntityCondition.makeCondition("quantityIssued", 
EntityOperator.GREATER_THAN, Double.valueOf(0))
-               ), EntityOperator.AND);
-             */
             List<GenericValue> orderItemQuantitiesIssued = null;
             try {
                 orderItemQuantitiesIssued = 
EntityQuery.use(delegator).select("orderId", "orderItemSeqId", 
"quantityIssued").from("OrderItemQuantityReportGroupByItem").where(whereConditions).orderBy("orderItemSeqId").queryList();
@@ -1454,7 +1449,6 @@ public class OrderReturnServices {
                             // Set the response on each item
                             for (GenericValue item : items) {
                                 Map<String, Object> returnItemMap = 
UtilMisc.<String, Object>toMap("returnItemResponseId", responseId, "returnId", 
item.get("returnId"), "returnItemSeqId", item.get("returnItemSeqId"), 
"statusId", returnItemStatusId, "userLogin", userLogin);
-                                //Debug.logInfo("Updating item status", 
module);
                                 try {
                                     serviceResults = 
dispatcher.runSync("updateReturnItem", returnItemMap);
                                     if (ServiceUtil.isError(serviceResults)) {
@@ -1467,7 +1461,6 @@ public class OrderReturnServices {
                                             
"OrderProblemUpdatingReturnItemReturnItemResponseId", locale));
                                 }
 
-                                //Debug.logInfo("Item status and return status 
history created", module);
                             }
 
                             // Create the payment applications for the return 
invoice
@@ -1758,26 +1751,6 @@ public class OrderReturnServices {
                     orderMap.put("orderContactMechs", contactMechs);
                 }
 
-                // make the shipment prefs
-                /*
-                 * OrderShipmentPreference is a deprecated entity
-                List shipmentPrefs = new ArrayList();
-                List orderSp = null;
-                try {
-                    orderSp = 
orderHeader.getRelated("OrderShipmentPreference", null, null, false);
-                } catch (GenericEntityException e) {
-                    Debug.logError(e, module);
-                }
-                if (orderSp != null) {
-                    Iterator orderSpi = orderSp.iterator();
-                    while (orderSpi.hasNext()) {
-                        GenericValue v = (GenericValue) orderSpi.next();
-                        shipmentPrefs.add(GenericValue.create(v));
-                    }
-                    orderMap.put("orderShipmentPreferences", shipmentPrefs);
-                }
-                 */
-
                 // make the order items
                 BigDecimal orderPriceTotal = BigDecimal.ZERO;
                 BigDecimal additionalItemTotal = BigDecimal.ZERO;
@@ -2324,7 +2297,6 @@ public class OrderReturnServices {
         Locale locale = (Locale) context.get("locale");
         Map<String, BigDecimal> returnAmountByOrder = null;
         Map<String, Object> serviceResult = null;
-        //GenericValue orderHeader = null;
         try {
             serviceResult = dispatcher.runSync("getReturnAmountByOrder", 
org.apache.ofbiz.base.util.UtilMisc.toMap("returnId", returnId));
         } catch (GenericServiceException e) {

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
 Sat Aug 27 12:14:17 2016
@@ -722,7 +722,6 @@ public class OrderServices {
                 workOrderItemFulfillment.set("workEffortId", workEffortId);
                 workOrderItemFulfillment.set("orderId", orderId);
                 toBeStored.add(workOrderItemFulfillment);
-//                Debug.logInfo("Workeffort "+ workEffortId + " created for 
asset " + workEffort.get("fixedAssetId") + " and order "+ 
workOrderItemFulfillment.get("orderId") + "/" + 
workOrderItemFulfillment.get("orderItemSeqId") + " created", module);
 //
                 // now create the TechDataExcDay, when they do not exist, 
create otherwise update the capacity values
                 // please note that calendarId is the same for 
(TechData)Calendar, CalendarExcDay and CalendarExWeek
@@ -754,16 +753,11 @@ public class OrderServices {
                         techDataCalendarExcDay.set("exceptionDateStartTime", 
exceptionDateStartTime);
                         techDataCalendarExcDay.set("usedCapacity", 
BigDecimal.ZERO);  // initialise to zero
                         techDataCalendarExcDay.set("exceptionCapacity", 
fixedAsset.getBigDecimal("productionCapacity"));
-//                       Debug.logInfo(" techData excday record not found 
creating for calendarId: " + techDataCalendarExcDay.getString("calendarId") +
-//                               " and date: " + 
exceptionDateStartTime.toString(), module);
                     }
                     // add the quantity to the quantity on the date record
                     BigDecimal newUsedCapacity = 
techDataCalendarExcDay.getBigDecimal("usedCapacity").add(workEffort.getBigDecimal("quantityToProduce"));
                     // check to see if the requested quantity is available on 
the requested day but only when the maximum capacity is set on the fixed asset
                     if (fixedAsset.get("productionCapacity") != null)    {
-//                       Debug.logInfo("see if maximum not reached, available: 
 " + techDataCalendarExcDay.getString("exceptionCapacity") +
-//                               " already allocated: " + 
techDataCalendarExcDay.getString("usedCapacity") +
-//                                " Requested: " + 
workEffort.getString("quantityToProduce"), module);
                        if 
(newUsedCapacity.compareTo(techDataCalendarExcDay.getBigDecimal("exceptionCapacity"))
 > 0)    {
                             String errMsg = "ERROR: fixed_Asset_sold_out 
AssetId: " + workEffort.get("fixedAssetId") + " on date: " + 
techDataCalendarExcDay.getString("exceptionDateStartTime");
                             Debug.logError(errMsg, module);
@@ -773,9 +767,6 @@ public class OrderServices {
                     }
                     techDataCalendarExcDay.set("usedCapacity", 
newUsedCapacity);
                     tempList.add(techDataCalendarExcDay);
-//                  Debug.logInfo("Update success CalendarID: " + 
techDataCalendarExcDay.get("calendarId").toString() +
-//                            " and for date: " + 
techDataCalendarExcDay.get("exceptionDateStartTime").toString() +
-//                            " and for quantity: " + 
techDataCalendarExcDay.getDouble("usedCapacity").toString(), module);
                 }
             }
             if (tempList.size() > 0) {
@@ -927,33 +918,6 @@ public class OrderServices {
             }
         }
 
-        /* DEJ20050529 the OLD way, where a single party had all roles... no 
longer doing things this way...
-        // define the roles for the order
-        List userOrderRoleTypes = null;
-        if ("SALES_ORDER".equals(orderTypeId)) {
-            userOrderRoleTypes = UtilMisc.toList("END_USER_CUSTOMER", 
"SHIP_TO_CUSTOMER", "BILL_TO_CUSTOMER", "PLACING_CUSTOMER");
-        } else if ("PURCHASE_ORDER".equals(orderTypeId)) {
-            userOrderRoleTypes = UtilMisc.toList("SHIP_FROM_VENDOR", 
"BILL_FROM_VENDOR", "SUPPLIER_AGENT");
-        } else {
-            // TODO: some default behavior
-        }
-
-        // now add the roles
-        if (userOrderRoleTypes != null) {
-            Iterator i = userOrderRoleTypes.iterator();
-            while (i.hasNext()) {
-                String roleType = (String) i.next();
-                String thisParty = partyId;
-                if (thisParty == null) {
-                    thisParty = "_NA_";  // will always set these roles so we 
can query
-                }
-                // make sure the party is in the role before adding
-                toBeStored.add(delegator.makeValue("PartyRole", 
UtilMisc.toMap("partyId", partyId, "roleTypeId", roleType)));
-                toBeStored.add(delegator.makeValue("OrderRole", 
UtilMisc.toMap("orderId", orderId, "partyId", partyId, "roleTypeId", 
roleType)));
-            }
-        }
-        */
-
         // see the attributeRoleMap definition near the top of this file for 
attribute-role mappings
         Map<String, String> attributeRoleMap = salesAttributeRoleMap;
         if ("PURCHASE_ORDER".equals(orderTypeId)) {
@@ -1610,11 +1574,6 @@ public class OrderServices {
                     "OrderErrorNoValidOrderHeaderFoundForOrderId", 
UtilMisc.toMap("orderId",orderId), locale));
         }
 
-        // don't charge tax on purchase orders, better we still do.....
-//        if ("PURCHASE_ORDER".equals(orderHeader.getString("orderTypeId"))) {
-//            return ServiceUtil.returnSuccess();
-//        }
-
         // Retrieve the order tax adjustments
         List<GenericValue> orderTaxAdjustments = null;
         try {
@@ -1888,7 +1847,6 @@ public class OrderServices {
                     orderAdjustment.set("orderItemSeqId", 
DataModelConstants.SEQ_ID_NA);
                     orderAdjustment.set("createdDate", 
UtilDateTime.nowTimestamp());
                     orderAdjustment.set("createdByUserLogin", 
userLogin.getString("userLoginId"));
-                    //orderAdjustment.set("comments", "Shipping Re-Calc 
Adjustment");
                     try {
                         orderAdjustment.create();
                     } catch (GenericEntityException e) {
@@ -1955,15 +1913,11 @@ public class OrderServices {
         if (orderItems != null) {
             for (GenericValue item : orderItems) {
                 String statusId = item.getString("statusId");
-                //Debug.logInfo("Item Status: " + statusId, module);
                 if (!"ITEM_CANCELLED".equals(statusId)) {
-                    //Debug.logInfo("Not set to cancel", module);
                     allCanceled = false;
                     if (!"ITEM_COMPLETED".equals(statusId)) {
-                        //Debug.logInfo("Not set to complete", module);
                         allComplete = false;
                         if (!"ITEM_APPROVED".equals(statusId)) {
-                            //Debug.logInfo("Not set to approve", module);
                             allApproved = false;
                             break;
                         }
@@ -2425,7 +2379,6 @@ public class OrderServices {
 
             successResult.put("needsInventoryIssuance", 
orderHeader.get("needsInventoryIssuance"));
             successResult.put("grandTotal", orderHeader.get("grandTotal"));
-            //Debug.logInfo("For setOrderStatus orderHeader is " + 
orderHeader, module);
         } catch (GenericEntityException e) {
             return 
ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
                     "OrderErrorCouldNotChangeOrderStatus",locale) + 
e.getMessage() + ").");
@@ -2467,7 +2420,6 @@ public class OrderServices {
         }
 
         successResult.put("orderStatusId", statusId);
-        //Debug.logInfo("For setOrderStatus successResult is " + 
successResult, module);
         return successResult;
     }
 
@@ -2478,7 +2430,6 @@ public class OrderServices {
         String orderId = (String) context.get("orderId");
         String shipGroupSeqId = (String) context.get("shipGroupSeqId");
         String trackingNumber = (String) context.get("trackingNumber");
-        //Locale locale = (Locale) context.get("locale");
 
         try {
             GenericValue shipGroup = 
EntityQuery.use(delegator).from("OrderItemShipGroup").where("orderId", orderId, 
"shipGroupSeqId", shipGroupSeqId).queryOne();
@@ -2507,7 +2458,6 @@ public class OrderServices {
         String partyId = (String) context.get("partyId");
         String roleTypeId = (String) context.get("roleTypeId");
         Boolean removeOld = (Boolean) context.get("removeOld");
-        //Locale locale = (Locale) context.get("locale");
 
         if (removeOld != null && removeOld.booleanValue()) {
             try {
@@ -2546,8 +2496,6 @@ public class OrderServices {
         String orderId = (String) context.get("orderId");
         String partyId = (String) context.get("partyId");
         String roleTypeId = (String) context.get("roleTypeId");
-        //Locale locale = (Locale) context.get("locale");
-
         GenericValue testValue = null;
 
         try {
@@ -2794,10 +2742,6 @@ public class OrderServices {
         templateData.putAll(orderHeader);
         templateData.putAll(workEffort);
 
-        /* NOTE DEJ20080609 commenting out this code because the old OFBiz 
Workflow Engine is being deprecated and this was only for that
-        String omgStatusId = 
WfUtil.getOMGStatus(workEffort.getString("currentStatusId"));
-        templateData.put("omgStatusId", omgStatusId);
-        */
         templateData.put("omgStatusId", 
workEffort.getString("currentStatusId"));
 
         // get the assignments
@@ -2915,7 +2859,6 @@ public class OrderServices {
         String purpose[] = { "BILLING_LOCATION", "SHIPPING_LOCATION" };
         String outKey[] = { "billingAddress", "shippingAddress" };
         GenericValue orderHeader = null;
-        //Locale locale = (Locale) context.get("locale");
 
         try {
             orderHeader = 
EntityQuery.use(delegator).from("OrderHeader").where("orderId", 
orderId).queryOne();
@@ -3050,8 +2993,6 @@ public class OrderServices {
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
-        //Locale locale = (Locale) context.get("locale");
-
         List<GenericValue> ordersToCheck = null;
 
         // create the query expressions
@@ -3106,8 +3047,6 @@ public class OrderServices {
                     cal.add(Calendar.DAY_OF_YEAR, daysTillCancel);
                     Date cancelDate = cal.getTime();
                     Date nowDate = new Date();
-                    //Debug.logInfo("Cancel Date : " + cancelDate, module);
-                    //Debug.logInfo("Current Date : " + nowDate, module);
                     if (cancelDate.equals(nowDate) || 
nowDate.after(cancelDate)) {
                         // cancel the order item(s)
                         Map<String, Object> svcCtx = UtilMisc.<String, 
Object>toMap("orderId", orderId, "statusId", "ITEM_CANCELLED", "userLogin", 
userLogin);
@@ -4195,7 +4134,6 @@ public class OrderServices {
         try {
             saveUpdatedCartToOrder(dispatcher, delegator, cart, locale, 
userLogin, orderId, changeMap, calcTax, deleteItems);
             result = ServiceUtil.returnSuccess();
-            //result.put("shoppingCart", cart);
         } catch (GeneralException e) {
             Debug.logError(e, module);
             result = ServiceUtil.returnError(e.getMessage());
@@ -4587,9 +4525,7 @@ public class OrderServices {
             Map<String, Object> paymentResp = null;
             try {
                 Debug.logInfo("Calling process payments...", module);
-                //Debug.set(Debug.VERBOSE, true);
                 paymentResp = CheckOutHelper.processPayment(orderId, 
orh.getOrderGrandTotal(), orh.getCurrency(), productStore, userLogin, false, 
false, dispatcher, delegator);
-                //Debug.set(Debug.VERBOSE, false);
             } catch (GeneralException e) {
                 Debug.logError(e, module);
                 return ServiceUtil.returnError(e.getMessage());
@@ -4694,7 +4630,6 @@ public class OrderServices {
             // create the payment
             Map<String, Object> paymentParams = new HashMap<String, Object>();
             BigDecimal maxAmount = 
orderPaymentPreference.getBigDecimal("maxAmount");
-            //if (maxAmount > 0.0) {
                 paymentParams.put("paymentTypeId", "CUSTOMER_PAYMENT");
                 paymentParams.put("paymentMethodTypeId", 
orderPaymentPreference.getString("paymentMethodTypeId"));
                 paymentParams.put("paymentPreferenceId", 
orderPaymentPreference.getString("orderPaymentPreferenceId"));
@@ -4704,18 +4639,6 @@ public class OrderServices {
                 paymentParams.put("partyIdFrom", paymentFromId);
                 paymentParams.put("currencyUomId", 
productStore.getString("defaultCurrencyUomId"));
                 paymentParams.put("partyIdTo", payToPartyId);
-            /*}
-            else {
-                paymentParams.put("paymentTypeId", "CUSTOMER_REFUND"); // JLR 
17/7/4 from a suggestion of Si cf. 
https://issues.apache.org/jira/browse/OFBIZ-828#action_12483045
-                paymentParams.put("paymentMethodTypeId", 
orderPaymentPreference.getString("paymentMethodTypeId")); // JLR 20/7/4 Finally 
reverted for now, I prefer to see an amount in payment, even negative
-                paymentParams.put("paymentPreferenceId", 
orderPaymentPreference.getString("orderPaymentPreferenceId"));
-                paymentParams.put("amount", 
Double.valueOf(Math.abs(maxAmount)));
-                paymentParams.put("statusId", "PMNT_RECEIVED");
-                paymentParams.put("effectiveDate", 
UtilDateTime.nowTimestamp());
-                paymentParams.put("partyIdFrom", payToPartyId);
-                paymentParams.put("currencyUomId", 
productStore.getString("defaultCurrencyUomId"));
-                paymentParams.put("partyIdTo", 
billToParty.getString("partyId"));
-            }*/
             if (paymentRefNum != null) {
                 paymentParams.put("paymentRefNum", paymentRefNum);
             }
@@ -4940,7 +4863,6 @@ public class OrderServices {
             Map<String, Object> ctx = new HashMap<String, Object>();
             ctx.put("userLogin", userLogin);
             ctx.put("screenLocation", screenLocation);
-            //ctx.put("contentType", "application/postscript");
             if (UtilValidate.isNotEmpty(printerName)) {
                 ctx.put("printerName", printerName);
             }
@@ -4969,7 +4891,6 @@ public class OrderServices {
             Map<String, Object> ctx = new HashMap<String, Object>();
             ctx.put("userLogin", userLogin);
             ctx.put("screenLocation", screenLocation);
-            //ctx.put("contentType", "application/postscript");
             ctx.put("fileName", "order_" + orderId + "_");
             ctx.put("screenContext", UtilMisc.toMap("orderId", orderId));
 

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/quote/QuoteServices.java
 Sat Aug 27 12:14:17 2016
@@ -161,11 +161,7 @@ public class QuoteServices {
         Locale locale = (Locale) context.get("locale");
         
         //TODO create Quote Terms still to be implemented
-        //List<GenericValue> quoteTerms = 
UtilGenerics.cast(context.get("quoteTerms"));
-        
         //TODO create Quote Term Attributes still to be implemented
-        //List<GenericValue> quoteTermAttributes = 
UtilGenerics.cast(context.get("quoteTermAttributes"));
-        
         Map<String, Object> result = new HashMap<String, Object>();
 
         try {

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/requirement/RequirementServices.java
 Sat Aug 27 12:14:17 2016
@@ -54,7 +54,6 @@ public class RequirementServices {
         String unassignedRequirements = (String) 
context.get("unassignedRequirements");
         List<String> statusIds = 
UtilGenerics.checkList(context.get("statusIds"));
         //TODO currencyUomId still not used
-        //String currencyUomId = (String) context.get("currencyUomId");
         try {
             List<EntityCondition> conditions = UtilMisc.toList(
                     EntityCondition.makeCondition("requirementTypeId", 
EntityOperator.EQUALS, "PRODUCT_REQUIREMENT"),

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CartEventListener.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CartEventListener.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CartEventListener.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CartEventListener.java
 Sat Aug 27 12:14:17 2016
@@ -42,7 +42,6 @@ public class CartEventListener implement
 
     public void sessionCreated(HttpSessionEvent event) {
         //for this one do nothing when the session is created...
-        //HttpSession session = event.getSession();
     }
 
     public void sessionDestroyed(HttpSessionEvent event) {

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
 Sat Aug 27 12:14:17 2016
@@ -81,7 +81,6 @@ public class CheckOutEvents {
 
         HttpSession session = request.getSession();
 
-        //Locale locale = UtilHttp.getLocale(request);
         String curPage = request.getParameter("checkoutpage");
         Debug.logInfo("CheckoutPage: " + curPage, module);
 
@@ -261,7 +260,6 @@ public class CheckOutEvents {
 
     public static String setPartialCheckOutOptions(HttpServletRequest request, 
HttpServletResponse response) {
         // FIXME response need to be checked ?
-        // String resp = setCheckOutOptions(request, response);
         setCheckOutOptions(request, response);
         request.setAttribute("_ERROR_MESSAGE_", null);
         return "success";
@@ -290,7 +288,6 @@ public class CheckOutEvents {
 
     public static Map<String, Map<String, Object>> 
getSelectedPaymentMethods(HttpServletRequest request) {
         ShoppingCart cart = (ShoppingCart) 
request.getSession().getAttribute("shoppingCart");
-        //Locale locale = UtilHttp.getLocale(request);
         Map<String, Map<String, Object>> selectedPaymentMethods = new 
HashMap<String, Map<String, Object>>();
         String[] paymentMethods = 
request.getParameterValues("checkOutPaymentId");
 
@@ -696,9 +693,6 @@ public class CheckOutEvents {
         String isGift = null;
         String internalCode = null;
         String methodType = null;
-        //FIXME can be removed ?
-        // String singleUsePayment = null;
-        // String appendPayment = null;
         String shipBeforeDate = null;
         String shipAfterDate = null;
         String internalOrderNotes = null;
@@ -876,11 +870,6 @@ public class CheckOutEvents {
             Debug.logInfo("Changing mode from->to: " + mode + "->payment", 
module);
             mode = "payment";
         }
-        //FIXME can be removed ?
-        // singleUsePayment = request.getParameter("singleUsePayment");
-        // appendPayment = request.getParameter("appendPayment");
-        // boolean isSingleUsePayment = singleUsePayment != null && 
"Y".equalsIgnoreCase(singleUsePayment) ? true : false;
-        // boolean doAppendPayment = appendPayment != null && 
"Y".equalsIgnoreCase(appendPayment) ? true : false;
 
         if (mode.equals("payment")) {
             Map<String, Object> callResult = ServiceUtil.returnSuccess();

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutHelper.java
 Sat Aug 27 12:14:17 2016
@@ -806,16 +806,10 @@ public class CheckOutHelper {
         List<BigDecimal> quantity = new ArrayList<BigDecimal>(totalItems);
         List<BigDecimal> shipAmt = new ArrayList<BigDecimal>(totalItems);
 
-        // Debug.logInfo("====== makeTaxContext passed in shipAddress=" + 
shipAddress, module);
-
         Iterator<ShoppingCartItem> it = csi.shipItemInfo.keySet().iterator();
         for (int i = 0; i < totalItems; i++) {
             ShoppingCartItem cartItem = it.next();
             ShoppingCart.CartShipInfo.CartShipItemInfo itemInfo = 
csi.getShipItemInfo(cartItem);
-
-            //Debug.logInfo("In makeTaxContext for item [" + i + "] in ship 
group [" + shipGroup + "] got cartItem: " + cartItem, module);
-            //Debug.logInfo("In makeTaxContext for item [" + i + "] in ship 
group [" + shipGroup + "] got itemInfo: " + itemInfo, module);
-
             product.add(i, cartItem.getProduct());
             amount.add(i, cartItem.getItemSubTotal(itemInfo.quantity));
             price.add(i, cartItem.getBasePrice());
@@ -831,7 +825,6 @@ public class CheckOutHelper {
         BigDecimal shipAmount = csi.shipEstimate;
         if (shipAddress == null) {
             shipAddress = cart.getShippingAddress(shipGroup);
-            // Debug.logInfo("====== makeTaxContext set shipAddress to 
cart.getShippingAddress(shipGroup): " + shipAddress, module);
         }
 
         if (shipAddress == null && skipEmptyAddresses) {

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
 Sat Aug 27 12:14:17 2016
@@ -478,7 +478,6 @@ public class ShoppingCart implements Ite
             if ((productSuppliers != null) && (productSuppliers.size() > 0)) {
                 supplierProduct = productSuppliers.get(0);
             }
-            //} catch (GenericServiceException e) {
         } catch (Exception e) {
             
Debug.logWarning(UtilProperties.getMessage(resource_error,"OrderRunServiceGetSuppliersForProductError",
 locale) + e.getMessage(), module);
         }
@@ -570,7 +569,6 @@ public class ShoppingCart implements Ite
         // Add the new item to the shopping cart if it wasn't found.
         ShoppingCartItem item = null;
         if (getOrderType().equals("PURCHASE_ORDER")) {
-            //GenericValue productSupplier = null;
             supplierProduct = getSupplierProduct(productId, quantity, 
dispatcher);
             if (supplierProduct != null || "_NA_".equals(this.getPartyId())) {
                  item = 
ShoppingCartItem.makePurchaseOrderItem(Integer.valueOf(0), productId, 
selectedAmount, quantity, features, attributes, prodCatalogId, configWrapper, 
itemType, itemGroup, dispatcher, this, supplierProduct, shipBeforeDate, 
shipAfterDate, cancelBackOrderDate);
@@ -729,22 +727,18 @@ public class ShoppingCart implements Ite
         try {
             // Check for existing cart item
             for (ShoppingCartItem cartItem : cartLines) {
-                //Debug.logInfo("Checking cartItem with product [" + 
cartItem.getProductId() + "] becuase that is in group [" + 
(cartItem.getItemGroup()==null ? "no group" : 
cartItem.getItemGroup().getGroupNumber()) + "]", module);
 
                 if (UtilValidate.isNotEmpty(groupNumber) && 
!cartItem.isInItemGroup(groupNumber)) {
-                    //Debug.logInfo("Not using cartItem with product [" + 
cartItem.getProductId() + "] becuase not in group [" + groupNumber + "]", 
module);
                     continue;
                 }
                 if (CategoryWorker.isProductInCategory(delegator, 
cartItem.getProductId(), productCategoryId)) {
                     itemsToReturn.add(cartItem);
                 } else {
-                    //Debug.logInfo("Not using cartItem with product [" + 
cartItem.getProductId() + "] becuase not in category [" + productCategoryId + 
"]", module);
                 }
             }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Error getting cart items that are in a 
category: " + e.toString(), module);
         }
-        //Debug.logInfo("Got [" + itemsToReturn.size() + "] cart items in 
category [" + productCategoryId + "] and item group [" + groupNumber + "]", 
module);
         return itemsToReturn;
     }
 
@@ -1273,10 +1267,6 @@ public class ShoppingCart implements Ite
         if (UtilValidate.isEmpty(this.orderPartyId)) this.orderPartyId = 
endUserCustomerPartyId;
     }
 
-//    protected String billFromVendorPartyId = null;
-  //  protected String shipFromVendorPartyId = null;
-    //protected String supplierAgentPartyId = null;
-
     public String getBillFromVendorPartyId() {
         return this.billFromVendorPartyId != null ? this.billFromVendorPartyId 
: this.getPartyId();
     }
@@ -1378,7 +1368,6 @@ public class ShoppingCart implements Ite
         this.defaultItemComment = null;
         this.orderAdditionalEmails = null;
 
-        //this.viewCartOnAdd = false;
         this.readOnlyCart = false;
 
         this.lastListRestore = null;
@@ -2647,7 +2636,6 @@ public class ShoppingCart implements Ite
             this.setAllGiftMessage("");
             this.setAllMaySplit(Boolean.TRUE);
             this.setAllIsGift(Boolean.FALSE);
-            //this.setInternalCode(internalCode);
         }
     }
 
@@ -2699,7 +2687,6 @@ public class ShoppingCart implements Ite
     /** Returns the total from the cart, including tax/shipping. */
     public BigDecimal getGrandTotal() {
         // sales tax and shipping are not stored as adjustments but rather as 
part of the ship group
-        // Debug.logInfo("Subtotal:" + this.getSubTotal() + " Shipping:" + 
this.getTotalShipping() + "SalesTax: "+ this.getTotalSalesTax() + " others: " + 
this.getOrderOtherAdjustmentTotal() + " global: " + 
this.getOrderGlobalAdjustments(), module);
         return 
this.getSubTotal().add(this.getTotalShipping()).add(this.getTotalSalesTax()).add(this.getOrderOtherAdjustmentTotal()).add(this.getOrderGlobalAdjustments());
     }
 
@@ -3563,7 +3550,6 @@ public class ShoppingCart implements Ite
         synchronized (cartLines) {
             List<ShoppingCartItem> cartLineItems = new 
LinkedList<ShoppingCartItem>(cartLines);
             for (ShoppingCartItem item : cartLineItems) {
-                //Debug.logInfo("Item qty: " + item.getQuantity(), module);
                 try {
                     int thisIndex = items().indexOf(item);
                     List<ShoppingCartItem> explodedItems = 
item.explodeItem(this, dispatcher);
@@ -3594,7 +3580,6 @@ public class ShoppingCart implements Ite
         if (dispatcher == null) return;
         synchronized (cartLines) {
             for (ShoppingCartItem item : shoppingCartItems) {
-                //Debug.logInfo("Item qty: " + item.getQuantity(), module);
                 try {
                     int thisIndex = items().indexOf(item);
                     List<ShoppingCartItem> explodedItems = 
item.explodeItem(this, dispatcher);
@@ -3736,29 +3721,7 @@ public class ShoppingCart implements Ite
                 Iterator<GenericValue> fsppas = 
this.freeShippingProductPromoActions.iterator();
 
                 while (fsppas.hasNext()) {
-                    //FIXME can be removed ?
-                    // GenericValue productPromoAction = fsppas.next();
-
                     // TODO - we need to change the way free shipping 
promotions work
-                    /*
-                    if ((productPromoAction.get("productId") == null || 
productPromoAction.getString("productId").equals(this.getShipmentMethodTypeId()))
 &&
-                        (productPromoAction.get("partyId") == null || 
productPromoAction.getString("partyId").equals(this.getCarrierPartyId()))) {
-                        Double shippingAmount = 
Double.valueOf(OrderReadHelper.calcOrderAdjustment(orderAdjustment, new 
BigDecimal(getSubTotal())).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,
-                                    "productPromoId", 
productPromoAction.get("productPromoId"), "productPromoRuleId", 
productPromoAction.get("productPromoRuleId"),
-                                    "productPromoActionSeqId", 
productPromoAction.get("productPromoActionSeqId")));
-
-                        allAdjs.add(fsOrderAdjustment);
-
-                        // if free shipping IS applied to this 
orderAdjustment, break
-                        // out of the loop so that even if there are multiple 
free
-                        // shipping adjustments that apply to this 
orderAdjustment it
-                        // will only be compensated for once
-                        break;
-                    }
-                    */
                 }
             }
         }
@@ -3777,29 +3740,7 @@ public class ShoppingCart implements Ite
                         Iterator<GenericValue> fsppas = 
this.freeShippingProductPromoActions.iterator();
 
                         while (fsppas.hasNext()) {
-                            //FIXME can be removed ?
-                            // GenericValue productPromoAction = fsppas.next();
-
                             // TODO - fix the free shipping promotions!!
-                            /*
-                            if ((productPromoAction.get("productId") == null 
|| 
productPromoAction.getString("productId").equals(item.getShipmentMethodTypeId()))
 &&
-                                (productPromoAction.get("partyId") == null || 
productPromoAction.getString("partyId").equals(item.getCarrierPartyId()))) {
-                                Double shippingAmount = 
Double.valueOf(OrderReadHelper.calcItemAdjustment(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,
-                                            "productPromoId", 
productPromoAction.get("productPromoId"), "productPromoRuleId", 
productPromoAction.get("productPromoRuleId"),
-                                            "productPromoActionSeqId", 
productPromoAction.get("productPromoActionSeqId")));
-
-                                allAdjs.add(fsOrderAdjustment);
-
-                                // if free shipping IS applied to this 
orderAdjustment, break
-                                // out of the loop so that even if there are 
multiple free
-                                // shipping adjustments that apply to this 
orderAdjustment it
-                                // will only be compensated for once
-                                break;
-                            }
-                            */
                         }
                     }
                 }
@@ -4881,9 +4822,6 @@ public class ShoppingCart implements Ite
             if (valueObj != null) {
                 // first create a BILLING_LOCATION for the payment method 
address if there is one
                 if ("PaymentMethod".equals(valueObj.getEntityName())) {
-                    //String paymentMethodTypeId = 
valueObj.getString("paymentMethodTypeId");
-                    //String paymentMethodId = 
valueObj.getString("paymentMethodId");
-                    //Map lookupFields = UtilMisc.toMap("paymentMethodId", 
paymentMethodId);
                     String billingAddressId = null;
 
                     GenericValue billingAddress = 
this.getBillingAddress(delegator);

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartEvents.java
 Sat Aug 27 12:14:17 2016
@@ -676,8 +676,6 @@ public class ShoppingCartEvents {
         String orderId = request.getParameter("orderId");
         String itemGroupNumber = request.getParameter("itemGroupNumber");
         String[] itemIds = request.getParameterValues("item_id");
-        // not used yet: Locale locale = UtilHttp.getLocale(request);
-
         ShoppingCart cart = getCartObject(request);
         Delegator delegator = (Delegator) request.getAttribute("delegator");
         LocalDispatcher dispatcher = (LocalDispatcher) 
request.getAttribute("dispatcher");
@@ -710,8 +708,6 @@ public class ShoppingCartEvents {
         ShoppingCartHelper cartHelper = new ShoppingCartHelper(delegator, 
dispatcher, cart);
         String controlDirective;
         Map<String, Object> result;
-        // not used yet: Locale locale = UtilHttp.getLocale(request);
-
         //Convert the params to a map to pass in
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
         String catalogId = CatalogWorker.getCurrentCatalogId(request);
@@ -807,8 +803,6 @@ public class ShoppingCartEvents {
         ShoppingCartHelper cartHelper = new ShoppingCartHelper(delegator, 
dispatcher, cart);
         String controlDirective;
         Map<String, Object> result;
-        // not used yet: Locale locale = UtilHttp.getLocale(request);
-
         //Convert the params to a map to pass in
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
         String catalogId = CatalogWorker.getCurrentCatalogId(request);
@@ -866,8 +860,6 @@ public class ShoppingCartEvents {
         String controlDirective;
         Map<String, Object> result;
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
-        // not used yet: Locale locale = UtilHttp.getLocale(request);
-
         //Delegate the cart helper
         result = cartHelper.deleteFromCart(paramMap);
         controlDirective = processResult(result, request);
@@ -891,8 +883,6 @@ public class ShoppingCartEvents {
         ShoppingCartHelper cartHelper = new ShoppingCartHelper(null, 
dispatcher, cart);
         String controlDirective;
         Map<String, Object> result;
-        // not used yet: Locale locale = UtilHttp.getLocale(request);
-
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
 
         String removeSelectedFlag = request.getParameter("removeSelected");
@@ -1003,7 +993,6 @@ public class ShoppingCartEvents {
             cartList.add(currentCart);
             session.setAttribute("shoppingCartList", cartList);
             session.removeAttribute("shoppingCart");
-            //destroyCart(request, response);
         }
         ShoppingCart newCart = null;
         if (cartIndex >= 0 && cartIndex < cartList.size()) {
@@ -2007,8 +1996,6 @@ public class ShoppingCartEvents {
         String shipGroupSeqId = null;
 
         Map<String, Object> paramMap = UtilHttp.getParameterMap(request);
-        //FIXME can be removed ?
-        // String itemGroupNumber = request.getParameter("itemGroupNumber");
         int rowCount = UtilHttp.getMultiFormRowCount(paramMap);
         if (rowCount < 1) {
             Debug.logWarning("No rows to process, as rowCount = " + rowCount, 
module);

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartHelper.java
 Sat Aug 27 12:14:17 2016
@@ -201,9 +201,6 @@ public class ShoppingCartHelper {
             }
             Debug.logInfo("carthelper productid " + productId,module);
             Debug.logInfo("parent productid " + pProductId,module);
-            //if (product != null && 
!"Y".equals(product.getString("isVariant")))
-            //    pProductId = null;
-
         }
 
         // Get the additional features selected for the product (if any)
@@ -324,7 +321,6 @@ public class ShoppingCartHelper {
                 // do not store rental items
                 if (orderItemTypeId.equals("RENTAL_ORDER_ITEM"))
                     continue;
-                // never read: int itemId = -1;
                 if (UtilValidate.isNotEmpty(productId) && 
orderItem.get("quantity") != null) {
                     BigDecimal amount = 
orderItem.getBigDecimal("selectedAmount");
                     ProductConfigWrapper configWrapper = null;
@@ -398,8 +394,6 @@ public class ShoppingCartHelper {
             String originalProductId = null;
             if (entry.getKey() instanceof String) {
                 String key = entry.getKey();
-                //Debug.logInfo("Bulk Key: " + key, module);
-
                 int ignIndex = key.indexOf(ignSeparator);
                 if (ignIndex > 0) {
                     itemGroupNumberToUse = key.substring(ignIndex + 
ignSeparator.length());
@@ -490,10 +484,6 @@ public class ShoppingCartHelper {
         boolean useRowSubmit = (!context.containsKey("_useRowSubmit"))? false :
                 "Y".equalsIgnoreCase((String)context.get("_useRowSubmit"));
 
-        // check if we are to also look in a global scope (no delimiter)
-        //boolean checkGlobalScope = 
(!context.containsKey("_checkGlobalScope"))? false :
-        //        
"Y".equalsIgnoreCase((String)context.get("_checkGlobalScope"));
-
         // The number of multi form rows is retrieved
         int rowCount = UtilHttp.getMultiFormRowCount(context);
 

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartItem.java
 Sat Aug 27 12:14:17 2016
@@ -206,8 +206,6 @@ public class ShoppingCartItem implements
             throw new CartItemModifyException(excMsg);
         }
 
-        // Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
-
         // check to see if the product is fully configured
         if ("AGGREGATED".equals(product.getString("productTypeId")) || 
"AGGREGATED_SERVICE".equals(product.getString("productTypeId"))) {
             if (configWrapper == null || !configWrapper.isCompleted()) {
@@ -550,23 +548,6 @@ public class ShoppingCartItem implements
                 Debug.logWarning(excMsg, module);
                 throw new CartItemModifyException(excMsg);
             }
-            /*
-            if (product.get("salesDiscWhenNotAvail") != null && 
"Y".equals(product.getString("salesDiscWhenNotAvail"))) {
-                // check atp and if <= 0 then the product is no more available 
because
-                // all the units in warehouse are reserved by other sales 
orders and no new purchase orders will be done
-                // for this product.
-                if (!newItem.isInventoryAvailableOrNotRequired(quantity, 
cart.getProductStoreId(), dispatcher)) {
-                    Map messageMap = UtilMisc.toMap("productName", 
product.getString("productName"),
-                                                    "productId", 
product.getString("productId"));
-
-                    String excMsg = UtilProperties.getMessage(resource_error, 
"item.cannot_add_product_no_longer_available",
-                                                  messageMap , locale);
-
-                    Debug.logWarning(excMsg, module);
-                    throw new CartItemModifyException(excMsg);
-                }
-            }
-             */
 
             // check to see if the product is fully configured
             if ("AGGREGATED".equals(product.getString("productTypeId"))|| 
"AGGREGATED_SERVICE".equals(product.getString("productTypeId"))) {
@@ -914,7 +895,6 @@ public class ShoppingCartItem implements
             String msg = UtilProperties.getMessage(resource_error, 
"item.fixed_Asset_not_found", messageMap , cart.getLocale());
             return msg;
         }
-        //Debug.logInfo("Checking availability for product: " + 
productId.toString() + " and related FixedAsset: " + 
fixedAssetProduct.getString("fixedAssetId"),module);
 
         // see if this fixed asset has a calendar, when no create one and 
attach to fixed asset
         // DEJ20050725 this isn't being used anywhere, commenting out for now 
and not assigning from the getRelatedOne: GenericValue techDataCalendar = null;
@@ -950,7 +930,6 @@ public class ShoppingCartItem implements
                 Debug.logWarning(e, module);
             }
             if (techDataCalendarExcDay == null) {
-                //Debug.logInfo(" No exception day record found, available: " 
+ fixedAsset.getString("productionCapacity") + " Requested now: " + quantity, 
module);
                 if (fixedAsset.get("productionCapacity") != null && 
fixedAsset.getBigDecimal("productionCapacity").compareTo(quantity) < 0)
                     resultMessage = 
resultMessage.concat(exceptionDateStartTime.toString().substring(0, 10) + ", ");
             } else {
@@ -1063,64 +1042,6 @@ public class ShoppingCartItem implements
                 shipGroupIndex = cart.getItemShipGroupIndex(itemId);
             }
             cart.clearItemShipInfo(this);
-
-            /*
-
-            // Deprecated in favour of ShoppingCart.createDropShipGroups(), 
called during checkout
-
-            int shipGroupIndex = -1;
-            if ("PURCHASE_ORDER".equals(cart.getOrderType())) {
-                shipGroupIndex = 0;
-            } else {
-                if (_product != null && 
"PRODRQM_DS".equals(_product.getString("requirementMethodEnumId"))) {
-                    // this is a drop-ship only product: we need a ship group 
with supplierPartyId set
-                    Map supplierProductsResult = null;
-                    try {
-                        supplierProductsResult = 
dispatcher.runSync("getSuppliersForProduct", UtilMisc.toMap("productId", 
_product.getString("productId"),
-                                                                               
                                  "quantity", Double.valueOf(quantity),
-                                                                               
                                  "currencyUomId", cart.getCurrency(),
-                                                                               
                                  "canDropShip", "Y",
-                                                                               
                                  "userLogin", cart.getUserLogin()));
-                        List productSuppliers = 
(List)supplierProductsResult.get("supplierProducts");
-                        GenericValue supplierProduct = 
EntityUtil.getFirst(productSuppliers);
-                        if (supplierProduct != null) {
-                            String supplierPartyId = 
supplierProduct.getString("partyId");
-                            List shipGroups = cart.getShipGroups();
-                            for (int i = 0; i < shipGroups.size(); i++) {
-                                ShoppingCart.CartShipInfo csi = 
(ShoppingCart.CartShipInfo)shipGroups.get(i);
-                                if 
(supplierPartyId.equals(csi.getSupplierPartyId())) {
-                                    shipGroupIndex = i;
-                                    break;
-                                }
-                            }
-                            if (shipGroupIndex == -1) {
-                                // create a new ship group
-                                shipGroupIndex = cart.addShipInfo();
-                                cart.setSupplierPartyId(shipGroupIndex, 
supplierPartyId);
-                            }
-                        }
-                    } catch (Exception e) {
-                        Debug.logWarning("Error calling getSuppliersForProduct 
service, result is: " + supplierProductsResult, module);
-                    }
-                }
-
-                if (shipGroupIndex == -1) {
-                    List shipGroups = cart.getShipGroups();
-                    for (int i = 0; i < shipGroups.size(); i++) {
-                        ShoppingCart.CartShipInfo csi = 
(ShoppingCart.CartShipInfo)shipGroups.get(i);
-                        if (csi.getSupplierPartyId() == null) {
-                            shipGroupIndex = i;
-                            break;
-                        }
-                    }
-                    if (shipGroupIndex == -1) {
-                        // create a new ship group
-                        shipGroupIndex = cart.addShipInfo();
-                    }
-                }
-            }
-            cart.setItemShipGroupQty(this, quantity, shipGroupIndex);
-            */
             cart.setItemShipGroupQty(this, quantity, shipGroupIndex);
         }
     }
@@ -1378,8 +1299,6 @@ public class ShoppingCartItem implements
                 }
 
                 this.promoQuantityUsed = 
this.promoQuantityUsed.add(promoQuantityToUse);
-                //Debug.logInfo("promoQuantityToUse=" + promoQuantityToUse + 
", quantityDesired=" + quantityDesired + ", for promoCondAction: " + 
productPromoCondAction, module);
-                //Debug.logInfo("promoQuantityUsed now=" + promoQuantityUsed, 
module);
             }
 
             return promoQuantityToUse;
@@ -2072,13 +1991,11 @@ public class ShoppingCartItem implements
             }
         }
         rentalValue = rentalValue.add(new BigDecimal("100"));    // add final 
100 percent for first person
-        //     Debug.logInfo("rental parameters....Nbr of persons:" + 
getReservPersons() + " extra% 2nd person:" + getReserv2ndPPPerc()+ " extra% Nth 
person:" + getReservNthPPPerc() + "  total rental adjustment:" + 
rentalValue/100 * getReservLength());
         return rentalValue.movePointLeft(2).multiply(getReservLength()); // 
return total rental adjustment
     }
 
     /** Returns the total line price. */
     public BigDecimal getItemSubTotal(BigDecimal quantity) {
-//        Debug.logInfo("Price" + getBasePrice() + " quantity" +  quantity + " 
Rental adj:" + getRentalAdjustment() + " other adj:" + getOtherAdjustments(), 
module);
           return 
getBasePrice().multiply(quantity).multiply(getRentalAdjustment()).add(getOtherAdjustments());
     }
 
@@ -2144,7 +2061,6 @@ public class ShoppingCartItem implements
         if (recurringAmount != null) {
             recurringAmount = recurringAmount.multiply(this.getQuantity());
             orderAdjustment.set("recurringAmount", recurringAmount);
-            //Debug.logInfo("Setting recurringAmount " + recurringAmount + " 
for " + orderAdjustment, module);
         }
 
         if (amount == null && recurringAmount == null) {
@@ -2168,8 +2084,6 @@ public class ShoppingCartItem implements
             
removeFeatureAdjustment(oldAdditionalProductFeatureAndAppl.getString("productFeatureId"));
         }
 
-        //if (this.additionalProductFeatureAndAppls.size() == 0) 
this.additionalProductFeatureAndAppls = null;
-
         return oldAdditionalProductFeatureAndAppl;
     }
 

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java
 Sat Aug 27 12:14:17 2016
@@ -310,22 +310,7 @@ public class ShoppingCartServices {
         for (GenericValue orderItemShipGroup: orderItemShipGroupList) {
             // should be sorted by shipGroupSeqId
             int newShipInfoIndex = cart.addShipInfo();
-
-            // shouldn't be gaps in it but allow for that just in case
-            /*
-            String cartShipGroupIndexStr = 
orderItemShipGroup.getString("shipGroupSeqId");
-            int cartShipGroupIndex = NumberUtils.toInt(cartShipGroupIndexStr);
-
-            if (newShipInfoIndex != (cartShipGroupIndex - 1)) {
-                int groupDiff = cartShipGroupIndex - cart.getShipGroupSize();
-                for (int i = 0; i < groupDiff; i++) {
-                    newShipInfoIndex = cart.addShipInfo();
-                }
-            }
-            */
-
             CartShipInfo cartShipInfo = cart.getShipInfo(newShipInfoIndex);
-
             cartShipInfo.shipAfterDate = 
orderItemShipGroup.getTimestamp("shipAfterDate");
             cartShipInfo.shipBeforeDate = 
orderItemShipGroup.getTimestamp("shipByDate");
             cartShipInfo.shipmentMethodTypeId = 
orderItemShipGroup.getString("shipmentMethodTypeId");
@@ -844,9 +829,6 @@ public class ShoppingCartServices {
                 Timestamp reservStart = quoteItem.getTimestamp("reservStart");
                 BigDecimal reservLength = 
quoteItem.getBigDecimal("reservLength");
                 BigDecimal reservPersons = 
quoteItem.getBigDecimal("reservPersons");
-                //String accommodationMapId = 
quoteItem.getString("accommodationMapId");
-                //String accommodationSpotId = 
quoteItem.getString("accommodationSpotId");
-
                 int itemIndex = -1;
                 if (quoteItem.get("productId") == null) {
                     // non-product item
@@ -885,11 +867,6 @@ public class ShoppingCartServices {
                 cartItem.setQuoteId(quoteItem.getString("quoteId"));
                 
cartItem.setQuoteItemSeqId(quoteItem.getString("quoteItemSeqId"));
                 cartItem.setIsPromo(isPromo);
-                
//cartItem.setDesiredDeliveryDate(quoteItem.getTimestamp("estimatedDeliveryDate"));
-                //cartItem.setStatusId(quoteItem.getString("statusId"));
-                //cartItem.setItemType(quoteItem.getString("orderItemTypeId"));
-                
//cartItem.setProductCategoryId(quoteItem.getString("productCategoryId"));
-                
//cartItem.setShoppingList(quoteItem.getString("shoppingListId"), 
quoteItem.getString("shoppingListItemSeqId"));
             }
 
         }
@@ -1038,12 +1015,6 @@ public class ShoppingCartServices {
                     Debug.logError(e, module);
                     return ServiceUtil.returnError(e.getMessage());
                 }
-                /*
-                BigDecimal amount = 
shoppingListItem.getBigDecimal("selectedAmount");
-                if (amount == null) {
-                    amount = BigDecimal.ZERO;
-                }
-                 */
                 BigDecimal modifiedPrice = 
shoppingListItem.getBigDecimal("modifiedPrice");
                 BigDecimal quantity = 
shoppingListItem.getBigDecimal("quantity");
                 if (quantity == null) {

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java
 Sat Aug 27 12:14:17 2016
@@ -73,7 +73,6 @@ public final class ProductDisplayWorker
 
             while (cartiter != null && cartiter.hasNext()) {
                 ShoppingCartItem item = cartiter.next();
-                // Collection upgradeProducts = 
delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productId", 
item.getProductId(), "productAssocTypeId", "PRODUCT_UPGRADE"), null, true);
                 // since ProductAssoc records have a fromDate and thruDate, we 
can filter by now so that only assocs in the date range are included
                 List<GenericValue> complementProducts = 
EntityQuery.use(delegator).from("ProductAssoc").where("productId", 
item.getProductId(), "productAssocTypeId", 
"PRODUCT_COMPLEMENT").cache(true).filterByDate().queryList();
 
@@ -234,8 +233,6 @@ public final class ProductDisplayWorker
             }
 
             // if desired check view allow category
-            //if (checkViewAllow) {
-                //Set prodKeySet = products.keySet();
                 String currentCatalogId = 
CatalogWorker.getCurrentCatalogId(request);
                 String viewProductCategoryId = 
CatalogWorker.getCatalogViewAllowCategoryId(delegator, currentCatalogId);
                 if (viewProductCategoryId != null) {
@@ -248,19 +245,10 @@ public final class ProductDisplayWorker
                         }
                     }
                 }
-            //}
 
             List<GenericValue> reorderProds = new LinkedList<GenericValue>();
             reorderProds.addAll(products.values());
 
-            /*
-             //randomly remove products while there are more than 5
-             while (reorderProds.size() > 5) {
-             int toRemove = (int)(Math.random()*(double)(reorderProds.size()));
-             reorderProds.remove(toRemove);
-             }
-             */
-
             // sort descending by new metric...
             BigDecimal occurancesModifier = BigDecimal.ONE;
             BigDecimal quantityModifier = BigDecimal.ONE;

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
 Sat Aug 27 12:14:17 2016
@@ -509,8 +509,6 @@ public final class ProductPromoWorker {
             }
         }
 
-        // Debug.logInfo("Promo [" + productPromoId + "] use limit after per 
order check: " + candidateUseLimit, module);
-
         Long useLimitPerCustomer = productPromo.getLong("useLimitPerCustomer");
         // check this whether or not there is a party right now
         if (useLimitPerCustomer != null) {
@@ -531,8 +529,6 @@ public final class ProductPromoWorker {
             }
         }
 
-        // Debug.logInfo("Promo [" + productPromoId + "] use limit after per 
customer check: " + candidateUseLimit, module);
-
         Long useLimitPerPromotion = 
productPromo.getLong("useLimitPerPromotion");
         if (useLimitPerPromotion != null) {
             // check to see how many times this has been used for other orders 
for this customer, the remainder is the limit for this order
@@ -547,8 +543,6 @@ public final class ProductPromoWorker {
             }
         }
 
-        // Debug.logInfo("Promo [" + productPromoId + "] use limit after per 
promotion check: " + candidateUseLimit, module);
-
         return candidateUseLimit;
     }
 
@@ -948,8 +942,6 @@ public final class ProductPromoWorker {
                 amountNeeded = new BigDecimal(condValue);
             }
 
-            // Debug.logInfo("Doing Amount Cond with Value: " + amountNeeded, 
module);
-
             Set<String> productIds = 
ProductPromoWorker.getPromoRuleCondProductIds(productPromoCond, delegator, 
nowTimestamp);
 
             List<ShoppingCartItem> lineOrderedByBasePriceList = 
cart.getLineListOrderedByBasePrice(false);
@@ -975,8 +967,6 @@ public final class ProductPromoWorker {
                 }
             }
 
-            // Debug.logInfo("Doing Amount Cond with Value after finding 
applicable cart lines: " + amountNeeded, module);
-
             // if amountNeeded > 0 then the promo condition failed, so remove 
candidate promo uses and increment the promoQuantityUsed to restore it
             if (amountNeeded.compareTo(BigDecimal.ZERO) > 0) {
                 // failed, reset the entire rule, ie including all other 
conditions that might have been done before
@@ -993,8 +983,6 @@ public final class ProductPromoWorker {
                 BigDecimal amountNeeded = new BigDecimal(condValue);
                 BigDecimal amountAvailable = BigDecimal.ZERO;
 
-                // Debug.logInfo("Doing Amount Not Counted Cond with Value: " 
+ amountNeeded, module);
-
                 Set<String> productIds = 
ProductPromoWorker.getPromoRuleCondProductIds(productPromoCond, delegator, 
nowTimestamp);
 
                 List<ShoppingCartItem> lineOrderedByBasePriceList = 
cart.getLineListOrderedByBasePrice(false);
@@ -1012,8 +1000,6 @@ public final class ProductPromoWorker {
                     }
                 }
 
-                // Debug.logInfo("Doing Amount Not Counted Cond with Value 
after finding applicable cart lines: " + amountNeeded, module);
-
                 compareBase = 
Integer.valueOf(amountAvailable.compareTo(amountNeeded));
             }
         } else if ("PPIP_PRODUCT_QUANT".equals(inputParamEnumId)) {
@@ -1055,63 +1041,6 @@ public final class ProductPromoWorker {
                 // NOTE: don't confirm rpomo rule use here, wait until actions 
are complete for the rule to do that
             }
 
-        /* replaced by PPIP_PRODUCT_QUANT
-        } else if ("PPIP_PRODUCT_ID_IC".equals(inputParamEnumId)) {
-            String candidateProductId = condValue;
-
-            if (candidateProductId == null) {
-                // if null, then it's not in the cart
-                compareBase = Integer.valueOf(1);
-            } else {
-                // Debug.logInfo("Testing to see if productId \"" + 
candidateProductId + "\" is in the cart", module);
-                List productCartItems = 
cart.findAllCartItems(candidateProductId);
-
-                // don't count promotion items in this count...
-                Iterator pciIter = productCartItems.iterator();
-                while (pciIter.hasNext()) {
-                    ShoppingCartItem productCartItem = (ShoppingCartItem) 
pciIter.next();
-                    if (productCartItem.getIsPromo()) pciIter.remove();
-                }
-
-                if (productCartItems.size() > 0) {
-                    //Debug.logError("Item with productId \"" + 
candidateProductId + "\" IS in the cart", module);
-                    compareBase = Integer.valueOf(0);
-                } else {
-                    //Debug.logError("Item with productId \"" + 
candidateProductId + "\" IS NOT in the cart", module);
-                    compareBase = Integer.valueOf(1);
-                }
-            }
-        } else if ("PPIP_CATEGORY_ID_IC".equals(inputParamEnumId)) {
-            String productCategoryId = condValue;
-            Set productIds = new HashSet();
-
-            Iterator cartItemIter = cart.iterator();
-            while (cartItemIter.hasNext()) {
-                ShoppingCartItem cartItem = (ShoppingCartItem) 
cartItemIter.next();
-                if (!cartItem.getIsPromo()) {
-                    productIds.add(cartItem.getProductId());
-                }
-            }
-
-            compareBase = Integer.valueOf(1);
-            // NOTE: this technique is efficient for a smaller number of items 
in the cart, if there are a lot of lines
-            //in the cart then a non-cached query with a set of productIds 
using the IN operator would be better
-            Iterator productIdIter = productIds.iterator();
-            while (productIdIter.hasNext()) {
-                String productId = (String) productIdIter.next();
-
-                // if a ProductCategoryMember exists for this productId and 
the specified productCategoryId
-                List productCategoryMembers = 
delegator.findByAnd("ProductCategoryMember", UtilMisc.toMap("productId", 
productId, "productCategoryId", productCategoryId), null, true);
-                // and from/thru date within range
-                productCategoryMembers = 
EntityUtil.filterByDate(productCategoryMembers, nowTimestamp);
-                if (UtilValidate.isNotEmpty(productCategoryMembers)) {
-                    // if any product is in category, set true and break
-                    // then 0 (equals), otherwise 1 (not equals)
-                    compareBase = Integer.valueOf(0);
-                    break;
-                }
-            }
-        */
         } else if ("PPIP_NEW_ACCT".equals(inputParamEnumId)) {
             if (UtilValidate.isNotEmpty(condValue)) {
                 BigDecimal acctDays = 
cart.getPartyDaysSinceCreated(nowTimestamp);
@@ -1367,7 +1296,6 @@ public final class ProductPromoWorker {
 
     private static boolean checkConditionForItem(GenericValue 
productPromoCond, ShoppingCart cart, ShoppingCartItem cartItem, Delegator 
delegator, LocalDispatcher dispatcher, Timestamp nowTimestamp) throws 
GenericEntityException {
         String condValue = productPromoCond.getString("condValue");
-        // String otherValue = productPromoCond.getString("otherValue");
         String inputParamEnumId = 
productPromoCond.getString("inputParamEnumId");
         String operatorEnumId = productPromoCond.getString("operatorEnumId");
 
@@ -1514,7 +1442,6 @@ public final class ProductPromoWorker {
 
                 GenericValue product = null;
                 if (UtilValidate.isNotEmpty(productId)) {
-                    // Debug.logInfo("======== Got GWP productId [" + 
productId + "]", module);
                     product = 
EntityQuery.use(delegator).from("Product").where("productId", 
productId).cache().queryOne();
                     if (product == null) {
                         String errMsg = "GWP Product not found with ID [" + 
productId + "] for ProductPromoAction [" + 
productPromoAction.get("productPromoId") + ":" + 
productPromoAction.get("productPromoRuleId") + ":" + 
productPromoAction.get("productPromoActionSeqId") + "]";
@@ -1528,7 +1455,6 @@ public final class ProductPromoWorker {
                         }
                         productId = null;
                         product = null;
-                        // Debug.logInfo("======== GWP productId [" + 
productId + "] is a virtual with " + productAssocs.size() + " variants", 
module);
                     } else {
                         // check inventory on this product, make sure it is 
available before going on
                         //NOTE: even though the store may not require 
inventory for purchase, we will always require inventory for gifts
@@ -1673,7 +1599,6 @@ public final class ProductPromoWorker {
                 GenericValue product = cartItem.getProduct();
                 String parentProductId = cartItem.getParentProductId();
                 boolean passedItemConds = 
checkConditionsForItem(productPromoAction, cart, cartItem, delegator, 
dispatcher, nowTimestamp);
-                // Debug.logInfo("Running promo action for cartItem " + 
cartItem.getName() + ", passedItemConds=" + passedItemConds + ", 
productPromoAction=" + productPromoAction, module);
                 if (passedItemConds && !cartItem.getIsPromo() &&
                         (productIds.contains(cartItem.getProductId()) || 
(parentProductId != null && productIds.contains(parentProductId))) &&
                         (product == null || 
!"N".equals(product.getString("includeInPromotions")))) {
@@ -2202,27 +2127,6 @@ public final class ProductPromoWorker {
                 firstProductIdSet.retainAll(productIdSet);
             }
 
-            /* the old way of doing it, not as efficient, recoded above using 
the retainAll operation, pretty handy
-            Iterator firstProductIdIter = firstProductIdSet.iterator();
-            while (firstProductIdIter.hasNext()) {
-                String curProductId = (String) firstProductIdIter.next();
-
-                boolean allContainProductId = true;
-                Iterator productIdSetIter = productIdSetList.iterator();
-                while (productIdSetIter.hasNext()) {
-                    Set productIdSet = (Set) productIdSetIter.next();
-                    if (!productIdSet.contains(curProductId)) {
-                        allContainProductId = false;
-                        break;
-                    }
-                }
-
-                if (!allContainProductId) {
-                    firstProductIdIter.remove();
-                }
-            }
-             */
-
             if (firstProductIdSet.size() >= 0) {
                 if (include) {
                     productIds.addAll(firstProductIdSet);

Modified: 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java?rev=1758006&r1=1758005&r2=1758006&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
 (original)
+++ 
ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/shipping/ShippingEvents.java
 Sat Aug 27 12:14:17 2016
@@ -176,13 +176,6 @@ public class ShippingEvents {
             carrierRoleTypeId = "CARRIER";
         }
 
-//  ShipmentCostEstimate entity allows null value for geoIdTo field. So if 
geoIdTo is null we should be using orderFlatPrice for shipping cost.
-//  So now calcShipmentCostEstimate service requires shippingContactMechId 
only if geoIdTo field has not null value.
-//        if (shippingContactMechId == null) {
-//            errorMessageList.add("Please Select Your Shipping Address.");
-//            return ServiceUtil.returnError(errorMessageList);
-//        }
-
         // if as supplier is associated, then we have a drop shipment and 
should use the origin shipment address of it
         String shippingOriginContactMechId = null;
         if (supplierPartyId != null) {



Reply via email to