|
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java Fri Jan 15 21:00:23 2010 @@ -86,7 +86,7 @@ // Used to maintain a weak reference to the ShoppingCart for customers who have gone to PayPal to checkout // so that we can quickly grab the cart, perform shipment estimates and send the info back to PayPal. // The weak key is a simple wrapper for the checkout token String and is stored as a cart attribute. The value - // is a weak reference to the ShoppingCart itself. Entries will be removed as carts are removed from the + // is a weak reference to the ShoppingCart itself. Entries will be removed as carts are removed from the // session (i.e. on cart clear or successful checkout) or when the session is destroyed private static Map<TokenWrapper, WeakReference<ShoppingCart>> tokenCartMap = new WeakHashMap<TokenWrapper, WeakReference<ShoppingCart>>(); @@ -878,7 +878,7 @@ // so until further testing proves we should do otherwise I'm just going to return requested void amount result.put("releaseAmount", context.get("releaseAmount")); result.put("releaseRefNum", decoder.get("AUTHORIZATIONID")); - } + } return result; } @@ -925,7 +925,7 @@ result.put("refundResult", true); result.put("refundAmount", new BigDecimal(decoder.get("GROSSREFUNDAMT"))); result.put("refundRefNum", decoder.get("REFUNDTRANSACTIONID")); - } + } return result; } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java Fri Jan 15 21:00:23 2010 @@ -43,19 +43,19 @@ import org.ofbiz.service.ServiceUtil; public class SagePayPaymentServices { - + public static final String module = SagePayPaymentServices.class.getName(); private static Map<String, String> buildCustomerBillingInfo(Map<String, Object> context) { - + Debug.logInfo("SagePay - Entered buildCustomerBillingInfo", module); Debug.logInfo("SagePay buildCustomerBillingInfo context : " + context, module); - + Map<String, String> billingInfo = FastMap.newInstance(); - + String orderId = null; BigDecimal processAmount = null; - String currency = null; + String currency = null; String cardNumber = null; String cardType = null; String nameOnCard = null; @@ -65,7 +65,7 @@ String address = null; try { - + GenericValue opp = (GenericValue) context.get("orderPaymentPreference"); if (opp != null) { if ("CREDIT_CARD".equals(opp.getString("paymentMethodTypeId"))) { @@ -136,14 +136,14 @@ billingInfo.put("cardNumber", cardNumber); billingInfo.put("cardHolder", nameOnCard); billingInfo.put("expiryDate", expireDate); - billingInfo.put("cardType", cardType); + billingInfo.put("cardType", cardType); billingInfo.put("cv2", securityCode); billingInfo.put("billingPostCode", postalCode); billingInfo.put("billingAddress", address); - + Debug.logInfo("SagePay billingInfo : " + billingInfo, module); Debug.logInfo("SagePay - Exiting buildCustomerBillingInfo", module); - + return billingInfo; } @@ -163,11 +163,11 @@ Debug.logInfo("SagePay - Exiting ccAuth", module); return response; } - + private static Map<String, Object> processCardAuthorisationPayment(DispatchContext ctx, Map<String, Object> context) { - - Map<String, Object> result = ServiceUtil.returnSuccess(); + + Map<String, Object> result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); Map<String, String> billingInfo = buildCustomerBillingInfo(context); @@ -175,7 +175,7 @@ try { - Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentAuthentication", + Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentAuthentication", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", billingInfo.get("orderId"), @@ -241,14 +241,14 @@ GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(orderPaymentPreference); context.put("authTransaction", authTransaction); Map<String, Object> response = processCardCapturePayment(ctx, context); - + Debug.logInfo("SagePay ccCapture response : " + response, module); Debug.logInfo("SagePay - Exiting ccCapture", module); - + return response; } - - + + private static Map<String, Object> processCardCapturePayment(DispatchContext ctx, Map<String, Object> context) { Map<String, Object> result = ServiceUtil.returnSuccess(); @@ -264,7 +264,7 @@ try { - Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentAuthorisation", + Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentAuthorisation", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", vendorTxCode, @@ -282,7 +282,7 @@ result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.TRUE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); } else { Debug.logInfo("SagePay - Invalid status " + status + " received for order : " + vendorTxCode, module); - result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.FALSE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); + result = SagePayUtil.buildCardCapturePaymentResponse(Boolean.FALSE, txAuthCode, securityKey, amount, vpsTxId, vendorTxCode, statusDetail); } } catch(GenericServiceException e) { Debug.logError(e, "Error in calling SagePayPaymentAuthorisation", module); @@ -290,7 +290,7 @@ } return result; } - + public static Map<String, Object> ccRefund(DispatchContext ctx, Map<String, Object> context) { Debug.logInfo("SagePay - Entered ccRefund", module); @@ -333,7 +333,7 @@ yesterday.add(Calendar.DAY_OF_YEAR, -1); Map<String, Object> response = null; - + if (authCal.before(yesterday)) { Debug.logInfo("SagePay - Calling Refund for Refund", module); response = processCardRefundPayment(ctx, context); @@ -350,14 +350,14 @@ response = processCardRefundPayment(ctx, context); } } - + Debug.logInfo("SagePay ccRefund response : " + response, module); return response; } private static Map<String, Object> processCardRefundPayment(DispatchContext ctx, Map<String, Object> context) { - Map<String, Object> result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -377,7 +377,7 @@ "currency", "GBP", "description", orderId, "relatedVPSTxId", captureTransaction.get("referenceNum"), - "relatedVendorTxCode", captureTransaction.get("altReference"), + "relatedVendorTxCode", captureTransaction.get("altReference"), "relatedSecurityKey", captureTransaction.get("gatewayFlag"), "relatedTxAuthNo", captureTransaction.get("gatewayCode") ) @@ -407,7 +407,7 @@ private static Map<String, Object> processCardVoidPayment(DispatchContext ctx, Map<String, Object> context) { - Map<String, Object> result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); @@ -416,8 +416,8 @@ String orderId = (String) captureTransaction.get("altReference"); try { - - Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentVoid", + + Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentVoid", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", captureTransaction.get("altReference"), @@ -426,7 +426,7 @@ "txAuthNo", captureTransaction.get("gatewayCode") ) ); - + Debug.logInfo("SagePay - SagePayPaymentVoid result : " + paymentResult, module); String status = (String) paymentResult.get("status"); @@ -457,7 +457,7 @@ Debug.logInfo("SagePay - Entered ccRelease", module); Debug.logInfo("SagePay ccRelease context : " + context, module); - + GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(orderPaymentPreference); @@ -473,20 +473,20 @@ private static Map<String, Object> processCardReleasePayment(DispatchContext ctx, Map<String, Object> context) { - Map<String, Object> result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); LocalDispatcher dispatcher = ctx.getDispatcher(); String paymentGatewayConfigId = (String) context.get("paymentGatewayConfigId"); BigDecimal amount = (BigDecimal) context.get("releaseAmount"); - + GenericValue authTransaction = (GenericValue) context.get("authTransaction"); String orderId = (String) authTransaction.get("altReference"); String refNum = (String) authTransaction.get("referenceNum"); - + try { - - Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentRelease", + + Map<String, Object> paymentResult = dispatcher.runSync("SagePayPaymentRelease", UtilMisc.toMap( "paymentGatewayConfigId", paymentGatewayConfigId, "vendorTxCode", orderId, @@ -498,7 +498,7 @@ ); Debug.logInfo("SagePay - SagePayPaymentRelease result : " + paymentResult, module); - + String status = (String) paymentResult.get("status"); String statusDetail = (String) paymentResult.get("statusDetail"); @@ -517,5 +517,5 @@ return result; } - + } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayServices.java Fri Jan 15 21:00:23 2010 @@ -74,7 +74,7 @@ { Debug.logInfo("SagePay - Entered paymentAuthentication", module); Debug.logInfo("SagePay paymentAuthentication context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map<String, Object> resultMap = new HashMap<String, Object>(); @@ -101,7 +101,7 @@ String billingPhone = (String) context.get("billingPhone"); Boolean isBillingSameAsDelivery = (Boolean) context.get("isBillingSameAsDelivery"); - + String deliverySurname = (String) context.get("deliverySurname"); String deliveryFirstnames = (String) context.get("deliveryFirstnames"); String deliveryAddress = (String) context.get("deliveryAddress"); @@ -116,7 +116,7 @@ String issueNumber = (String) context.get("issueNumber"); String basket = (String) context.get("basket"); String clientIPAddress = (String) context.get("clientIPAddress"); - + HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); @@ -152,7 +152,7 @@ if (billingState != null) { parameters.put("BillingState", billingState); } if (billingPhone != null) { parameters.put("BillingPhone", billingPhone); } //end - billing details - + //start - delivery details if (isBillingSameAsDelivery != null && isBillingSameAsDelivery) { if (billingSurname != null) { parameters.put("DeliverySurname", billingSurname); } @@ -188,7 +188,7 @@ //end - authentication parameters try { - + String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("authenticationUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); @@ -196,7 +196,7 @@ String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); @@ -277,7 +277,7 @@ Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -286,7 +286,7 @@ { Debug.logInfo("SagePay - Entered paymentAuthorisation", module); Debug.logInfo("SagePay paymentAuthorisation context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map<String, Object> resultMap = new HashMap<String, Object>(); @@ -300,7 +300,7 @@ HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); - + //start - authorization parameters Map<String, String> parameters = new HashMap<String, String>(); @@ -319,31 +319,31 @@ Debug.logInfo("authorization parameters -> " + parameters, module); //end - authorization parameters - + try { String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("authoriseUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); - + Map<String, String> responseData = SagePayUtil.getResponseData(response); String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); - + //start - payment refunded if ("OK".equals(status)) { successMessage = "Payment Released"; } //end - payment refunded - + //start - refund request not formed properly or parameters missing if ("MALFORMED".equals(status)) { successMessage = "Released request not formed properly or parameters missing"; } //end - refund request not formed properly or parameters missing - + //start - invalid information passed in parameters if ("INVALID".equals(status)) { successMessage = "Invalid information passed in parameters"; @@ -355,7 +355,7 @@ successMessage = "Problem at SagePay"; } //end - problem at Sagepay - + resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); @@ -375,7 +375,7 @@ Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -419,7 +419,7 @@ String successMessage = null; HttpPost httpPost = SagePayUtil.getHttpPost(props.get("releaseUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); - + Map<String, String> responseData = SagePayUtil.getResponseData(response); String status = responseData.get("Status"); @@ -454,7 +454,7 @@ resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); - + } catch(UnsupportedEncodingException uee) { //exception in encoding parameters in httpPost String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")"; @@ -471,7 +471,7 @@ Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -480,7 +480,7 @@ { Debug.logInfo("SagePay - Entered paymentVoid", module); Debug.logInfo("SagePay paymentVoid context : " + context, module); - + Delegator delegator = ctx.getDelegator(); Map<String, Object> resultMap = new HashMap<String, Object>(); @@ -493,7 +493,7 @@ HttpClient httpClient = SagePayUtil.getHttpClient(); HttpHost host = SagePayUtil.getHost(props); - + //start - void parameters Map<String, String> parameters = new HashMap<String, String>(); @@ -515,7 +515,7 @@ HttpPost httpPost = SagePayUtil.getHttpPost(props.get("voidUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); Map<String, String> responseData = SagePayUtil.getResponseData(response); - + String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); @@ -539,7 +539,7 @@ successMessage = "Invalid information passed in parameters"; } //end - invalid information passed in parameters - + //start - problem at Sagepay if ("ERROR".equals(status)) { successMessage = "Problem at SagePay"; @@ -548,7 +548,7 @@ resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); - + } catch(UnsupportedEncodingException uee) { //exception in encoding parameters in httpPost String errorMsg = "Error occured in encoding parameters for HttpPost (" + uee.getMessage() + ")"; @@ -565,7 +565,7 @@ Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; } @@ -579,12 +579,12 @@ Map<String, Object> resultMap = new HashMap<String, Object>(); Map<String, String> props = buildSagePayProperties(context, delegator); - + String vendorTxCode = (String)context.get("vendorTxCode"); String amount = (String)context.get("amount"); String currency = (String)context.get("currency"); String description = (String)context.get("description"); - + String relatedVPSTxId = (String) context.get("relatedVPSTxId"); String relatedVendorTxCode = (String) context.get("relatedVendorTxCode"); String relatedSecurityKey = (String) context.get("relatedSecurityKey"); @@ -618,12 +618,12 @@ HttpPost httpPost = SagePayUtil.getHttpPost(props.get("refundUrl"), parameters); HttpResponse response = httpClient.execute(host, httpPost); Map<String, String> responseData = SagePayUtil.getResponseData(response); - + Debug.logInfo("response data -> " + responseData, module); - + String status = responseData.get("Status"); String statusDetail = responseData.get("StatusDetail"); - + resultMap.put("status", status); resultMap.put("statusDetail", statusDetail); @@ -634,7 +634,7 @@ successMessage = "Payment Refunded"; } //end - payment refunded - + //start - refund not authorized by the acquiring bank if ("NOTAUTHED".equals(status)) { successMessage = "Refund not authorized by the acquiring bank"; @@ -652,13 +652,13 @@ successMessage = "Invalid information passed in parameters"; } //end - invalid information passed in parameters - + //start - problem at Sagepay if ("ERROR".equals(status)) { successMessage = "Problem at SagePay"; } //end - problem at Sagepay - + resultMap.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); resultMap.put(ModelService.SUCCESS_MESSAGE, successMessage); @@ -678,7 +678,7 @@ Debug.logError(ioe, errorMsg, module); resultMap = ServiceUtil.returnError(errorMsg); } finally { - httpClient.getConnectionManager().shutdown(); + httpClient.getConnectionManager().shutdown(); } return resultMap; Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayUtil.java Fri Jan 15 21:00:23 2010 @@ -53,7 +53,7 @@ public static Map<String, Object> buildCardAuthorisationPaymentResponse (Boolean authResult, String authCode, String authFlag, BigDecimal processAmount, String authRefNum, String authAltRefNum, String authMessage) { - + Map<String, Object> result = FastMap.newInstance(); if(authResult != null) { result.put("authResult", authResult); } if(authCode != null) { result.put("authCode", authCode); } @@ -64,7 +64,7 @@ if(authMessage != null) { result.put("authMessage", authMessage); } return result; } - + public static Map<String, Object> buildCardCapturePaymentResponse (Boolean captureResult, String captureCode, String captureFlag, BigDecimal captureAmount, String captureRefNum, String captureAltRefNum, String captureMessage) { @@ -81,7 +81,7 @@ public static Map<String, Object> buildCardReleasePaymentResponse (Boolean releaseResult, String releaseCode, BigDecimal releaseAmount, String releaseRefNum, String releaseAltRefNum, String releaseMessage) { - + Map<String, Object> result = FastMap.newInstance(); if(releaseResult != null) { result.put("releaseResult", releaseResult); } if(releaseCode != null) { result.put("releaseCode", releaseCode); } @@ -103,7 +103,7 @@ if(refundMessage != null) { result.put("refundMessage", refundMessage); } return result; } - + public static Map<String, Object> buildCardRefundPaymentResponse (Boolean refundResult, String refundCode, BigDecimal refundAmount, String refundRefNum, String refundAltRefNum, String refundMessage) { @@ -129,7 +129,7 @@ String port = hostUrl.substring(hostUrl.lastIndexOf(":")+1); return getHost(host, Integer.parseInt(port), scheme); } - + public static HttpHost getHost(String hostName, int port, String scheme) { HttpHost host = new HttpHost(hostName, port, scheme); return host; @@ -157,7 +157,7 @@ } public static HttpPost getHttpPost(String uri, Map<String, String> parameters) throws UnsupportedEncodingException { - + HttpPost httpPost = new HttpPost(uri); httpPost.addHeader("User-Agent", "HTTP Client"); httpPost.addHeader("Content-type", "application/x-www-form-urlencoded"); @@ -165,14 +165,14 @@ HttpParams params = new BasicHttpParams(); httpPost.setParams(params); - + List<NameValuePair> postParameters = new ArrayList<NameValuePair>(); Set<String> keys = parameters.keySet(); for (String key : keys) { String value = parameters.get(key); postParameters.add(new BasicNameValuePair(key, value)); } - + Debug.log("SagePay PostParameters - " + postParameters); HttpEntity postEntity = new UrlEncodedFormEntity(postParameters); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java Fri Jan 15 21:00:23 2010 @@ -57,7 +57,7 @@ public class PayflowPro { public static final String module = PayflowPro.class.getName(); - + /** * Authorize credit card payment service. Service wrapper around PayFlow Pro API. * @param dctx Service Engine DispatchContext. @@ -88,7 +88,7 @@ isPayPal = true; } - Map<String, String> data = FastMap.newInstance(); + Map<String, String> data = FastMap.newInstance(); boolean isReAuth = false; if (isPayPal) { @@ -155,7 +155,7 @@ data.put("AMT", processAmount.toString()); PayflowAPI pfp = init(delegator, paymentGatewayConfigId, configString, context); - + // get the base params StringBuilder params = makeBaseParams(delegator, paymentGatewayConfigId, configString); @@ -178,7 +178,7 @@ // Attach the avs info returned in doExpressCheckout and stored in PayPalPaymentMethod resp += "&AVSADDR=" + payPalPaymentMethod.getString("avsAddr") + "&AVSZIP=" + payPalPaymentMethod.getString("avsZip"); } - + // check the response Map<String, Object> result = ServiceUtil.returnSuccess(); parseAuthResponse(delegator, paymentGatewayConfigId, resp, result, configString, isReAuth, isPayPal); @@ -411,8 +411,8 @@ result.put("refundAmount", amount); return result; } - - + + public static Map<String, Object> setExpressCheckout(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); ShoppingCart cart = (ShoppingCart) context.get("cart"); @@ -420,7 +420,7 @@ GenericValue payPalPaymentSetting = ProductStoreWorker.getProductStorePaymentSetting(delegator, cart.getProductStoreId(), "EXT_PAYPAL", null, true); String paymentGatewayConfigId = payPalPaymentSetting.getString("paymentGatewayConfigId"); String configString = "payment.properties"; - + if (cart == null || cart.items().size() <= 0) { return ServiceUtil.returnError(UtilProperties.getMessage("AccountingErrorUiLabels", "AccountingPayPalShoppingCartIsEmpty", locale)); } @@ -436,7 +436,7 @@ } data.put("RETURNURL", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "returnUrl", configString, "payment.verisign.returnUrl")); data.put("CANCELURL", getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "cancelReturnUrl", configString, "payment.verisign.cancelReturnUrl")); - + try { addCartDetails(data, cart); } catch (GenericEntityException e) { @@ -523,7 +523,7 @@ parameterMap.put("SHIPTOCOUNTRY", StringUtils.left(countryGeo.getString("geoCode"), 2)); } } - + public static Map<String, Object> getExpressCheckout(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); @@ -564,7 +564,7 @@ Debug.logError("A problem occurred while requesting the checkout details from paypal: Result = " + responseMap.get("RESULT") + ", Message = " + responseMap.get("RESPMSG"), module); return ServiceUtil.returnError(UtilProperties.getMessage("AccountingErrorUiLabels", "AccountingPayPalCommunicationError", locale)); } - + Map<String, Object> inMap = FastMap.newInstance(); inMap.put("userLogin", cart.getUserLogin()); inMap.put("partyId", cart.getOrderPartyId()); @@ -584,10 +584,10 @@ return ServiceUtil.returnError(e.getMessage()); } String paymentMethodId = (String) outMap.get("paymentMethodId"); - + cart.clearPayments(); cart.addPaymentAmount(paymentMethodId, cart.getGrandTotal(), true); - + return ServiceUtil.returnSuccess(); } @@ -719,7 +719,7 @@ Debug.logError(e, "Unable to parse response code; not a number!", module); } - + result.put("authRefNum", parameters.get("PNREF")); if (codeInt == 0 && avsCheckOkay && cvv2CheckOkay) { @@ -754,7 +754,7 @@ private static void parseCaptureResponse(String resp, Map<String, Object> result) { Map<String, String> parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -782,7 +782,7 @@ private static void parseVoidResponse(String resp, Map<String, Object> result) { Map<String, String> parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -810,7 +810,7 @@ private static void parseRefundResponse(String resp, Map<String, Object> result) { Map<String, String> parameters = parseResponse(resp); - + String respCode = (String) parameters.get("RESULT"); int codeInt = -999; // custom response code -- not from payflow docs try { @@ -896,7 +896,7 @@ Integer loggingLevel = Integer.decode(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "loggingLevel", resource, "payment.verisign.loggingLevel", "6")); Integer maxLogFileSize = Integer.decode(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "maxLogFileSize", resource, "payment.verisign.maxLogFileSize", "1000000")); boolean stackTraceOn = "Y".equalsIgnoreCase(getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, "stackTraceOn", resource, "payment.verisign.stackTraceOn", "N")); - + PayflowAPI pfp = new PayflowAPI(hostAddress, hostPort.intValue(), timeout.intValue(), proxyAddress, proxyPort.intValue(), proxyLogon, proxyPassword); SDKProperties.setLogFileName(logFileName); @@ -905,7 +905,7 @@ SDKProperties.setStackTraceOn(stackTraceOn); return pfp; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; @@ -929,7 +929,7 @@ } return returnValue; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String defaultValue) { String returnValue = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName); @@ -938,11 +938,11 @@ } return returnValue; } - + private static boolean comparePaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String compareValue) { boolean returnValue = false; - + String value = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName, compareValue); if (UtilValidate.isNotEmpty(value)) { returnValue = value.trim().equalsIgnoreCase(compareValue); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java Fri Jan 15 21:00:23 2010 @@ -55,12 +55,12 @@ * WorldPay Select Junior Integration Events/Services */ public class WorldPayEvents { - + public static final String resource = "AccountingUiLabels"; public static final String resourceErr = "AccountingErrorUiLabels"; public static final String commonResource = "CommonUiLabels"; public static final String module = WorldPayEvents.class.getName(); - + public static String worldPayRequest(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); Delegator delegator = (Delegator) request.getAttribute("delegator"); @@ -307,7 +307,7 @@ } return "success"; } - + /** WorldPay notification */ public static String worldPayNotify(HttpServletRequest request, HttpServletResponse response) { Locale locale = UtilHttp.getLocale(request); @@ -408,7 +408,7 @@ } return "success"; } - + private static boolean setPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin, String orderId, HttpServletRequest request) { Debug.logVerbose("Setting payment preferences..", module); List<GenericValue> paymentPrefs = null; @@ -431,7 +431,7 @@ } return true; } - + private static boolean setPaymentPreference(LocalDispatcher dispatcher, GenericValue userLogin, GenericValue paymentPreference, HttpServletRequest request) { Locale locale = UtilHttp.getLocale(request); String paymentStatus = request.getParameter("transStatus"); @@ -474,7 +474,7 @@ response.set("transactionDate", authDate); response.set("gatewayAvsResult", avs); response.set("gatewayCvResult", avs.substring(0, 1)); - + toStore.add(response); try { delegator.storeAll(toStore); @@ -500,7 +500,7 @@ } return true; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName) { String returnValue = ""; @@ -524,7 +524,7 @@ } return returnValue; } - + private static String getPaymentGatewayConfigValue(Delegator delegator, String paymentGatewayConfigId, String paymentGatewayConfigParameterName, String resource, String parameterName, String defaultValue) { String returnValue = getPaymentGatewayConfigValue(delegator, paymentGatewayConfigId, paymentGatewayConfigParameterName, resource, parameterName); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Fri Jan 15 21:00:23 2010 @@ -261,7 +261,7 @@ public static boolean isExpenseAccount(GenericValue account) throws GenericEntityException { return isAccountClass(account, "EXPENSE"); } - + /** * Recurses up invoice type tree via parentTypeId to see if input invoice type ID is in tree. */ @@ -280,7 +280,7 @@ // otherwise, we have to go to the grandparent (recurse) return isInvoiceTypeRecurse(invoiceType.getRelatedOne("ParentInvoiceType"), inputTypeId); } - + /** * Checks if a invoice is of a specified InvoiceType.invoiceTypeId. Return false if invoice is null. It's better to use * more specific calls like isPurchaseInvoice(). Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/cms/CmsEvents.java Fri Jan 15 21:00:23 2010 @@ -186,14 +186,14 @@ // verify the request content is associated with the current website int statusCode=-1; boolean hasErrorPage=false; - + try { statusCode = verifyContentToWebSite(delegator, webSiteId, contentId); } catch (GeneralException e) { Debug.logError(e, module); throw new GeneralRuntimeException(e.getMessage(), e); } - + // We try to find a specific Error page for this website concerning the status code if (statusCode!=HttpServletResponseWrapper.SC_OK) { List<GenericValue> errorContainers = null; @@ -209,10 +209,10 @@ if (UtilValidate.isNotEmpty(errorContainers)) { if (Debug.verboseOn()) Debug.logVerbose("Found error containers: " + errorContainers, module); GenericValue errorContainer = EntityUtil.getFirst(errorContainers); - + List<GenericValue> errorPages = null; try { - errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey",""+statusCode)); + errorPages = delegator.findByAnd("ContentAssocViewTo", UtilMisc.toMap("contentIdStart", errorContainer.getString("contentId"), "caContentAssocTypeId", "TREE_CHILD", "contentTypeId", "DOCUMENT", "caMapKey",""+statusCode)); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -240,11 +240,11 @@ } } catch (GenericEntityException e) { Debug.logError(e, module); - } + } } } - + if (statusCode==HttpServletResponseWrapper.SC_OK || hasErrorPage) { // create the template map MapStack<String> templateMap = MapStack.create(); @@ -258,7 +258,7 @@ templateMap.put("_REQUEST_HANDLER_", rh); response.setStatus(statusCode); - + // NOTE DEJ20080817: this is done in the ContentMapFacade class now to avoid problems with the jsessionid being in the middle of the URL and such //String contextLinkPrefix = rh.makeLink(request, response, "", true, false, true); //templateMap.put("_CONTEXT_LINK_PREFIX_", contextLinkPrefix); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentMapFacade.java Fri Jan 15 21:00:23 2010 @@ -180,7 +180,7 @@ Debug.logWarning("This method [entrySet()] is not implemented in ContentMapFacade", module); return null; } - + public void setSortOrder(Object obj) { if (!(obj instanceof String)) { Debug.logWarning("sortOrder parameters must be a string", module); @@ -205,8 +205,8 @@ } this.statusFilter=(String) obj; this.subContent.setStatusFilter(obj); - } - + } + // implemented get method public Object get(Object obj) { if (!(obj instanceof String)) { @@ -264,9 +264,9 @@ } if (cache) { - subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); + subs = delegator.findByAndCache("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); } else { - subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); + subs = delegator.findByAnd("ContentAssocViewTo", expressions, UtilMisc.toList(this.sortOrder)); } } catch (GenericEntityException e) { Debug.logError(e, module); @@ -412,8 +412,8 @@ } class SubContent extends AbstractInfo { - private String sortOrder="-fromDate"; - private String statusFilter=""; + private String sortOrder="-fromDate"; + private String statusFilter=""; @Override public Object get(Object key) { if (!(key instanceof String)) { @@ -465,7 +465,7 @@ return; } this.statusFilter=(String) obj; - } + } } class MetaData extends AbstractInfo { Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Fri Jan 15 21:00:23 2010 @@ -182,7 +182,7 @@ public static void renderContentAsText(LocalDispatcher dispatcher, Delegator delegator, GenericValue content, Appendable out, Map<String,Object>templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException { // if the content has a service attached run the service - + String serviceName = content.getString("serviceName"); if (dispatcher != null && UtilValidate.isNotEmpty(serviceName)) { DispatchContext dctx = dispatcher.getDispatchContext(); Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java (original) +++ ofbiz/trunk/applications/content/src/org/ofbiz/content/survey/SurveyEvents.java Fri Jan 15 21:00:23 2010 @@ -36,7 +36,7 @@ public class SurveyEvents { public static final String module = SurveyEvents.class.getName(); - + public static String createSurveyResponseAndRestoreParameters(HttpServletRequest request, HttpServletResponse response) { // Call createSurveyResponse as an event, easier to setup and ensures parameter security ConfigXMLReader.Event createSurveyResponseEvent = new ConfigXMLReader.Event("service", null, "createSurveyResponse", true); Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Fri Jan 15 21:00:23 2010 @@ -896,7 +896,7 @@ } else { Map costMethodResult = dispatcher.runSync(customMethod.getString("customMethodName"), UtilMisc.toMap("productCostComponentCalc", productCostComponentCalc, "costComponentCalc", costComponentCalc, - "costComponentTypePrefix", "ACTUAL", + "costComponentTypePrefix", "ACTUAL", "baseCost", totalCost, "currencyUomId", (String)partyAccountingPreference.get("baseCurrencyUomId"), "userLogin", userLogin)); @@ -2280,7 +2280,7 @@ BigDecimal totalQuantity = (BigDecimal)components.get(componentProductId); componentQuantity = totalQuantity.add(componentQuantity); } - + // check if a bom exists List bomList = null; try { @@ -2309,7 +2309,7 @@ } catch (GenericEntityException e) { return ServiceUtil.returnError("try to create workeffort assoc"); } - + } else { components.put(componentProductId, componentQuantity); } @@ -2441,7 +2441,7 @@ String productionRunId = (String)resultService.get("productionRunId"); result.put("productionRunId", productionRunId); - + try { delegator.create("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunId, "orderId", orderId, "orderItemSeqId", orderItemSeqId)); } catch (GenericEntityException e) { Modified: ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java (original) +++ ofbiz/trunk/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Fri Jan 15 21:00:23 2010 @@ -112,7 +112,7 @@ serviceCtx.put("address1", workAddress.getStreet()); serviceCtx.put("city", workAddress.getCity()); serviceCtx.put("postalCode", workAddress.getPostalCode()); - + List<GenericValue> countryGeoList = null; List<GenericValue> stateGeoList = null; EntityCondition cond = EntityCondition.makeCondition(UtilMisc.toList( @@ -175,16 +175,16 @@ } } } - OrganizationalIdentity oid = contact.getOrganizationalIdentity(); + OrganizationalIdentity oid = contact.getOrganizationalIdentity(); // Useful when creating a contact with more than OOTB - if (!isGroup) { + if (!isGroup) { serviceCtx.put("personalTitle", oid.getTitle()); } // Needed when creating an account (a PartyGroup) if (isGroup) { //serviceCtx.put("partyRole", oid.getRole()); // not used yet,maybe useful later - if (oid.hasOrganization()) { + if (oid.hasOrganization()) { Organization org = oid.getOrganization(); serviceCtx.put("groupName", org.getName()); } @@ -232,7 +232,7 @@ address.setStreet(postalAddress.getString("address1")); address.setCity(postalAddress.getString("city")); - address.setPostalCode(postalAddress.getString("postalCode")); + address.setPostalCode(postalAddress.getString("postalCode")); GenericValue state = postalAddress.getRelatedOne("StateProvinceGeo"); if (UtilValidate.isNotEmpty(state)) { address.setRegion(state.getString("geoName")); 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -96,17 +96,17 @@ return "success"; } - + public static String cancelSelectedOrderItems(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); Delegator delegator = (Delegator) request.getAttribute("delegator"); HttpSession session = request.getSession(); GenericValue userLogin = (GenericValue) session.getAttribute("userLogin"); - + Map resultMap = FastMap.newInstance(); String orderId = request.getParameter("orderId"); String[] orderItemSeqIds = request.getParameterValues("selectedItem"); - + if (orderItemSeqIds != null) { for (String orderItemSeqId : orderItemSeqIds) { try { @@ -115,7 +115,7 @@ for (GenericValue orderItemShipGroupAssoc : orderItemShipGroupAssocs) { GenericValue orderItemShipGroup = orderItemShipGroupAssoc.getRelatedOne("OrderItemShipGroup"); String shipGroupSeqId = orderItemShipGroup.getString("shipGroupSeqId"); - + Map contextMap = FastMap.newInstance(); contextMap.put("orderId", orderId); contextMap.put("orderItemSeqId", orderItemSeqId); @@ -123,14 +123,14 @@ contextMap.put("userLogin", userLogin); try { resultMap = dispatcher.runSync("cancelOrderItem", contextMap); - + if (ServiceUtil.isError(resultMap)) { String errorMessage = (String) resultMap.get("errorMessage"); Debug.logError(errorMessage, module); request.setAttribute("_ERROR_MESSAGE_", errorMessage); return "error"; } - + } catch (GenericServiceException e) { Debug.logError(e, module); request.setAttribute("_ERROR_MESSAGE_", resultMap.get("errorMessage")); @@ -142,7 +142,7 @@ return "error"; } } - return "success"; + return "success"; } else { request.setAttribute("_ERROR_MESSAGE_", "No order item selected. Please select an order item to cancel"); return "error"; 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -216,7 +216,7 @@ if (facilityId != null) { allConditions.add(EntityCondition.makeCondition("originFacilityId", EntityOperator.EQUALS, facilityId)); } - + if (filterDate != null) { List andExprs = new ArrayList(); andExprs.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, UtilDateTime.getDayStart(filterDate))); 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -306,7 +306,7 @@ public static Map sendReturnCancelNotification(DispatchContext dctx, Map context) { return sendReturnNotificationScreen(dctx, context, "PRDS_RTN_CANCEL"); } - + // cancel replacement order if return not received within 30 days and send notification public static Map<String,Object> autoCancelReplacementOrders(DispatchContext dctx, Map<String, ? extends Object> context) { Delegator delegator = dctx.getDelegator(); @@ -315,7 +315,7 @@ List<GenericValue> returnHeaders = null; try { returnHeaders = delegator.findList("ReturnHeader", EntityCondition.makeCondition( - EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "RETURN_ACCEPTED"), EntityOperator.AND, + EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "RETURN_ACCEPTED"), EntityOperator.AND, EntityCondition.makeCondition("returnHeaderTypeId", EntityOperator.EQUALS, "CUSTOMER_RETURN")), null, UtilMisc.toList("entryDate"), null, false); } catch (GenericEntityException e) { Debug.logError(e, "Problem getting Return headers", module); @@ -339,7 +339,7 @@ if (cancelDate.equals(nowDate) || nowDate.after(cancelDate)) { try { List<GenericValue> returnItems = delegator.findList("ReturnItem", EntityCondition.makeCondition( - EntityCondition.makeCondition("returnId", EntityOperator.EQUALS, returnId), EntityOperator.AND, + EntityCondition.makeCondition("returnId", EntityOperator.EQUALS, returnId), EntityOperator.AND, EntityCondition.makeCondition("returnTypeId", EntityOperator.EQUALS, "RTN_WAIT_REPLACE_RES")), null, UtilMisc.toList("createdStamp"), null, false); for (GenericValue returnItem : returnItems) { GenericValue returnItemResponse = returnItem.getRelatedOne("ReturnItemResponse"); @@ -969,7 +969,7 @@ return ServiceUtil.returnSuccess(); } - + /** * Helper method to get billing account balance, cannot use BillingAccountWorker.getBillingAccountBalance() * due to circular build dependency. @@ -1094,7 +1094,7 @@ GenericValue userLogin = (GenericValue) context.get("userLogin"); String orderId = (String) context.get("orderId"); Map serviceResult = FastMap.newInstance(); - + GenericValue orderHeader = null; List<GenericValue> orderPayPrefs = FastList.newInstance(); try { @@ -1104,7 +1104,7 @@ Debug.logError("Problem looking up order information for orderId #" + orderId, module); ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderCannotGetOrderHeader", locale)); } - + // Check for replacement order if (UtilValidate.isEmpty(orderPayPrefs)) { List<GenericValue> returnItemResponses = FastList.newInstance(); @@ -1114,7 +1114,7 @@ Debug.logError("Problem getting ReturnItemResponses", module); ServiceUtil.returnError(e.getMessage()); } - + for (GenericValue returnItemResponse : returnItemResponses) { GenericValue returnItem = null; GenericValue returnHeader = null; @@ -1125,7 +1125,7 @@ Debug.logError("Problem getting ReturnItem", module); ServiceUtil.returnError(e.getMessage()); } - + if ("RETURN_RECEIVED".equals(returnHeader.getString("statusId"))) { String returnId = returnItem.getString("returnId"); String returnTypeId = returnItem.getString("returnTypeId"); @@ -1204,7 +1204,7 @@ List exprs = UtilMisc.toList(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_SETTLED"), EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "PAYMENT_RECEIVED")); orderPayPrefs = EntityUtil.filterByOr(orderPayPrefs, exprs); - + // Check for replacement order if (UtilValidate.isEmpty(orderPayPrefs)) { List<GenericValue> orderItemAssocs = delegator.findByAnd("OrderItemAssoc", UtilMisc.toMap("toOrderId", orderId, "orderItemAssocTypeId", "REPLACEMENT")); @@ -1255,10 +1255,10 @@ // We break the OPPs down this way because we need to process the refunds to payment methods in a particular order Map receivedPaymentTotalsByPaymentMethod = orderReadHelper.getReceivedPaymentTotalsByPaymentMethod() ; Map refundedTotalsByPaymentMethod = orderReadHelper.getReturnedTotalsByPaymentMethod() ; - - // getOrderPaymentPreferenceTotalByType has been called because getReceivedPaymentTotalsByPaymentMethod does not + + // getOrderPaymentPreferenceTotalByType has been called because getReceivedPaymentTotalsByPaymentMethod does not // return payments captured from Billing Account.This is because when payment is captured from Billing Account - // then no entry is maintained in Payment entity. + // then no entry is maintained in Payment entity. BigDecimal receivedPaymentTotalsByBillingAccount = orderReadHelper.getOrderPaymentPreferenceTotalByType("EXT_BILLACT"); /* @@ -1278,7 +1278,7 @@ if (receivedPaymentTotalsByPaymentMethod.containsKey(orderPayPrefKey)) { orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add((BigDecimal)receivedPaymentTotalsByPaymentMethod.get(orderPayPrefKey)).setScale(decimals, rounding); } - + if (receivedPaymentTotalsByBillingAccount != null) { orderPayPrefReceivedTotal = orderPayPrefReceivedTotal.add(receivedPaymentTotalsByBillingAccount); } @@ -1306,7 +1306,7 @@ // This can be extended to support additional electronic types List electronicTypes = UtilMisc.toList("CREDIT_CARD", "EFT_ACCOUNT", "FIN_ACCOUNT", "GIFT_CARD"); - + // Figure out if EXT_PAYPAL should be considered as an electronic type if (productStore != null) { ExpressCheckoutEvents.CheckoutType payPalType = ExpressCheckoutEvents.determineCheckoutType(delegator, productStore.getString("productStoreId")); @@ -1433,7 +1433,7 @@ Iterator itemsIter = items.iterator(); while (itemsIter.hasNext()) { GenericValue item = (GenericValue) itemsIter.next(); - + Map returnItemMap = UtilMisc.toMap("returnItemResponseId", responseId, "returnId", item.get("returnId"), "returnItemSeqId", item.get("returnItemSeqId"), "statusId", returnItemStatusId, "userLogin", userLogin); //Debug.log("Updating item status", module); try { @@ -2074,7 +2074,7 @@ } if (ServiceUtil.isError(serviceResult)) { return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult)); - } + } } else { OrderChangeHelper.approveOrder(dispatcher, userLogin, createdOrderId); } 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -933,7 +933,7 @@ toBeStored.add(productPromoUse); } } - + // store the orderProductPromoCodes Set orderProductPromoCodes = (Set) context.get("orderProductPromoCodes"); if (UtilValidate.isNotEmpty(orderProductPromoCodes)) { @@ -3191,7 +3191,7 @@ GenericValue userLogin = (GenericValue) context.get("userLogin"); String orderId = (String) context.get("orderId"); Locale locale = (Locale) context.get("locale"); - + OrderReadHelper orh = null; try { orh = new OrderReadHelper(delegator, orderId); @@ -3323,12 +3323,12 @@ } else { throw new CartItemModifyException("No supplier information found for product [" + productId + "] and quantity quantity [" + quantity + "], cannot add to cart."); } - + if (basePrice != null) { item.setBasePrice(basePrice); item.setIsModifiedPrice(true); } - + cart.setItemShipGroupQty(item, item.getQuantity(), shipGroupIdx); } else { ShoppingCartItem item = ShoppingCartItem.makeItem(null, productId, null, quantity, null, null, null, null, null, null, null, null, prodCatalogId, null, null, null, dispatcher, cart, null, null, null, Boolean.FALSE, Boolean.FALSE); @@ -3565,7 +3565,7 @@ // run promotions to handle all changes in the cart ProductPromoWorker.doPromotions(cart, dispatcher); - + // log an order note try { dispatcher.runSync("createOrderNote", UtilMisc.<String, Object>toMap("orderId", orderId, "note", "Updated order.", "internalNote", "Y", "userLogin", userLogin)); @@ -3837,7 +3837,7 @@ toStore.addAll(cart.makeOrderItems()); toStore.addAll(cart.makeAllAdjustments()); - + String shipGroupSeqId = null; long groupIndex = cart.getShipInfoSize(); List orderAdjustments = new ArrayList(); @@ -3863,7 +3863,7 @@ } for (GenericValue toAdd: (List<GenericValue>)toAddList) { if ("OrderAdjustment".equals(toAdd.getEntityName())) { - if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && (("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId"))) || + if (toAdd.get("comments") != null && ((String)toAdd.get("comments")).startsWith("Added manually by") && (("PROMOTION_ADJUSTMENT".equals(toAdd.get("orderAdjustmentTypeId"))) || ("SHIPPING_CHARGES".equals(toAdd.get("orderAdjustmentTypeId"))) || ("SALES_TAX".equals(toAdd.get("orderAdjustmentTypeId"))))) { toStore.add(toAdd); } @@ -5304,7 +5304,7 @@ LocalDispatcher dispatcher = dctx.getDispatcher(); // All orders with an entryDate > orderEntryFromDateTime will be processed Timestamp orderEntryFromDateTime = (Timestamp) context.get("orderEntryFromDateTime"); - // If true all orders ever created will be processed and any pre-existing ALSO_BOUGHT ProductAssocs will be expired + // If true all orders ever created will be processed and any pre-existing ALSO_BOUGHT ProductAssocs will be expired boolean processAllOrders = context.get("processAllOrders") == null ? false : (Boolean) context.get("processAllOrders"); if (orderEntryFromDateTime == null && !processAllOrders) { // No from date supplied, check to see when this service last ran and use the startDateTime @@ -5368,14 +5368,14 @@ } return ServiceUtil.returnSuccess(); } - + public static Map<String, Object> createAlsoBoughtProductAssocsForOrder(DispatchContext dctx, Map context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); String orderId = (String) context.get("orderId"); OrderReadHelper orh = new OrderReadHelper(delegator, orderId); List<GenericValue> orderItems = orh.getOrderItems(); - // In order to improve efficiency a little bit, we will always create the ProductAssoc records + // In order to improve efficiency a little bit, we will always create the ProductAssoc records // with productId < productIdTo when the two are compared. This way when checking for an existing // record we don't have to check both possible combinations of productIds TreeSet<String> productIdSet = new TreeSet<String>(); @@ -5436,7 +5436,7 @@ } } } - + return ServiceUtil.returnSuccess(); } } 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -269,8 +269,8 @@ GenericValue item = (GenericValue) iter.next(); GenericValue product = item.getRelatedOne("Product"); if (product == null) continue; - - if (!("PRODRQM_ATP".equals(product.get("requirementMethodEnumId")) || + + if (!("PRODRQM_ATP".equals(product.get("requirementMethodEnumId")) || ("PRODRQM_ATP".equals(productStore.get("requirementMethodEnumId")) && product.get("requirementMethodEnumId") == null))) continue; BigDecimal quantity = item.getBigDecimal("quantity"); 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=899812&r1=899811&r2=899812&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 Jan 15 21:00:23 2010 @@ -1145,7 +1145,7 @@ Debug.logError(e.getMessage(), module); } } - + String result = createOrder(request, response); if ("error".equals(result)) { return "error"; Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Fri Jan 15 21:00:23 2010 @@ -829,7 +829,7 @@ return null; } return (ShoppingCartItem) cartLines.get(index); - + } public ShoppingCartItem findCartItem(String orderItemSeqId) { @@ -1977,8 +1977,8 @@ CartShipInfo csi = this.getShipInfo(i); csi.shipItemInfo.remove(item); } - - // DEJ20100107: commenting this out because we do NOT want to clear out ship group info since there is information there that will be lost; good enough to clear the item/group association which can be restored later (though questionable, the whole processes using this should be rewritten to not destroy information! + + // DEJ20100107: commenting this out because we do NOT want to clear out ship group info since there is information there that will be lost; good enough to clear the item/group association which can be restored later (though questionable, the whole processes using this should be rewritten to not destroy information! // this.cleanUpShipGroups(); } @@ -2037,15 +2037,15 @@ if (quantity.compareTo(item.getQuantity()) > 0) { quantity = item.getQuantity(); } - + // re-set the ship group's before and after dates based on the item's csi.resetShipBeforeDateIfAfter(item.getShipBeforeDate()); csi.resetShipAfterDateIfBefore(item.getShipAfterDate()); - + CartShipInfo.CartShipItemInfo csii = csi.setItemInfo(item, quantity); this.checkShipItemInfo(csi, csii); - } + } } } @@ -3166,7 +3166,7 @@ */ public String addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher) { if (this.productPromoCodes.contains(productPromoCodeId)) { - return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); + return UtilProperties.getMessage(resource_error, "productpromoworker.promotion_code_already_been_entered", UtilMisc.toMap("productPromoCodeId", productPromoCodeId), locale); } // if the promo code requires it make sure the code is valid String checkResult = ProductPromoWorker.checkCanUsePromoCode(productPromoCodeId, this.getPartyId(), this.getDelegator(), locale); @@ -3807,7 +3807,7 @@ } return groups; } - + public int getShipInfoSize() { return this.shipInfo.size(); } @@ -4307,19 +4307,19 @@ public Timestamp shipAfterDate = null; private String shipGroupSeqId = null; public String vendorPartyId = null; - + public CartShipInfo() { // Debug.logInfo(new Exception(), "Created a new CartShipInfo", module); } public String getOrderTypeId() { return orderTypeId; } - + public String getContactMechId() { return internalContactMechId; } public void setContactMechId(String contactMechId) { this.internalContactMechId = contactMechId; // Debug.logInfo(new Exception(), "Set CartShipInfo.contactMechId=" + this.internalContactMechId, module); } - + public String getCarrierPartyId() { return carrierPartyId; } public String getSupplierPartyId() { return supplierPartyId; } public String getShipmentMethodTypeId() { return shipmentMethodTypeId; } @@ -4330,24 +4330,24 @@ this.shipGroupSeqId = shipGroupSeqId; // Debug.logInfo(new Exception(), "============= On CartShipInfo shipGroupSeqId to " + this.shipGroupSeqId, module); } - + public String getFacilityId() { return facilityId; } public void setFacilityId(String facilityId) { this.facilityId = facilityId; // Debug.logInfo(new Exception(), "============= On CartShipInfo setFacilityId to " + this.facilityId, module); } - + public String getVendorPartyId() { return vendorPartyId;} public void setVendorPartyId(String vendorPartyId) { this.vendorPartyId = vendorPartyId; } - + public void setMaySplit(Boolean maySplit) { if (UtilValidate.isNotEmpty(maySplit)) { this.maySplit = maySplit.booleanValue() ? "Y" : "N"; } } - + public List makeItemShipGroupAndAssoc(Delegator delegator, ShoppingCart cart, long groupIndex) { shipGroupSeqId = UtilFormatOut.formatPaddedNumber(groupIndex, 5); @@ -4375,7 +4375,7 @@ shipGroup.set("shipGroupSeqId", shipGroupSeqId); shipGroup.set("vendorPartyId", vendorPartyId); shipGroup.set("facilityId", facilityId); - + // Debug.logInfo("=================Creating ship group value: " + shipGroup, module); // use the cart's default ship before and after dates here Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Fri Jan 15 21:00:23 2010 @@ -1195,14 +1195,14 @@ request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderOrderTermTypeIsRequired", locale)); return "error"; } - + try { termType = delegator.findOne("TermType", UtilMisc.toMap("termTypeId", termTypeId), false); } catch (GenericEntityException gee) { request.setAttribute("_ERROR_MESSAGE_", gee.getMessage()); return "error"; } - + if (("FIN_PAYMENT_TERM".equals(termTypeId) && UtilValidate.isEmpty(termDaysStr)) || (UtilValidate.isNotEmpty(termType) && "FIN_PAYMENT_TERM".equals(termType.get("parentTypeId")) && UtilValidate.isEmpty(termDaysStr))) { request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error, "OrderOrderTermDaysIsRequired", locale)); return "error"; @@ -1356,15 +1356,15 @@ shipGroupSeqId = UtilFormatOut.formatPaddedNumber(1, 5); List<GenericValue> duplicateAdjustmentList = new ArrayList<GenericValue>(); for (GenericValue adjustment: (List<GenericValue>)orderAdjustmentList) { - if ("PROMOTION_ADJUSTMENT".equals(adjustment.get("orderAdjustmentTypeId"))) { + if ("PROMOTION_ADJUSTMENT".equals(adjustment.get("orderAdjustmentTypeId"))) { cart.addAdjustment(adjustment); } if ("SALES_TAX".equals(adjustment.get("orderAdjustmentTypeId"))) { - if (adjustment.get("description") != null + if (adjustment.get("description") != null && ((String)adjustment.get("description")).startsWith("Tax adjustment due")) { cart.addAdjustment(adjustment); } - if ( adjustment.get("comments") != null + if ( adjustment.get("comments") != null && ((String)adjustment.get("comments")).startsWith("Added manually by")) { cart.addAdjustment(adjustment); } @@ -1392,9 +1392,9 @@ session.setAttribute("productStoreId", cart.getProductStoreId()); session.setAttribute("orderMode", cart.getOrderType()); session.setAttribute("orderPartyId", cart.getOrderPartyId()); - + // Since we only need the cart items, so set the order id as null - cart.setOrderId(null); + cart.setOrderId(null); return "success"; } Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Fri Jan 15 21:00:23 2010 @@ -723,7 +723,7 @@ this.itemType = "PRODUCT_ORDER_ITEM"; } } else { - // NOTE DEJ20100111: it seems safe to assume here that because a product is passed in that even if the product has no type this type of item still applies; thanks to whoever wrote the previous code, that's a couple of hours tracking this down that I wouldn't have minded doing something else with... :) + // NOTE DEJ20100111: it seems safe to assume here that because a product is passed in that even if the product has no type this type of item still applies; thanks to whoever wrote the previous code, that's a couple of hours tracking this down that I wouldn't have minded doing something else with... :) this.itemType = "PRODUCT_ORDER_ITEM"; } } else { Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Fri Jan 15 21:00:23 2010 @@ -302,23 +302,23 @@ List<GenericValue> orderItemShipGroupList = orh.getOrderItemShipGroups(); for (GenericValue orderItemShipGroup: orderItemShipGroupList) { // Debug.logInfo("===================== Load order: orderItemShipGroup=" + orderItemShipGroup, module); - + // 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"); @@ -343,7 +343,7 @@ // get product Id String productId = item.getString("productId"); GenericValue product = null; - // creates survey responses for Gift cards same as last Order created + // creates survey responses for Gift cards same as last Order created Map surveyResponseResult = null; try { product = delegator.findOne("Product", UtilMisc.toMap("productId", productId), false); @@ -360,7 +360,7 @@ surveyResponseMap.put("surveyId", surveyId); surveyResponseResult = dispatcher.runSync("createSurveyResponse", surveyResponseMap); } - } + } } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -473,7 +473,7 @@ // flag the item w/ the orderItemSeqId so we can reference it ShoppingCartItem cartItem = cart.findCartItem(itemIndex); cartItem.setOrderItemSeqId(item.getString("orderItemSeqId")); - + // attach surveyResponseId for each item if (UtilValidate.isNotEmpty(surveyResponseResult)){ cartItem.setAttribute("surveyResponseId",surveyResponseResult.get("surveyResponseId")); @@ -534,7 +534,7 @@ } } } - + // setup the OrderItemShipGroupAssoc records if (UtilValidate.isNotEmpty(orderItems)) { int itemIndex = 0; @@ -548,7 +548,7 @@ if (shipGroupQty == null) { shipGroupQty = BigDecimal.ZERO; } - + String cartShipGroupIndexStr = sgAssoc.getString("shipGroupSeqId"); int cartShipGroupIndex = NumberUtils.toInt(cartShipGroupIndexStr); @@ -556,7 +556,7 @@ if (cartShipGroupIndex > 0) { cart.positionItemToGroup(itemIndex, shipGroupQty, 0, cartShipGroupIndex, false); } - + cart.setItemShipGroupQty(itemIndex, shipGroupQty, cartShipGroupIndex); } itemIndex ++; Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=899812&r1=899811&r2=899812&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Fri Jan 15 21:00:23 2010 @@ -842,11 +842,11 @@ if (UtilValidate.isNotEmpty(condValue)) { BigDecimal amountNeeded = new BigDecimal(condValue); BigDecimal amountAvailable = BigDecimal.ZERO; - + // Debug.logInfo("Doing Amount Not Counted Cond with Value: " + amountNeeded, module); - + Set productIds = ProductPromoWorker.getPromoRuleCondProductIds(productPromoCond, delegator, nowTimestamp); - + List lineOrderedByBasePriceList = cart.getLineListOrderedByBasePrice(false); Iterator lineOrderedByBasePriceIter = lineOrderedByBasePriceList.iterator(); while (lineOrderedByBasePriceIter.hasNext()) { @@ -857,14 +857,14 @@ if (!cartItem.getIsPromo() && (productIds.contains(cartItem.getProductId()) || (parentProductId != null && productIds.contains(parentProductId))) && (product == null || !"N".equals(product.getString("includeInPromotions")))) { - + // just count the entire sub-total of the item amountAvailable = amountAvailable.add(cartItem.getItemSubTotal()); } } - + // 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)) { @@ -1136,7 +1136,7 @@ } catch (RecurrenceInfoException e) { Debug.logError(e, module); } - + // check the current recurrence if (recurrence != null) { if (recurrence.isValidCurrent()) { |
| Free forum by Nabble | Edit this page |
