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.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@836129 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ashish Vijaywargiya
2009-11-14 06:10:47 +00:00
parent b64228fab1
commit 65eb607948
@@ -484,6 +484,13 @@ under the License.
<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>