svn commit: r836129 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r836129 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml

ashish-18
Author: ashish
Date: Sat Nov 14 06:10:47 2009
New Revision: 836129

URL: http://svn.apache.org/viewvc?rev=836129&view=rev
Log:
Applied patch from jira issue OFBIZ-3197 - Batch payment issue.
On cancelling a payment batch (payment group), payment group members (payments) should available for any another batch. Currently it is not happening.

Proposed solution -
Payment Batches are created by assigning of Payments to FinAccount. In batching FinAccountTrans record is created and then it is assigned to Payment. So on cancelling payment batch if FinAccountTrans status set to cancel. And then association of Payment to FinAccount break and it will available for another batch.

Thanks Sumit for the contribution.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml

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=836129&r1=836128&r2=836129&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 Nov 14 06:10:47 2009
@@ -484,6 +484,13 @@
             <iterate list="paymentGroupMembers" entry="paymentGroupMember">
                 <set-service-fields service-name="expirePaymentGroupMember" map="paymentGroupMember" to-map="expirePaymentGroupMemberMap"/>
                 <call-service service-name="expirePaymentGroupMember" in-map-name="expirePaymentGroupMemberMap"/>
+                <get-related-one relation-name="Payment" value-field="paymentGroupMember" to-value-field="payment"/>
+                <get-related-one relation-name="FinAccountTrans" value-field="payment" to-value-field="finAccountTrans"/>
+                <if-not-empty field="finAccountTrans">
+                    <set-service-fields service-name="setFinAccountTransStatus" map="finAccountTrans" to-map="setFinAccountTransStatusMap"/>
+                    <set field="setFinAccountTransStatusMap.statusId" value="FINACT_TRNS_CANCELED"/>
+                    <call-service service-name="setFinAccountTransStatus" in-map-name="setFinAccountTransStatusMap"/>
+                </if-not-empty>
             </iterate>
         <else>
             <add-error><fail-property resource="AccountingUiLabels" property="AccountingCancelBatchPaymentsError"/></add-error>