You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/08/17 13:57:12 UTC
svn commit: r804946 - in /ofbiz/trunk/applications/accounting:
data/AccountingTypeData.xml
script/org/ofbiz/accounting/invoice/InvoiceServices.xml
servicedef/secas.xml servicedef/secas_ledger.xml
Author: ashish
Date: Mon Aug 17 11:57:12 2009
New Revision: 804946
URL: http://svn.apache.org/viewvc?rev=804946&view=rev
Log:
Applied patch from jira issue OFBIZ-2785 - Invoice can be canceled when associated payment is in Confirmed status.
Thanks Sumit for your contribution.
Modified:
ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
ofbiz/trunk/applications/accounting/servicedef/secas.xml
ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml
Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=804946&r1=804945&r2=804946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Mon Aug 17 11:57:12 2009
@@ -897,6 +897,8 @@
<StatusValidChange condition="" statusId="PMNT_NOT_PAID" statusIdTo="PMNT_VOID" transitionName="Payment Voided"/>
<StatusValidChange condition="" statusId="PMNT_SENT" statusIdTo="PMNT_NOT_PAID" transitionName="Payment Not Paid"/>
<StatusValidChange condition="" statusId="PMNT_RECEIVED" statusIdTo="PMNT_NOT_PAID" transitionName="Payment Not Paid"/>
+ <StatusValidChange condition="" statusId="PMNT_CONFIRMED" statusIdTo="PMNT_SENT" transitionName="Payment Confirmed to Sent"/>
+ <StatusValidChange condition="" statusId="PMNT_CONFIRMED" statusIdTo="PMNT_RECEIVED" transitionName="Payment Confirmed to Received"/>
<SettlementTerm settlementTermId="COD" termName="Cash Due on Delivery" termValue="0" uomId="TF_day"/>
<SettlementTerm settlementTermId="NET_15" termName="Net Due in 15 Days" termValue="15" uomId="TF_day"/>
Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=804946&r1=804945&r2=804946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Mon Aug 17 11:57:12 2009
@@ -603,6 +603,20 @@
<get-related relation-name="PaymentApplication" value-field="invoice" list="paymentApplications"/>
<iterate list="paymentApplications" entry="paymentApplication">
<get-related-one relation-name="Payment" value-field="paymentApplication" to-value-field="payment"/>
+ <if-compare field="payment.statusId" operator="equals" value="PMNT_CONFIRMED">
+ <set field="paymentStatusMap.paymentId" from-field="payment.paymentId"/>
+ <set field="isReceipt" value="${groovy:org.ofbiz.accounting.util.UtilAccounting.isReceipt(payment)}" type="Boolean"/>
+ <set field="isDisbursement" value="${groovy:org.ofbiz.accounting.util.UtilAccounting.isDisbursement(payment)}" type="Boolean"/>
+ <if-compare field="isReceipt" operator="equals" value="true" type="Boolean">
+ <set field="paymentStatusMap.statusId" value="PMNT_RECEIVED"/>
+ <else>
+ <if-compare field="isDisbursement" operator="equals" value="true" type="Boolean">
+ <set field="paymentStatusMap.statusId" value="PMNT_SENT"/>
+ </if-compare>
+ </else>
+ </if-compare>
+ <call-service service-name="setPaymentStatus" in-map-name="paymentStatusMap"/>
+ </if-compare>
<set field="removePaymentApplicationCtx.paymentApplicationId" from-field="paymentApplication.paymentApplicationId"/>
<call-service service-name="removePaymentApplication" in-map-name="removePaymentApplicationCtx"/>
</iterate>
Modified: ofbiz/trunk/applications/accounting/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas.xml?rev=804946&r1=804945&r2=804946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas.xml Mon Aug 17 11:57:12 2009
@@ -144,6 +144,7 @@
<eca service="setPaymentStatus" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
+ <condition field-name="oldStatusId" operator="not-equals" value="PMNT_CONFIRMED"/>
<action service="sampleInvoiceAffiliateCommission" mode="sync"/>
</eca>
-->
Modified: ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml?rev=804946&r1=804945&r2=804946&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas_ledger.xml Mon Aug 17 11:57:12 2009
@@ -92,6 +92,7 @@
<eca service="setPaymentStatus" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
+ <condition field-name="oldStatusId" operator="not-equals" value="PMNT_CONFIRMED"/>
<action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
@@ -123,6 +124,7 @@
<eca service="setPaymentStatus" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_SENT"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_SENT"/>
+ <condition field-name="oldStatusId" operator="not-equals" value="PMNT_CONFIRMED"/>
<action service="createAcctgTransAndEntriesForOutgoingPayment" mode="sync"/>
</eca>