Author: jacopoc Date: Tue Dec 12 00:18:38 2006 New Revision: 486056 URL: http://svn.apache.org/viewvc?view=rev&rev=486056 Log: If a Invoice is applied to a BillingAccount, Payment should be applied to Invoice and also set BillingAccountId in PaymentApplication record. So that the total Invoice amount and Payment amount whould balance for a BillingAccount number. For details, see the interesting discussion here http://www.mail-archive.com/ofbiz-dev@incubator.apache.org/msg00970.html
Modified: incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Modified: incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml?view=diff&rev=486056&r1=486055&r2=486056 ============================================================================== --- incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml (original) +++ incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml Tue Dec 12 00:18:38 2006 @@ -131,6 +131,9 @@ <log level="warning" message="Create Payment Application: Amount to apply [${paymentAppl.amountApplied}] is greater than the outstanding amount [${notApplied}] of the invoice [${invoice.invoiceId}]. Creating Payment Application for outstanding amount [${notApplied}] instead."/> <set field="paymentAppl.amountApplied" from-field="notApplied"/> </if-compare-field> + <if-not-empty field-name="invoice.billingAccountId"> + <set field="paymentAppl.billingAccountId" from-field="invoice.billingAccountId"/> + </if-not-empty> </if-not-empty> <sequenced-id-to-env sequence-name="PaymentApplication" env-name="paymentAppl.paymentApplicationId"/>