Author: apatel
Date: Tue Jul 28 13:03:34 2009
New Revision: 798513
URL: http://svn.apache.org/viewvc?rev=798513&view=rev
Log:
On cancelling a check run, finaccount balance is updated accordingly.
Modified:
ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
ofbiz/trunk/applications/accounting/servicedef/secas_payment.xml
ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=798513&r1=798512&r2=798513&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Tue Jul 28
13:03:34 2009
@@ -119,6 +119,7 @@
<StatusItem statusId="FINACT_TRNS_CANCELED"
statusTypeId="FINACT_TRNS_STATUS" statusCode="CANCELED" sequenceId="13"
description="Canceled"/>
<StatusValidChange condition="" statusId="FINACT_TRNS_CREATED"
statusIdTo="FINACT_TRNS_APPROVED" transitionName="Set Created to Approved"/>
<StatusValidChange condition="" statusId="FINACT_TRNS_CREATED"
statusIdTo="FINACT_TRNS_CANCELED" transitionName="Set Created to Canceled"/>
+ <StatusValidChange condition="" statusId="FINACT_TRNS_APPROVED"
statusIdTo="FINACT_TRNS_CANCELED" transitionName="Set Approved to Canceled"/>
<!-- FinAccount Reasons for Purchase & Replenish -->
<EnumerationType description="Service Debit Reasons"
enumTypeId="FINACCT_TRANS_REASON" parentTypeId="" hasTable="N"/>
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=798513&r1=798512&r2=798513&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
Tue Jul 28 13:03:34 2009
@@ -397,6 +397,9 @@
<fail-property resource="AccountingUiLabels"
property="AccountingPermissionError"/>
</check-permission>
<entity-one entity-name="Payment" value-field="payment"/>
+ <field-to-result field="payment.finAccountTransId"
result-name="finAccountTransId"/>
+ <set field="transStatusId" value="FINACT_TRNS_CANCELED"/>
+ <field-to-result field="transStatusId" result-name="statusId"/>
<if-empty field="payment">
<add-error><fail-message
message="${uiLabelMap.AccountingNoPaymentsfound}"/></add-error>
<check-errors/>
Modified: ofbiz/trunk/applications/accounting/servicedef/secas_payment.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas_payment.xml?rev=798513&r1=798512&r2=798513&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas_payment.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas_payment.xml Tue Jul 28
13:03:34 2009
@@ -52,10 +52,18 @@
<condition field-name="finAccountTransId" operator="is-not-empty"/>
<condition field-name="statusId" operator="equals"
value="FINACT_TRNS_CANCELED"/>
<action service="updatePaymentOnFinAccTransStatusSetToCancel"
mode="sync"/>
+ <action service="updateFinAccountBalancesFromTrans" mode="sync"/>
</eca>
<!-- Create Reverse Accouting Transaction and Entries on removing
PaymentApplication -->
<eca service="removePaymentApplication" event="invoke">
<action service="revertAcctgTransOnRemovePaymentApplications"
mode="sync"/>
</eca>
+
+ <!-- set FinAccountTrans Status to CANCELED on Void Payment -->
+ <eca service="voidPayment" event="commit">
+ <condition field-name="finAccountTransId" operator="is-not-empty"/>
+ <condition field-name="statusId" operator="equals"
value="FINACT_TRNS_CANCELED"/>
+ <action service="setFinAccountTransStatus" mode="sync"/>
+ </eca>
</service-eca>
Modified: ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_payment.xml?rev=798513&r1=798512&r2=798513&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_payment.xml
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_payment.xml Tue Jul
28 13:03:34 2009
@@ -147,6 +147,8 @@
<description>Sets payment status to PMNT_VOID, removes all
PaymentApplications, changes related invoice statuses to
INVOICE_READY if status is INVOICE_PAID, and reverses related
AcctgTrans by calling copyAcctgTransAndEntries service</description>
<attribute name="paymentId" mode="IN" optional="false" type="String"/>
+ <attribute name="finAccountTransId" type="String" mode="OUT"
optional="true"/>
+ <attribute name="statusId" type="String" mode="OUT" optional="true"/>
</service>
<service name="getPaymentRunningTotal" engine="simple"
location="component://accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml"
invoke="getPaymentRunningTotal" auth="true">