Author: doogie
Date: Fri Mar 27 17:01:06 2009 New Revision: 759251 URL: http://svn.apache.org/viewvc?rev=759251&view=rev Log: Fix lines that *only* have whitespace. Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartItemModifyException.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/WebShoppingCart.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductDisplayWorker.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductStoreCartAwareEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/shipping/ShippingEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskEvents.java ofbiz/trunk/applications/order/src/org/ofbiz/order/task/TaskWorker.java ofbiz/trunk/applications/order/src/org/ofbiz/order/test/OrderTestServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/test/PurchaseOrderTest.java ofbiz/trunk/applications/order/src/org/ofbiz/order/test/SalesOrderTest.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/OrderManagerEvents.java Fri Mar 27 17:01:06 2009 @@ -99,7 +99,7 @@ request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); return "error"; } - + if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); request.setAttribute("_ERROR_MESSAGE_", (String) results.get(ModelService.ERROR_MESSAGE)); @@ -204,7 +204,7 @@ if (userLogin != null) { paymentPreference.set("createdByUserLogin", userLogin.getString("userLoginId")); } - + try { delegator.create(paymentPreference); } catch (GenericEntityException ex) { @@ -224,7 +224,7 @@ request.setAttribute("_ERROR_MESSAGE_", e.getMessage()); return "error"; } - + if ((results == null) || (results.get(ModelService.RESPONSE_MESSAGE).equals(ModelService.RESPOND_ERROR))) { Debug.logError((String) results.get(ModelService.ERROR_MESSAGE), module); request.setAttribute("_ERROR_MESSAGE_", (String) results.get(ModelService.ERROR_MESSAGE)); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/finaccount/FinAccountHelper.java Fri Mar 27 17:01:06 2009 @@ -45,7 +45,7 @@ * */ public class FinAccountHelper { - + public static final String module = FinAccountHelper.class.getName(); /** * A word on precision: since we're just adding and subtracting, the interim figures should have one more decimal place of precision than the final numbers. @@ -53,10 +53,10 @@ public static int decimals = UtilNumber.getBigDecimalScale("finaccount.decimals"); public static int rounding = UtilNumber.getBigDecimalRoundingMode("finaccount.rounding"); public static final BigDecimal ZERO = BigDecimal.ZERO.setScale(decimals, rounding); - + public static final String giftCertFinAccountTypeId = "GIFTCERT_ACCOUNT"; public static final boolean defaultPinRequired = false; - + // pool of available characters for account codes, here numbers plus uppercase characters static char[] char_pool = new char[10+26]; static { @@ -68,7 +68,7 @@ char_pool[j++] = (char) i; } } - + /** * A convenience method which adds transactions.get(0).get(fieldName) to initialValue, all done in BigDecimal to decimals and rounding @@ -128,7 +128,7 @@ return newAccountCode.toString(); } - + /** * Gets the first (and should be only) FinAccount based on finAccountCode, which will be cleaned up to be only uppercase and alphanumeric * @param finAccountCode @@ -141,21 +141,21 @@ if (finAccountCode == null) { return null; } - + Pattern filterRegex = Pattern.compile("[^0-9A-Z]"); finAccountCode = finAccountCode.toUpperCase().replaceAll(filterRegex.pattern(), ""); - + // now we need to get the encrypted version of the fin account code the user passed in to look up against FinAccount // we do this by making a temporary generic entity with same finAccountCode and then doing a match ModelEntity finAccountEntity = delegator.getModelEntity("FinAccount"); GenericEntity encryptedFinAccount = GenericEntity.createGenericEntity(finAccountEntity, UtilMisc.toMap("finAccountCode", finAccountCode)); delegator.encryptFields(encryptedFinAccount); String encryptedFinAccountCode = encryptedFinAccount.getString("finAccountCode"); - + // now look for the account List accounts = delegator.findByAnd("FinAccount", UtilMisc.toMap("finAccountCode", encryptedFinAccountCode)); accounts = EntityUtil.filterByDate(accounts); - + if ((accounts == null) || (accounts.size() == 0)) { // OK to display - not a code anyway Debug.logWarning("No fin account found for account code [" + finAccountCode + "]", module); @@ -168,8 +168,8 @@ return (GenericValue) accounts.get(0); } } - - + + /** * Sum of all DEPOSIT and ADJUSTMENT transactions minus all WITHDRAWAL transactions whose transactionDate is before asOfDateTime * @param finAccountId @@ -180,13 +180,13 @@ */ public static BigDecimal getBalance(String finAccountId, Timestamp asOfDateTime, GenericDelegator delegator) throws GenericEntityException { if (asOfDateTime == null) asOfDateTime = UtilDateTime.nowTimestamp(); - + BigDecimal incrementTotal = ZERO; // total amount of transactions which increase balance BigDecimal decrementTotal = ZERO; // decrease balance GenericValue finAccount = delegator.findByPrimaryKeyCache("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); String currencyUomId = finAccount.getString("currencyUomId"); - + // find the sum of all transactions which increase the value EntityConditionList incrementConditions = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("finAccountId", EntityOperator.EQUALS, finAccountId), @@ -208,7 +208,7 @@ EntityOperator.AND); transSums = delegator.findList("FinAccountTransSum", decrementConditions, UtilMisc.toSet("amount"), null, null, false); decrementTotal = addFirstEntryAmount(decrementTotal, transSums, "amount", (decimals+1), rounding); - + // the net balance is just the incrementTotal minus the decrementTotal return incrementTotal.subtract(decrementTotal).setScale(decimals, rounding); } @@ -225,18 +225,18 @@ if (asOfDateTime == null) asOfDateTime = UtilDateTime.nowTimestamp(); BigDecimal netBalance = getBalance(finAccountId, asOfDateTime, delegator); - + // find sum of all authorizations which are not expired and which were authorized before as of time EntityConditionList authorizationConditions = EntityCondition.makeCondition(UtilMisc.toList( EntityCondition.makeCondition("finAccountId", EntityOperator.EQUALS, finAccountId), EntityCondition.makeCondition("authorizationDate", EntityOperator.LESS_THAN_EQUAL_TO, asOfDateTime), EntityUtil.getFilterByDateExpr(asOfDateTime)), EntityOperator.AND); - + List authSums = delegator.findList("FinAccountAuthSum", authorizationConditions, UtilMisc.toSet("amount"), null, null, false); - + BigDecimal authorizationsTotal = addFirstEntryAmount(ZERO, authSums, "amount", (decimals+1), rounding); - + // the total available balance is transactions total minus authorizations total return netBalance.subtract(authorizationsTotal).setScale(decimals, rounding); } @@ -259,7 +259,7 @@ } catch (GenericEntityException e) { Debug.logError(e, module); } - + if (finAccount != null) { String dbPin = finAccount.getString("finAccountCode"); Debug.logInfo("FinAccount Pin Validation: [Sent: " + pinNumber + "] [Actual: " + dbPin + "]", module); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderChangeHelper.java Fri Mar 27 17:01:06 2009 @@ -190,7 +190,7 @@ GenericValue orderItem = (GenericValue) oii.next(); String orderItemSeqId = orderItem.getString("orderItemSeqId"); GenericValue product = null; - + try { product = orderItem.getRelatedOne("Product"); } catch (GenericEntityException e) { Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderContentWrapper.java Fri Mar 27 17:01:06 2009 @@ -45,12 +45,12 @@ * */ public class OrderContentWrapper { - + public static final String module = OrderContentWrapper.class.getName(); public static final String SEPARATOR = "::"; // cache key separator - + public static UtilCache orderContentCache; - + public static OrderContentWrapper makeOrderContentWrapper(GenericValue order, HttpServletRequest request) { return new OrderContentWrapper(order, request); } @@ -59,7 +59,7 @@ protected GenericValue order; protected Locale locale; protected String mimeTypeId; - + public OrderContentWrapper(LocalDispatcher dispatcher, GenericValue order, Locale locale, String mimeTypeId) { this.dispatcher = dispatcher; this.order = order; @@ -69,7 +69,7 @@ orderContentCache = new UtilCache("order.content", true); // use soft reference to free up memory if needed } } - + public OrderContentWrapper(GenericValue order, HttpServletRequest request) { this.dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); this.order = order; @@ -79,11 +79,11 @@ orderContentCache = new UtilCache("order.content", true); // use soft reference to free up memory if needed } } - + public String get(String orderContentTypeId) { return getOrderContentAsText(order, orderContentTypeId, locale, mimeTypeId, order.getDelegator(), dispatcher); } - + public static String getOrderContentAsText(GenericValue order, String orderContentTypeId, HttpServletRequest request) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); return getOrderContentAsText(order, orderContentTypeId, UtilHttp.getLocale(request), "text/html", order.getDelegator(), dispatcher); @@ -92,19 +92,19 @@ public static String getOrderContentAsText(GenericValue order, String orderContentTypeId, Locale locale, LocalDispatcher dispatcher) { return getOrderContentAsText(order, orderContentTypeId, locale, null, null, dispatcher); } - + public static String getOrderContentAsText(GenericValue order, String orderContentTypeId, Locale locale, String mimeTypeId, GenericDelegator delegator, LocalDispatcher dispatcher) { /* caching: there is one cache created, "order.content" Each order's content is cached with a key of * contentTypeId::locale::mimeType::orderId::orderItemSeqId, or whatever the SEPARATOR is defined above to be. */ String orderItemSeqId = (order.getEntityName().equals("OrderItem")? order.getString("orderItemSeqId"): "_NA_"); - + String cacheKey = orderContentTypeId + SEPARATOR + locale + SEPARATOR + mimeTypeId + SEPARATOR + order.get("orderId") + SEPARATOR + orderItemSeqId; try { if (orderContentCache != null && orderContentCache.get(cacheKey) != null) { return (String) orderContentCache.get(cacheKey); } - + Writer outWriter = new StringWriter(); getOrderContentAsText(null, null, order, orderContentTypeId, locale, mimeTypeId, delegator, dispatcher, outWriter); String outString = outWriter.toString(); @@ -123,7 +123,7 @@ return ""; } } - + public static void getOrderContentAsText(String orderId, String orderItemSeqId, GenericValue order, String orderContentTypeId, Locale locale, String mimeTypeId, GenericDelegator delegator, LocalDispatcher dispatcher, Writer outWriter) throws GeneralException, IOException { if (orderId == null && order != null) { orderId = order.getString("orderId"); @@ -131,15 +131,15 @@ if (orderItemSeqId == null && order != null) { orderItemSeqId = (order.getEntityName().equals("OrderItem")? order.getString("orderItemSeqId"): "_NA_"); } - + if (delegator == null && order != null) { delegator = order.getDelegator(); } - + if (UtilValidate.isEmpty(mimeTypeId)) { mimeTypeId = "text/html"; } - + List orderContentList = delegator.findByAndCache("OrderContent", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId, "orderContentTypeId", orderContentTypeId), UtilMisc.toList("-fromDate")); orderContentList = EntityUtil.filterByDate(orderContentList); GenericValue orderContent = EntityUtil.getFirst(orderContentList); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderEvents.java Fri Mar 27 17:01:06 2009 @@ -49,21 +49,21 @@ GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); String dataResourceId = request.getParameter("dataResourceId"); - + try { // has the userLogin.partyId ordered a product with DIGITAL_DOWNLOAD content associated for the given dataResourceId? List orderRoleAndProductContentInfoList = delegator.findByAnd("OrderRoleAndProductContentInfo", UtilMisc.toMap("partyId", userLogin.get("partyId"), "dataResourceId", dataResourceId, "productContentTypeId", "DIGITAL_DOWNLOAD", "statusId", "ITEM_COMPLETED")); - + if (orderRoleAndProductContentInfoList.size() == 0) { request.setAttribute("_ERROR_MESSAGE_", "No record of purchase for digital download found (dataResourceId=[" + dataResourceId + "])."); return "error"; } - + GenericValue orderRoleAndProductContentInfo = (GenericValue) orderRoleAndProductContentInfoList.get(0); - + // TODO: check validity based on ProductContent fields: useCountLimit, useTime/useTimeUomId - + if (orderRoleAndProductContentInfo.getString("mimeTypeId") != null) { response.setContentType(orderRoleAndProductContentInfo.getString("mimeTypeId")); } @@ -86,7 +86,7 @@ request.setAttribute("_ERROR_MESSAGE_", errMsg); return "error"; } - + return "success"; } } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderListState.java Fri Mar 27 17:01:06 2009 @@ -187,11 +187,11 @@ public Map getOrderStatusState() { return orderStatusState; }; public Map getOrderTypeState() { return orderTypeState; } public Map getorderFilterState() { return orderFilterState; } - + public boolean hasStatus(String param) { return ("Y".equals(orderStatusState.get(param))); } public boolean hasType(String param) { return ("Y".equals(orderTypeState.get(param))); } public boolean hasFilter(String param) { return ("Y".equals(orderFilterState.get(param))); } - + public boolean hasAllStatus() { for (Iterator iter = orderStatusState.values().iterator(); iter.hasNext(); ) { if (!"Y".equals(iter.next())) return false; @@ -228,7 +228,7 @@ if (!hasType(type)) continue; typeConditions.add( EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, parameterToOrderTypeId.get(type)) ); } - + EntityCondition statusConditionsList = EntityCondition.makeCondition(statusConditions, EntityOperator.OR); EntityCondition typeConditionsList = EntityCondition.makeCondition(typeConditions, EntityOperator.OR); if ((typeConditions.size() > 0) && (statusConditions.size() > 0)) { Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Fri Mar 27 17:01:06 2009 @@ -165,7 +165,7 @@ return null; } } - + public String getOrderTypeId() { return orderHeader.getString("orderTypeId"); } @@ -177,7 +177,7 @@ public String getOrderName() { return orderHeader.getString("orderName"); } - + public List getAdjustments() { if (adjustments == null) { try { @@ -391,7 +391,7 @@ } return false; } - + public boolean hasPhysicalProductItems() throws GenericEntityException { Iterator orderItemIter = this.getOrderItems().iterator(); while (orderItemIter.hasNext()) { @@ -1047,7 +1047,7 @@ } return shippableSizes; } - + /** * Get the total payment preference amount by payment type. Specify null to get amount * for all preference types. TODO: filter by status as well? @@ -1998,7 +1998,7 @@ EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, orderItem.getString("orderItemSeqId")), EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PICKLIST_CANCELLED")), EntityOperator.AND); - + List picked = null; try { picked = orderHeader.getDelegator().findList("PicklistAndBinAndItem", pickedConditions, null, null, null, false); @@ -2306,11 +2306,11 @@ List contraints1 = UtilMisc.toList(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, null)); contraints1.add(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, DataModelConstants.SEQ_ID_NA)); contraints1.add(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, "")); - + List contraints2 = UtilMisc.toList(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, null)); contraints2.add(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, DataModelConstants.SEQ_ID_NA)); contraints2.add(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, "")); - + List newOrderStatuses = FastList.newInstance(); newOrderStatuses.addAll(EntityUtil.filterByOr(orderStatuses, contraints1)); return EntityUtil.orderBy(EntityUtil.filterByOr(newOrderStatuses, contraints2), UtilMisc.toList("-statusDatetime")); @@ -2474,18 +2474,18 @@ // add tax and shipping to subtotal return getOrderItemSubTotal(orderItem, adjustments).add(getOrderItemAdjustmentsTotal(orderItem, adjustments, false, true, true)); } - + public static BigDecimal calcOrderPromoAdjustmentsBd(List allOrderAdjustments) { BigDecimal promoAdjTotal = ZERO; - + List promoAdjustments = EntityUtil.filterByAnd(allOrderAdjustments, UtilMisc.toMap("orderAdjustmentTypeId", "PROMOTION_ADJUSTMENT")); - + if (!promoAdjustments.isEmpty()) { - + Iterator promoAdjIter = promoAdjustments.iterator(); while (promoAdjIter.hasNext()) { GenericValue promoAdjustment = (GenericValue) promoAdjIter.next(); - + if (promoAdjustment != null) { BigDecimal amount = promoAdjustment.getBigDecimal("amount").setScale(taxCalcScale, taxRounding); promoAdjTotal = promoAdjTotal.add(amount); @@ -2502,7 +2502,7 @@ } return length; } - + public static BigDecimal getWorkEffortRentalQuantity(GenericValue workEffort) { BigDecimal persons = BigDecimal.ONE; if (workEffort.get("reservPersons") != null) @@ -2567,7 +2567,7 @@ List contraints2 = UtilMisc.toList(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, null)); contraints2.add(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, DataModelConstants.SEQ_ID_NA)); contraints2.add(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.EQUALS, "")); - + List newOrderStatuses = FastList.newInstance(); newOrderStatuses.addAll(EntityUtil.filterByAnd(orderStatuses, contraints1)); return EntityUtil.orderBy(EntityUtil.filterByOr(newOrderStatuses, contraints2), UtilMisc.toList("-statusDatetime")); @@ -2818,11 +2818,11 @@ List contraints1 = UtilMisc.toList(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, null)); contraints1.add(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, DataModelConstants.SEQ_ID_NA)); contraints1.add(EntityCondition.makeCondition("orderItemSeqId", EntityOperator.EQUALS, "")); - + List contraints2 = UtilMisc.toList(EntityCondition.makeCondition("orderPaymentPreferenceId", EntityOperator.NOT_EQUAL, null)); List newOrderStatuses = FastList.newInstance(); newOrderStatuses.addAll(EntityUtil.filterByOr(orderStatuses, contraints1)); - + return EntityUtil.orderBy(EntityUtil.filterByAnd(newOrderStatuses, contraints2), UtilMisc.toList("-statusDatetime")); } } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Fri Mar 27 17:01:06 2009 @@ -440,7 +440,7 @@ Debug.logError(e, "Problems looking up returnable product type information", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderErrorUnableToGetTheItemReturnableProduct", locale)); } - + } Map serviceResult = null; try { @@ -481,7 +481,7 @@ returnInfo.put("itemTypeKey", itemTypeKey); returnable.put(item, returnInfo); - + // Order item adjustments List itemAdjustments = null; try { @@ -629,14 +629,14 @@ Debug.logError(e, "Problems looking up return information", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderErrorGettingReturnHeaderItemInformation", locale)); } - + BigDecimal adjustments = getReturnAdjustmentTotal(delegator, UtilMisc.toMap("returnId", returnId, "returnTypeId", "RTN_CREDIT")); if (returnHeader != null && ((returnItems != null && returnItems.size() > 0) || adjustments.compareTo(ZERO) > 0)) { String billingAccountId = returnHeader.getString("billingAccountId"); String fromPartyId = returnHeader.getString("fromPartyId"); String toPartyId = returnHeader.getString("toPartyId"); - + // make sure total refunds on a return don't exceed amount of returned orders Map serviceResult = null; try { @@ -887,7 +887,7 @@ } groupReturnItemsByOrder(returnItems, itemsByOrder, totalByOrder, delegator, returnId, "RTN_REFUND"); - + // process each one by order Set itemSet = itemsByOrder.entrySet(); Iterator itemByOrderIt = itemSet.iterator(); @@ -927,7 +927,7 @@ return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderProblemsWithGetPartyAcctgPreferences", locale)); } orgAcctgPref = (GenericValue) acctgPreferencesResult.get("partyAccountingPreference"); - + if (UtilValidate.isNotEmpty(orgAcctgPref)) { try { refundPaymentMethod = orgAcctgPref.getRelatedOne("PaymentMethod"); @@ -1064,7 +1064,7 @@ input.put("paymentMethodId", orderPaymentPreference.get("paymentMethodId")); input.put("paymentMethodTypeId", orderPaymentPreference.get("paymentMethodTypeId")); input.put("paymentPreferenceId", orderPaymentPreference.get("orderPaymentPreferenceId")); - + serviceResult = dispatcher.runSync("createPayment", input); if (ServiceUtil.isError(serviceResult) || ServiceUtil.isFailure(serviceResult)) { @@ -1234,12 +1234,12 @@ } } } - + Map result = ServiceUtil.returnSuccess(); result.put("paymentId", paymentId); return result; } - + public static Map createPaymentApplicationsFromReturnItemResponse(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -1376,7 +1376,7 @@ // create the replacement order Map orderMap = UtilMisc.toMap("userLogin", userLogin); - + String placingPartyId = null; GenericValue placingParty = null; if ("CUSTOMER_RETURN".equals(returnHeaderTypeId)) { @@ -1499,7 +1499,7 @@ } } } - + GenericValue newItem = delegator.makeValue("OrderItem", UtilMisc.toMap("orderItemSeqId", UtilFormatOut.formatPaddedNumber(itemCount++, 5))); if (UtilValidate.isEmpty(refurbItem)) { newItem.set("productId", orderItem.get("productId")); @@ -1740,7 +1740,7 @@ // since there is no payments required; order is ready for processing/shipment if (createdOrderId != null) { OrderChangeHelper.approveOrder(dispatcher, userLogin, createdOrderId); - + // create a ReturnItemResponse and attach to each ReturnItem Map itemResponse = FastMap.newInstance(); itemResponse.put("replacementOrderId", createdOrderId); @@ -1758,7 +1758,7 @@ Debug.logError(e, "Problem creating ReturnItemResponse record", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderProblemCreatingReturnItemResponseRecord", locale)); } - + Iterator updateReturnItemIter = returnItemList.iterator(); while (updateReturnItemIter.hasNext()) { GenericValue returnItem = (GenericValue) updateReturnItemIter.next(); @@ -1907,7 +1907,7 @@ } } } - + // We may also have some order-level adjustments, so we need to go through each order again and add those as well if ((totalByOrder != null) && (totalByOrder.keySet() != null)) { Iterator orderIterator = totalByOrder.keySet().iterator(); @@ -1923,7 +1923,7 @@ } } - + public static Map getReturnAmountByOrder(DispatchContext dctx, Map context) { GenericDelegator delegator = dctx.getDelegator(); String returnId = (String) context.get("returnId"); @@ -1932,7 +1932,7 @@ Map returnAmountByOrder = new HashMap(); try { returnItems = delegator.findByAnd("ReturnItem", UtilMisc.toMap("returnId", returnId)); - + } catch (GenericEntityException e) { Debug.logError(e, "Problems looking up return information", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderErrorGettingReturnHeaderItemInformation", locale)); @@ -2018,16 +2018,16 @@ String returnId = (String) context.get("returnId"); String returnItemSeqId = (String) context.get("returnItemSeqId"); String description = (String) context.get("description"); - + GenericValue returnItemTypeMap = null; GenericValue orderAdjustment = null; GenericValue returnAdjustmentType = null; GenericValue orderItem = null; GenericValue returnItem = null; GenericValue returnHeader = null; - + BigDecimal amount; - + // if orderAdjustment is not empty, then copy most return adjustment information from orderAdjustment's if (orderAdjustmentId != null) { try { @@ -2190,7 +2190,7 @@ return ServiceUtil.returnError(e.getMessage()); } } - + // used as a dispatch service, invoke different service based on the parameters passed in public static Map updateReturnItemOrAdjustment(DispatchContext dctx, Map context) { Debug.logInfo("updateReturnItemOrAdjustment's context:" + context, module); @@ -2207,7 +2207,7 @@ return ServiceUtil.returnError(e.getMessage()); } } - + /** * These return adjustment types need to be recalculated when the return item is updated * @param returnAdjustmentTypeId @@ -2267,7 +2267,7 @@ while (modelParmInIter.hasNext()) { ModelParam modelParam = (ModelParam) modelParmInIter.next(); String paramName = modelParam.name; - + Object value = context.get(paramName); if (value != null) { serviceContext.put(paramName, value); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Mar 27 17:01:06 2009 @@ -386,7 +386,7 @@ errorMessages.add(excMsg); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderCouldNotFindRelatedFixedAssetForTheProduct",UtilMisc.toMap("productId",orderItem.getString("productId")), locale )); } - + if (UtilValidate.isNotEmpty(selFixedAssetProduct)) { Iterator firstOne = selFixedAssetProduct.iterator(); if (firstOne.hasNext()) { @@ -419,7 +419,7 @@ } else if (billFromVendorPartyId != null) { orgPartyId = billFromVendorPartyId; } - + if (UtilValidate.isNotEmpty(orgPartyId)) { Map getNextOrderIdContext = UtilMisc.toMap("partyId", orgPartyId, "userLogin", userLogin); @@ -446,7 +446,7 @@ // for purchase orders or when other orderId generation fails, a product store id should not be required to make an order orderId = delegator.getNextSeqId("OrderHeader"); } - + String billingAccountId = (String) context.get("billingAccountId"); Timestamp orderDate = (Timestamp) context.get("orderDate"); if (orderDate == null) { @@ -556,7 +556,7 @@ toBeStored.add(orderItemGroup); } } - + // set the order items Iterator oi = orderItems.iterator(); while (oi.hasNext()) { @@ -1459,7 +1459,7 @@ // shipping amount BigDecimal orderShipping = OrderReadHelper.calcOrderAdjustments(orderHeaderAdjustments, orderSubTotal, false, false, true); - + //promotions amount BigDecimal orderPromotions = OrderReadHelper.calcOrderPromoAdjustmentsBd(allAdjustments); @@ -1486,7 +1486,7 @@ shippingAddress = (GenericValue) billingAddressList.get(0); } } - + // TODO and NOTE DEJ20070816: this is NOT a good way to determine if this is a face-to-face or immediatelyFulfilled order //this should be made consistent with the CheckOutHelper.makeTaxContext(int shipGroup, GenericValue shipAddress) method if (shippingAddress == null) { @@ -1509,7 +1509,7 @@ if (shippingAddress == null) { continue; } - + // prepare the service context Map serviceContext = UtilMisc.toMap("productStoreId", orh.getProductStoreId(), "itemProductList", products, "itemAmountList", amounts, "itemShippingList", shipAmts, "itemPriceList", itPrices, "orderShippingAmount", orderShipping); @@ -1728,7 +1728,7 @@ } String orderHeaderStatusId = orderHeader.getString("statusId"); - + boolean allCanceled = true; boolean allComplete = true; boolean allApproved = true; @@ -1761,7 +1761,7 @@ newStatus = "ORDER_COMPLETED"; } else if (allApproved) { boolean changeToApprove = true; - + // NOTE DEJ20070805 I'm not sure why we would want to auto-approve the header... adding at least this one exeption so that we don't have to add processing, held, etc statuses to the item status list // NOTE2 related to the above: appears this was a weird way to set the order header status by setting all order item statuses... changing that to be less weird and more direct // this is a bit of a pain: if the current statusId = ProductStore.headerApprovedStatus and we don't have that status in the history then we don't want to change it on approving the items @@ -1787,11 +1787,11 @@ return ServiceUtil.returnError(errMsg); } } - + if ("ORDER_SENT".equals(orderHeaderStatusId)) changeToApprove = false; if ("ORDER_COMPLETED".equals(orderHeaderStatusId)) changeToApprove = false; if ("ORDER_CANCELLED".equals(orderHeaderStatusId)) changeToApprove = false; - + if (changeToApprove) { newStatus = "ORDER_APPROVED"; } @@ -1836,7 +1836,7 @@ // check and make sure we have permission to change the order Security security = ctx.getSecurity(); - + boolean hasPermission = OrderServices.hasPermission(orderId, userLogin, "UPDATE", security, delegator); if (!hasPermission) { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderYouDoNotHavePermissionToChangeThisOrdersStatus",locale)); @@ -1878,7 +1878,7 @@ aisgaCancelQuantity = BigDecimal.ZERO; } BigDecimal availableQuantity = orderItemShipGroupAssoc.getBigDecimal("quantity").subtract(aisgaCancelQuantity); - + BigDecimal itemCancelQuantity = orderItem.getBigDecimal("cancelQuantity"); if (itemCancelQuantity == null) { itemCancelQuantity = BigDecimal.ZERO; @@ -1908,7 +1908,7 @@ Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderUnableToSetCancelQuantity", UtilMisc.toMap("itemMsgInfo",itemMsgInfo), locale)); } - + // create order item change record if (!"Y".equals(orderItem.getString("isPromo"))) { String reasonEnumId = null; @@ -1919,7 +1919,7 @@ if (UtilValidate.isNotEmpty(itemCommentMap)) { changeComments = (String) itemCommentMap.get(orderItem.getString("orderItemSeqId")); } - + Map serviceCtx = FastMap.newInstance(); serviceCtx.put("orderId", orderItem.getString("orderId")); serviceCtx.put("orderItemSeqId", orderItem.getString("orderItemSeqId")); @@ -2078,7 +2078,7 @@ if (!hasPermission) { return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderYouDoNotHavePermissionToChangeThisOrdersStatus",locale)); } - + if ("Y".equals(context.get("setItemStatus"))) { String newItemStatusId = null; if ("ORDER_APPROVED".equals(statusId)) { @@ -2088,7 +2088,7 @@ } else if ("ORDER_CANCELLED".equals(statusId)) { newItemStatusId = "ITEM_CANCELLED"; } - + if (newItemStatusId != null) { try { Map resp = dispatcher.runSync("changeOrderItemStatus", UtilMisc.<String, Object>toMap("orderId", orderId, "statusId", newItemStatusId, "userLogin", userLogin)); @@ -2296,7 +2296,7 @@ public static Map sendOrderPayRetryNotification(DispatchContext ctx, Map context) { return sendOrderNotificationScreen(ctx, context, "PRDS_ODR_PAYRETRY"); } - + protected static Map sendOrderNotificationScreen(DispatchContext dctx, Map context, String emailType) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -2312,7 +2312,7 @@ // this may happen during anonymous checkout, try to the special case user userLogin = temporaryAnonymousUserLogin; } - + // prepare the order information Map sendMap = FastMap.newInstance(); @@ -2379,7 +2379,7 @@ if (placingUserLogin == null) { placingUserLogin = temporaryAnonymousUserLogin; } - + GenericValue productStore = OrderReadHelper.getProductStoreFromOrder(orderHeader); if (locale == null && productStore != null) { String localeString = productStore.getString("defaultLocaleString"); @@ -2477,7 +2477,7 @@ Map templateData = new HashMap(context); 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); @@ -2707,7 +2707,7 @@ Debug.logError(se, module); return ServiceUtil.returnError("Problem associating note with order (" + se.getMessage() + ")"); } - + return ServiceUtil.returnSuccess(); } @@ -2844,7 +2844,7 @@ itemsExprs.add(EntityCondition.makeCondition("dontCancelSetUserLogin", EntityOperator.EQUALS, GenericEntity.NULL_FIELD)); itemsExprs.add(EntityCondition.makeCondition("dontCancelSetDate", EntityOperator.EQUALS, GenericEntity.NULL_FIELD)); itemsExprs.add(EntityCondition.makeCondition("autoCancelDate", EntityOperator.NOT_EQUAL, GenericEntity.NULL_FIELD)); - + ecl = EntityCondition.makeCondition(itemsExprs); List orderItems = null; @@ -3083,7 +3083,7 @@ } List allProductContent = product.getRelated("ProductContent"); - + // try looking up the parent product if the product has no content and is a variant if (((allProductContent == null) || allProductContent.size() == 0) && ("Y".equals(product.getString("isVariant")))) { GenericValue parentProduct = ProductWorker.getParentProduct(product.getString("productId"), delegator); @@ -3094,7 +3094,7 @@ allProductContent.addAll(parentProduct.getRelated("ProductContent")); } } - + if (UtilValidate.isNotEmpty(allProductContent)) { // only keep ones with valid dates productContent = EntityUtil.filterByDate(allProductContent, UtilDateTime.nowTimestamp(), "fromDate", "thruDate", true); @@ -3158,7 +3158,7 @@ } return ServiceUtil.returnSuccess(); } - + /** Service to invoice service items from order*/ public static Map invoiceServiceItems(DispatchContext dctx, Map context) { GenericDelegator delegator = dctx.getDelegator(); @@ -3390,7 +3390,7 @@ Map itemAttributesMap = (Map) context.get("itemAttributesMap"); Map<String,String> itemEstimatedShipDateMap = (Map) context.get("itemShipDateMap"); Map<String, String> itemEstimatedDeliveryDateMap = (Map) context.get("itemDeliveryDateMap"); - + // obtain a shopping cart object for updating ShoppingCart cart = null; try { @@ -3509,7 +3509,7 @@ cartItem.setDesiredDeliveryDate(deliveryDate); } } - + // Create Estimated ship dates for (Map.Entry<String, String> entry : itemEstimatedShipDateMap.entrySet()) { String itemSeqId = entry.getKey(); @@ -3519,9 +3519,9 @@ ShoppingCartItem cartItem = cart.findCartItem(itemSeqId); cartItem.setEstimatedShipDate(shipDate); } - + } - + // update the group amounts Iterator gai = itemQtyMap.keySet().iterator(); while (gai.hasNext()) { @@ -3556,7 +3556,7 @@ // run promotions to handle all changes in the cart ProductPromoWorker.doPromotions(cart, dispatcher); - + // save all the updated information try { saveUpdatedCartToOrder(dispatcher, delegator, cart, locale, userLogin, orderId, UtilMisc.toMap("itemReasonMap", itemReasonMap, "itemCommentMap", itemCommentMap)); @@ -3576,14 +3576,14 @@ result.put("orderId", orderId); return result; } - + public static Map loadCartForUpdate(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); GenericValue userLogin = (GenericValue) context.get("userLogin"); - + ShoppingCart cart = null; Map result = null; try { @@ -3594,7 +3594,7 @@ Debug.logError(e, module); result = ServiceUtil.returnError(e.getMessage()); } - + result.put("orderId", orderId); return result; } @@ -3638,7 +3638,7 @@ // - order payments are released (cancelled) // - offline non received payments are cancelled // - promotional, shipping and tax adjustments are removed - + // Inventory reservations // find ship group associations List shipGroupAssocs = null; @@ -3766,7 +3766,7 @@ } public static Map saveUpdatedCartToOrder(DispatchContext dctx, Map context) throws GeneralException { - + LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -3775,7 +3775,7 @@ ShoppingCart cart = (ShoppingCart) context.get("shoppingCart"); Map changeMap = (Map) context.get("changeMap"); Locale locale = (Locale) context.get("locale"); - + Map result = null; try { saveUpdatedCartToOrder(dispatcher, delegator, cart, locale, userLogin, orderId, changeMap); @@ -3785,7 +3785,7 @@ Debug.logError(e, module); result = ServiceUtil.returnError(e.getMessage()); } - + result.put("orderId", orderId); return result; } @@ -3809,7 +3809,7 @@ } cart.setItemShipGroupEstimate(shippingTotal, gi); } - + // calc the sales tax CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart); try { @@ -3870,7 +3870,7 @@ valueObj.set("statusId", "PAYMENT_NOT_RECEIVED"); } } else if ("OrderItem".equals(valueObj.getEntityName())) { - + // ignore promotion items. They are added/canceled automatically if ("Y".equals(valueObj.getString("isPromo"))) { continue; @@ -3883,19 +3883,19 @@ throw new GeneralException(e.getMessage()); } if (UtilValidate.isNotEmpty(oldOrderItem)) { - + // Existing order item found. Check for modifications and store if any String oldItemDescription = oldOrderItem.getString("itemDescription") != null ? oldOrderItem.getString("itemDescription") : ""; BigDecimal oldQuantity = oldOrderItem.getBigDecimal("quantity") != null ? oldOrderItem.getBigDecimal("quantity") : BigDecimal.ZERO; BigDecimal oldUnitPrice = oldOrderItem.getBigDecimal("unitPrice") != null ? oldOrderItem.getBigDecimal("unitPrice") : BigDecimal.ZERO; - + boolean changeFound = false; Map modifiedItem = FastMap.newInstance(); if (!oldItemDescription.equals(valueObj.getString("itemDescription"))) { modifiedItem.put("itemDescription", oldItemDescription); changeFound = true; } - + BigDecimal quantityDif = valueObj.getBigDecimal("quantity").subtract(oldQuantity); BigDecimal unitPriceDif = valueObj.getBigDecimal("unitPrice").subtract(oldUnitPrice); if (quantityDif.compareTo(BigDecimal.ZERO) != 0) { @@ -3907,7 +3907,7 @@ changeFound = true; } if (changeFound) { - + // found changes to store Map itemReasonMap = (Map) changeMap.get("itemReasonMap"); Map itemCommentMap = (Map) changeMap.get("itemCommentMap"); @@ -3919,14 +3919,14 @@ String changeComments = (String) itemCommentMap.get(valueObj.getString("orderItemSeqId")); modifiedItem.put("changeComments", changeComments); } - + modifiedItem.put("orderId", valueObj.getString("orderId")); modifiedItem.put("orderItemSeqId", valueObj.getString("orderItemSeqId")); modifiedItem.put("changeTypeEnumId", "ODR_ITM_UPDATE"); modifiedItems.add(modifiedItem); } } else { - + // this is a new item appended to the order Map itemReasonMap = (Map) changeMap.get("itemReasonMap"); Map itemCommentMap = (Map) changeMap.get("itemCommentMap"); @@ -3991,7 +3991,7 @@ } } } - + // make the order item object map & the ship group assoc list List orderItemShipGroupAssoc = new LinkedList(); Map itemValuesBySeqId = new HashMap(); @@ -4128,7 +4128,7 @@ if (billToParty == null) { return ServiceUtil.returnError("Failed to create Payment: cannot find the bill to customer party"); } - + // set the payToPartyId String payToPartyId = productStore.getString("payToPartyId"); if (payToPartyId == null) { @@ -4473,14 +4473,14 @@ CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator, cart); Map resultOrderMap = coh.createOrder(userLogin); String purchaseOrderId = (String)resultOrderMap.get("orderId"); - + // TODO: associate the new purchase order with the sales order (ship group) } else { // if there are no items to drop ship, then clear out the supplier partyId Debug.logWarning("No drop ship items found for order [" + shipGroup.getString("orderId") + "] and ship group [" + shipGroup.getString("shipGroupSeqId") + "] and supplier party [" + shipGroup.getString("supplierPartyId") + "]. Supplier party information will be cleared for this ship group", module); shipGroup.set("supplierPartyId", null); shipGroup.store(); - + } } } @@ -4489,7 +4489,7 @@ // TODO: imporve error handling ServiceUtil.returnError("The following error occurred creating drop shipments for order [" + orderId + "]: " + exc.getMessage()); } - + return ServiceUtil.returnSuccess(); } @@ -4560,26 +4560,26 @@ LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); Locale locale = (Locale) context.get("locale"); - + String orderId = (String) context.get("orderId"); String facilityId = (String) context.get("facilityId"); try { GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); - + if (UtilValidate.isEmpty(orderHeader)) { String errorMessage = UtilProperties.getMessage(resource_error, "OrderErrorOrderIdNotFound", UtilMisc.toMap("orderId", orderId), locale); Debug.logError(errorMessage, module); return ServiceUtil.returnError(errorMessage); } - + if (! "PURCHASE_ORDER".equals(orderHeader.getString("orderTypeId"))) { String errorMessage = UtilProperties.getMessage(resource_error, "ProductErrorOrderNotPurchaseOrder", UtilMisc.toMap("orderId", orderId), locale); Debug.logError(errorMessage, module); return ServiceUtil.returnError(errorMessage); } - + // Build a map of productId -> quantity cancelled over all order items Map productRequirementQuantities = new HashMap(); List orderItems = orderHeader.getRelated("OrderItem"); @@ -4587,7 +4587,7 @@ while (oiit.hasNext()) { GenericValue orderItem = (GenericValue) oiit.next(); if (! "PRODUCT_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) continue; - + // Get the cancelled quantity for the item BigDecimal orderItemCancelQuantity = BigDecimal.ZERO; if (! UtilValidate.isEmpty(orderItem.get("cancelQuantity")) ) { @@ -4595,13 +4595,13 @@ } if (orderItemCancelQuantity.compareTo(BigDecimal.ZERO) <= 0) continue; - + String productId = orderItem.getString("productId"); if (productRequirementQuantities.containsKey(productId)) { orderItemCancelQuantity = orderItemCancelQuantity.add((BigDecimal) productRequirementQuantities.get(productId)); } productRequirementQuantities.put(productId, orderItemCancelQuantity); - + } // Generate requirements for each of the product quantities @@ -4612,7 +4612,7 @@ Map createRequirementResult = dispatcher.runSync("createRequirement", UtilMisc.<String, Object>toMap("requirementTypeId", "PRODUCT_REQUIREMENT", "facilityId", facilityId, "productId", productId, "quantity", requiredQuantity, "userLogin", userLogin)); if (ServiceUtil.isError(createRequirementResult)) return createRequirementResult; } - + } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -4635,31 +4635,31 @@ LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); Locale locale = (Locale) context.get("locale"); - + String orderId = (String) context.get("orderId"); try { GenericValue orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId)); - + if (UtilValidate.isEmpty(orderHeader)) { String errorMessage = UtilProperties.getMessage(resource_error, "OrderErrorOrderIdNotFound", UtilMisc.toMap("orderId", orderId), locale); Debug.logError(errorMessage, module); return ServiceUtil.returnError(errorMessage); } - + if (! "PURCHASE_ORDER".equals(orderHeader.getString("orderTypeId"))) { String errorMessage = UtilProperties.getMessage(resource_error, "OrderErrorOrderNotPurchaseOrder", UtilMisc.toMap("orderId", orderId), locale); Debug.logError(errorMessage, module); return ServiceUtil.returnError(errorMessage); } - + List orderItems = orderHeader.getRelated("OrderItem"); Iterator oiit = orderItems.iterator(); while (oiit.hasNext()) { GenericValue orderItem = (GenericValue) oiit.next(); if (! "PRODUCT_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) continue; - + // Get the ordered quantity for the item BigDecimal orderItemQuantity = BigDecimal.ZERO; if (! UtilValidate.isEmpty(orderItem.get("quantity"))) { @@ -4680,7 +4680,7 @@ receivedQuantity = receivedQuantity.add(shipmentReceipt.getBigDecimal("quantityAccepted")); } } - + BigDecimal quantityToCancel = orderItemQuantity.subtract(orderItemCancelQuantity).subtract(receivedQuantity); if (quantityToCancel.compareTo(BigDecimal.ZERO) > 0) { Map cancelOrderItemResult = dispatcher.runSync("cancelOrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"), "cancelQuantity", quantityToCancel, "userLogin", userLogin)); @@ -4860,7 +4860,7 @@ public static Map getOrderItemInvoicedAmountAndQuantity(DispatchContext dctx, Map context) { GenericDelegator delegator = dctx.getDelegator(); Locale locale = (Locale) context.get("locale"); - + String orderId = (String) context.get("orderId"); String orderItemSeqId = (String) context.get("orderItemSeqId"); @@ -4882,7 +4882,7 @@ Debug.logError(errorMessage, module); return ServiceUtil.returnError(errorMessage); } - + BigDecimal orderItemsSubtotal = ZERO; // Aggregated value of order items, non-tax and non-shipping item-level adjustments BigDecimal invoicedTotal = ZERO; // Amount invoiced for the target order item BigDecimal itemAdjustments = ZERO; // Item-level tax- and shipping-adjustments @@ -4892,7 +4892,7 @@ Iterator oit = orderItems.iterator(); while (oit.hasNext()) { GenericValue orderItem = (GenericValue) oit.next(); - + // Look at the orderItemBillings to discover the amount and quantity ever invoiced for this order item List orderItemBillings = delegator.findByAnd("OrderItemBilling", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId"))); Iterator oibit = orderItemBillings.iterator(); @@ -4904,7 +4904,7 @@ // Add the item base amount to the subtotal orderItemsSubtotal = orderItemsSubtotal.add(quantity.multiply(amount)); - + // If the item is the target order item, add the invoiced quantity and amount to their respective totals if (orderItemSeqId.equals(orderItem.get("orderItemSeqId"))) { invoicedQuantity = invoicedQuantity.add(quantity); @@ -4918,7 +4918,7 @@ while (oait.hasNext()) { GenericValue orderAdjustment = (GenericValue) oait.next(); String orderAdjustmentTypeId = orderAdjustment.getString("orderAdjustmentTypeId"); - + // Look at the orderAdjustmentBillings to discove the amount ever invoiced for this order adjustment List orderAdjustmentBillings = delegator.findByAnd("OrderAdjustmentBilling", UtilMisc.toMap("orderAdjustmentId", orderAdjustment.get("orderAdjustmentId"))); Iterator oabit = orderAdjustmentBillings.iterator(); @@ -4926,10 +4926,10 @@ GenericValue orderAjustmentBilling = (GenericValue) oabit.next(); BigDecimal amount = orderAjustmentBilling.getBigDecimal("amount").setScale(orderDecimals, orderRounding); if (UtilValidate.isEmpty(amount)) continue; - + if ("SALES_TAX".equals(orderAdjustmentTypeId) || "SHIPPING_CHARGES".equals(orderAdjustmentTypeId)) { if (orderItemSeqId.equals(orderItem.get("orderItemSeqId"))) { - + // Add tax- and shipping-adjustment amounts to the total adjustments for the target order item itemAdjustments = itemAdjustments.add(amount); } @@ -4938,7 +4938,7 @@ // Add non-tax and non-shipping adjustment amounts to the order items subtotal orderItemsSubtotal = orderItemsSubtotal.add(amount); if (orderItemSeqId.equals(orderItem.get("orderItemSeqId"))) { - + // If the item is the target order item, add non-tax and non-shipping adjustment amounts to the invoiced total invoicedTotal = invoicedTotal.add(amount); } @@ -4986,7 +4986,7 @@ result.put("invoicedQuantity", invoicedQuantity.setScale(orderDecimals, orderRounding)); return result; } - + public static Map setOrderPaymentStatus(DispatchContext ctx, Map context) { LocalDispatcher dispatcher = ctx.getDispatcher(); GenericDelegator delegator = ctx.getDelegator(); @@ -5031,18 +5031,18 @@ Locale locale = (Locale) context.get("locale"); int count = 0; Map result = null; - + boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - + List exprs = UtilMisc.toList(EntityCondition.makeCondition("automaticExtend", EntityOperator.EQUALS, "Y"), EntityCondition.makeCondition("orderId", EntityOperator.NOT_EQUAL, null), EntityCondition.makeCondition("productId", EntityOperator.NOT_EQUAL, null)); EntityCondition cond = EntityCondition.makeCondition(exprs, EntityOperator.AND); EntityListIterator eli = null; eli = delegator.find("Subscription", cond, null, null, null, null); - + if (eli != null) { GenericValue subscription; while (((subscription = (GenericValue) eli.next()) != null)) { @@ -5066,18 +5066,18 @@ endDate.add(field, new Integer(subscription.getString("canclAutmExtTime")).intValue()); } - + Calendar endDateSubscription = Calendar.getInstance(); endDateSubscription.setTime(subscription.getTimestamp("thruDate")); - + if (endDate.before(endDateSubscription)) { // nor expired yet..... continue; } - + result = dispatcher.runSync("loadCartFromOrder", UtilMisc.toMap("orderId", subscription.get("orderId"), "userLogin", userLogin)); ShoppingCart cart = (ShoppingCart) result.get("shoppingCart"); - + // only keep the orderitem with the related product. List cartItems = cart.items(); Iterator ci = cartItems.iterator(); @@ -5087,16 +5087,16 @@ cart.removeCartItem(shoppingCartItem, dispatcher); } } - + CheckOutHelper helper = new CheckOutHelper(dispatcher, delegator, cart); - + // store the order Map createResp = helper.createOrder(userLogin); if (createResp != null && ServiceUtil.isError(createResp)) { Debug.logError("Cannot create order for shopping list - " + subscription, module); } else { String orderId = (String) createResp.get("orderId"); - + // authorize the payments Map payRes = null; try { @@ -5104,15 +5104,15 @@ } catch (GeneralException e) { Debug.logError(e, module); } - + if (payRes != null && ServiceUtil.isError(payRes)) { Debug.logError("Payment processing problems with shopping list - " + subscription, module); } - + // remove the automatic extension flag subscription.put("automaticExtend", "N"); subscription.store(); - + // send notification dispatcher.runAsync("sendOrderPayRetryNotification", UtilMisc.toMap("orderId", orderId)); count++; @@ -5120,7 +5120,7 @@ } eli.close(); } - + } catch (GenericServiceException e) { Debug.logError("Could call service to create cart", module); return ServiceUtil.returnError(e.toString()); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java Fri Mar 27 17:01:06 2009 @@ -132,7 +132,7 @@ public static Map storeQuote(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - + String quoteTypeId = (String) context.get("quoteTypeId"); String partyId = (String) context.get("partyId"); Timestamp issueDate = (Timestamp) context.get("issueDate"); @@ -167,15 +167,15 @@ if (userLogin != null) { quoteIn.put("userLogin", userLogin); } - - + + // create Quote Map quoteOut = dispatcher.runSync("createQuote", quoteIn); - + if (UtilValidate.isNotEmpty(quoteOut) && UtilValidate.isNotEmpty(quoteOut.get("quoteId"))) { String quoteId = (String)quoteOut.get("quoteId"); result.put("quoteId", quoteId); - + // create Quote Items if (UtilValidate.isNotEmpty(quoteItems)) { Iterator quoteIt = quoteItems.iterator(); @@ -184,11 +184,11 @@ quoteItem.set("quoteId", quoteId); Map quoteItemIn = quoteItem.getAllFields(); quoteItemIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteItem", quoteItemIn); } } - + // create Quote Attributes if (UtilValidate.isNotEmpty(quoteAttributes)) { Iterator quoteAttrIt = quoteAttributes.iterator(); @@ -197,11 +197,11 @@ quoteAttr.set("quoteId", quoteId); Map quoteAttrIn = quoteAttr.getAllFields(); quoteAttrIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteAttribute", quoteAttrIn); } } - + // create Quote Coefficients if (UtilValidate.isNotEmpty(quoteCoefficients)) { Iterator quoteCoefficientIt = quoteCoefficients.iterator(); @@ -210,11 +210,11 @@ quoteCoefficient.set("quoteId", quoteId); Map quoteCoefficientIn = quoteCoefficient.getAllFields(); quoteCoefficientIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteCoefficient", quoteCoefficientIn); } } - + // create Quote Roles if (UtilValidate.isNotEmpty(quoteRoles)) { Iterator quoteRoleIt = quoteRoles.iterator(); @@ -223,7 +223,7 @@ quoteRole.set("quoteId", quoteId); Map quoteRoleIn = quoteRole.getAllFields(); quoteRoleIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteRole", quoteRoleIn); } } @@ -236,11 +236,11 @@ quoteWorkEffort.set("quoteId", quoteId); Map quoteWorkEffortIn = quoteWorkEffort.getAllFields(); quoteWorkEffortIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteWorkEffort", quoteWorkEffortIn); } } - + // create Quote Adjustments if (UtilValidate.isNotEmpty(quoteAdjustments)) { Iterator quoteAdjustmentIt = quoteAdjustments.iterator(); @@ -249,11 +249,11 @@ quoteAdjustment.set("quoteId", quoteId); Map quoteAdjustmentIn = quoteAdjustment.getAllFields(); quoteAdjustmentIn.put("userLogin", userLogin); - + dispatcher.runSync("createQuoteAdjustment", quoteAdjustmentIn); } } - + //TODO create Quote Terms still to be implemented the base service createQuoteTerm //TODO create Quote Term Attributes still to be implemented the base service createQuoteTermAttribute } else { Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java Fri Mar 27 17:01:06 2009 @@ -77,7 +77,7 @@ } else { conditions.add( EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "SUPPLIER") ); } - + EntityConditionList<EntityCondition> ecl = EntityCondition.makeCondition(conditions, EntityOperator.AND); List requirementAndRoles = delegator.findList("RequirementAndRole", ecl, null, orderBy, null, false); Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartEventListener.java Fri Mar 27 17:01:06 2009 @@ -54,7 +54,7 @@ Debug.logInfo("No cart to save, doing nothing.", module); return; } - + String delegatorName = (String) session.getAttribute("delegatorName"); GenericDelegator delegator = null; if (UtilValidate.isNotEmpty(delegatorName)) { @@ -64,17 +64,17 @@ Debug.logError("Could not find delegator with delegatorName in session, not saving abandoned cart info.", module); return; } - + boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); - + GenericValue visit = VisitHandler.getVisit(session); if (visit == null) { Debug.logError("Could not get the current visit, not saving abandoned cart info.", module); return; } - + Debug.logInfo("Saving abandoned cart", module); Iterator cartItems = cart.iterator(); int seqId = 1; Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartItemModifyException.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartItemModifyException.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartItemModifyException.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CartItemModifyException.java Fri Mar 27 17:01:06 2009 @@ -36,7 +36,7 @@ public CartItemModifyException(Throwable nested) { super(nested); } - + public CartItemModifyException(String str, Throwable nested) { super(str, nested); } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Fri Mar 27 17:01:06 2009 @@ -74,7 +74,7 @@ if ("error".equals(CheckOutEvents.cartNotEmpty(request, response)) == true) { return "error"; } - + HttpSession session = request.getSession(); //Locale locale = UtilHttp.getLocale(request); @@ -98,7 +98,7 @@ cart.cleanUpShipGroups(); } CheckOutHelper checkOutHelper = new CheckOutHelper(dispatcher, delegator, cart); - + if ("shippingaddress".equals(curPage) == true) { // Set the shipping address options String shippingContactMechId = request.getParameter("shipping_contact_mech_id"); @@ -106,7 +106,7 @@ String taxAuthPartyGeoIds = request.getParameter("taxAuthPartyGeoIds"); String partyTaxId = request.getParameter("partyTaxId"); String isExempt = request.getParameter("isExempt"); - + List errorMessages = new ArrayList(); Map errorMaps = new HashMap(); for (int shipGroupIndex = 0; shipGroupIndex < cart.getShipGroupSize(); shipGroupIndex++) { @@ -134,7 +134,7 @@ return "error"; } } - + Map callResult = checkOutHelper.setCheckOutShippingAddress(shippingContactMechId); ServiceUtil.getMessages(request, callResult, null); @@ -154,7 +154,7 @@ String shipBeforeDate = request.getParameter("shipBeforeDate"); String shipAfterDate = request.getParameter("shipAfterDate"); Map callResult = ServiceUtil.returnSuccess(); - + for (int shipGroupIndex = 0; shipGroupIndex < cart.getShipGroupSize(); shipGroupIndex++) { callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, orderAdditionalEmails); ServiceUtil.getMessages(request, callResult, null); @@ -294,7 +294,7 @@ if (paymentMethods != null) { for (int i = 0; i < paymentMethods.length; i++) { Map paymentMethodInfo = FastMap.newInstance(); - + String securityCode = request.getParameter("securityCode_" + paymentMethods[i]); if (UtilValidate.isNotEmpty(securityCode)) { paymentMethodInfo.put("securityCode", securityCode); @@ -348,11 +348,11 @@ String shippingMethod = request.getParameter("shipping_method"); String shippingContactMechId = request.getParameter("shipping_contact_mech_id"); - + String taxAuthPartyGeoIds = request.getParameter("taxAuthPartyGeoIds"); String partyTaxId = request.getParameter("partyTaxId"); String isExempt = request.getParameter("isExempt"); - + String shippingInstructions = request.getParameter("shipping_instructions"); String orderAdditionalEmails = request.getParameter("order_additional_emails"); String maySplit = request.getParameter("may_split"); @@ -362,7 +362,7 @@ String shipBeforeDate = request.getParameter("shipBeforeDate"); String shipAfterDate = request.getParameter("shipAfterDate"); String cancelBackOrderDate = request.getParameter("cancelBackOrderDate"); - + List singleUsePayments = new ArrayList(); // get a request map of parameters @@ -383,7 +383,7 @@ return "error"; } } - + // check for gift card not on file Map gcResult = checkOutHelper.checkGiftCard(params, selectedPaymentMethods); ServiceUtil.getMessages(request, gcResult, null); @@ -482,7 +482,7 @@ } return productStore.getBoolean("explodeOrderItems").booleanValue(); } - + public static String checkShipmentNeeded(HttpServletRequest request, HttpServletResponse response) { GenericDelegator delegator = (GenericDelegator) request.getAttribute("delegator"); ShoppingCart cart = ShoppingCartEvents.getCartObject(request); @@ -492,7 +492,7 @@ } catch (GenericEntityException e) { Debug.logError(e, "Error getting ProductStore: " + e.toString(), module); } - + Debug.logInfo("checkShipmentNeeded: reqShipAddrForDigItems=" + productStore.getString("reqShipAddrForDigItems"), module); if (productStore != null && "N".equals(productStore.getString("reqShipAddrForDigItems"))) { Debug.logInfo("checkShipmentNeeded: cart.containOnlyDigitalGoods()=" + cart.containOnlyDigitalGoods(), module); @@ -501,7 +501,7 @@ return "shipmentNotNeeded"; } } - + return "shipmentNeeded"; } @@ -695,7 +695,7 @@ Debug.logError(e, module); } } - + // set the customer info if (mode != null && mode.equals("default")) { cart.setDefaultCheckoutOptions(dispatcher); @@ -780,7 +780,7 @@ shipBeforeDate = request.getParameter(shipGroupIndex + "_shipBeforeDate"); shipAfterDate = request.getParameter(shipGroupIndex + "_shipAfterDate"); cancelBackOrderDate = request.getParameter("cancelBackOrderDate"); - + callResult = checkOutHelper.finalizeOrderEntryOptions(shipGroupIndex, shippingMethod, shippingInstructions, maySplit, giftMessage, isGift, internalCode, shipBeforeDate, shipAfterDate, cancelBackOrderDate); ServiceUtil.addErrors(errorMessages, errorMaps, callResult); } @@ -851,7 +851,7 @@ selectedPaymentMethods.put(newPaymentMethodId, UtilMisc.toMap("amount", null, "securityCode", null)); } } - + // The selected payment methods are set errorMessages.addAll(checkOutHelper.setCheckOutPaymentInternal(selectedPaymentMethods, null, billingAccountId)); // Verify if a gift card has been selected during order entry @@ -943,7 +943,7 @@ shippingOptionsSet = false; } } - + String customerPartyId = cart.getPartyId(); String[] processOrder = {"customer", "shipping", "shipGroups", "options", "term", "payment", Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=759251&r1=759250&r2=759251&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java Fri Mar 27 17:01:06 2009 @@ -399,7 +399,7 @@ // set the shipping address errorMessages.addAll(setCheckOutShippingAddressInternal(shippingContactMechId)); - + // Recalc shipping costs before setting payment Map shipEstimateMap = ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0); BigDecimal shippingTotal = (BigDecimal) shipEstimateMap.get("shippingTotal"); @@ -483,7 +483,7 @@ gcFieldsOkay = false; } } - + if (UtilValidate.isNotEmpty(selectedPaymentMethods)) { if (gcAmt == null || gcAmt.length() == 0) { errMsg = UtilProperties.getMessage(resource_error,"checkhelper.enter_amount_to_place_on_gift_card", (cart != null ? cart.getLocale() : Locale.getDefault())); @@ -644,7 +644,7 @@ inputMap.put("orderItemSeqId", orderItem.getString("orderItemSeqId")); inputMap.put("quantity", orderItem.getBigDecimal("quantity")); inputMap.put("userLogin", permUserLogin); - + Map prunResult = dispatcher.runSync("createProductionRunFromConfiguration", inputMap); if (ServiceUtil.isError(prunResult)) { Debug.logError(ServiceUtil.getErrorMessage(prunResult) + " for input:" + inputMap, module); @@ -794,22 +794,22 @@ List shipAmt = new ArrayList(totalItems); // Debug.logInfo("====== makeTaxContext passed in shipAddress=" + shipAddress, module); - + Iterator it = csi.shipItemInfo.keySet().iterator(); for (int i = 0; i < totalItems; i++) { ShoppingCartItem cartItem = (ShoppingCartItem) 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()); shipAmt.add(i, BigDecimal.ZERO); // no per item shipping yet shoppingCartItemIndexMap.put(Integer.valueOf(i), cartItem); } - + //add promotion adjustments List allAdjustments = cart.getAdjustments(); BigDecimal orderPromoAmt = OrderReadHelper.calcOrderPromoAdjustmentsBd(allAdjustments); @@ -1055,7 +1055,7 @@ if (UtilValidate.isNotEmpty(cashCodPcBaPaymentPreferences) && UtilValidate.isNotEmpty(allPaymentPreferences) && cashCodPcBaPaymentPreferences.size() == allPaymentPreferences.size()) { - + //if there are Check type, approve the order only if it is face to face List checkPareferences = EntityUtil.filterByAnd(cashCodPcBaPaymentPreferences, UtilMisc.toMap("paymentMethodTypeId", "PERSONAL_CHECK")); if (UtilValidate.isNotEmpty(checkPareferences)) { @@ -1191,7 +1191,7 @@ String errMsg=null; String REJECT_MESSAGE = productStore.getString("authFraudMessage"); String orderId = this.cart.getOrderId(); - + try { if (userLogin != null) { // nuke the userlogin |
Free forum by Nabble | Edit this page |