Author: hansbak
Date: Thu May 13 03:58:37 2010
New Revision: 943783
URL:
http://svn.apache.org/viewvc?rev=943783&view=revLog:
make automatic creation of payment applications configurable. We want to show all functionality available in ofbiz so the default = yes
Modified:
ofbiz/trunk/applications/accounting/config/AccountingConfig.properties
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml
Modified: ofbiz/trunk/applications/accounting/config/AccountingConfig.properties
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingConfig.properties?rev=943783&r1=943782&r2=943783&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingConfig.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingConfig.properties Thu May 13 03:58:37 2010
@@ -30,3 +30,7 @@ invoiceProcessing=YY
# Automatically create a fixed asset when an 'asset usage' type product is created?
accounting.fixedasset.autocreate=Y
+
+# create a payment application if a payment is received/sent or invoice is approved (take the oldest not closed one)
+accounting.payment.application.autocreate=Y
+
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=943783&r1=943782&r2=943783&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 Thu May 13 03:58:37 2010
@@ -816,6 +816,13 @@ under the License.
</simple-method>
<simple-method method-name="createMatchingPaymentApplication" short-description="Create a payment application if either the invoice of payment could be found">
+
+ <property-to-field resource="AccountingConfig" property="accounting.payment.application.autocreate" field="autoCreate" default="Y"/>
+ <if-compare operator="not-equals" value="Y" field="autoCreate">
+ <log level="info" message="payment application not automatically created because config is not set to Y"/>
+ <return/>
+ </if-compare>
+
<if-not-empty field="parameters.invoiceId">
<entity-one value-field="invoice" entity-name="Invoice"/>
<if-not-empty field="invoice">
@@ -884,7 +891,7 @@ under the License.
<if-not-empty field="createAppl.paymentId">
<if-not-empty field="createAppl.invoiceId">
<call-service service-name="createPaymentApplication" in-map-name="createAppl"/>
- <set field="successMessage" value="also application created"/>
+ <log level="info" message="payment application automatically created between invoiceId: ${createAppl.invoiceId} and paymentId: ${createAppl.paymentId} for the amount: ${createAppl.appliedAmount} (can be disabled in AccountingConfig.properties)"/>
</if-not-empty>
</if-not-empty>
</simple-method>