Author: ashish
Date: Sat Apr 17 04:49:07 2010 New Revision: 935123 URL: http://svn.apache.org/viewvc?rev=935123&view=rev Log: Applied patch from jira issue - OFBIZ-3706 - updateOrderPaymentPreference service should not be dependent on flag cancelThis to cancel status of OrderPaymentPreference record. Thanks Divesh & Pranay for the contribution. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml ofbiz/trunk/applications/order/servicedef/services.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?rev=935123&r1=935122&r2=935123&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Sat Apr 17 04:49:07 2010 @@ -221,7 +221,7 @@ under the License. <get-related-one value-field="payment" relation-name="OrderPaymentPreference" to-value-field="orderPaymentPreference"/> <if-not-empty field="orderPaymentPreference"> <set field="updateOrderPaymentPreferenceMap.orderPaymentPreferenceId" from-field="orderPaymentPreference.orderPaymentPreferenceId"/> - <set field="updateOrderPaymentPreferenceMap.cancelThis" value="true"/> + <set field="updateOrderPaymentPreferenceMap.statusId" value="PAYMENT_CANCELLED"/> <call-service service-name="updateOrderPaymentPreference" in-map-name="updateOrderPaymentPreferenceMap"/> </if-not-empty> </if-compare> Modified: ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=935123&r1=935122&r2=935123&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services.xml Sat Apr 17 04:49:07 2010 @@ -366,7 +366,6 @@ under the License. <auto-attributes mode="INOUT" include="pk" optional="false"/> <auto-attributes mode="IN" include="nonpk" optional="true"/> <attribute name="checkOutPaymentId" type="String" mode="IN" optional="true"/> - <attribute name="cancelThis" type="String" mode="IN" optional="true"/> </service> <service name="checkOrderItemStatus" engine="java" 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=935123&r1=935122&r2=935123&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 Sat Apr 17 04:49:07 2010 @@ -4620,7 +4620,7 @@ public class OrderServices { String orderPaymentPreferenceId = (String) context.get("orderPaymentPreferenceId"); String checkOutPaymentId = (String) context.get("checkOutPaymentId"); - boolean cancelThis = ("true".equals((String) context.get("cancelThis"))); + String statusId = (String) context.get("statusId"); try { GenericValue opp = delegator.findByPrimaryKey("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId)); String paymentMethodId = null; @@ -4645,7 +4645,7 @@ public class OrderServices { } Map results = ServiceUtil.returnSuccess(); - if (cancelThis) { + if (UtilValidate.isNotEmpty(statusId) && statusId.equalsIgnoreCase("PAYMENT_CANCELLED")) { opp.set("statusId", "PAYMENT_CANCELLED"); opp.store(); results.put("orderPaymentPreferenceId", opp.get("orderPaymentPreferenceId")); |
Free forum by Nabble | Edit this page |