[FIX] Account : wizard_pay_invoice corrected (Check made to calculate only receivable,payable lines)
lp bug: https://launchpad.net/bugs/496889 fixed bzr revid: jvo@tinyerp.com-20100129142743-gkslge17jcfmewar
This commit is contained in:
@@ -99,12 +99,12 @@ def _wo_check(self, cr, uid, data, context):
|
||||
# => Ask to a write-off of the difference. This could happen even if both amount are equal,
|
||||
# because if the currency rate
|
||||
# Get the amount in company currency for the invoice (according to move lines)
|
||||
inv_amount_company_currency = invoice.move_id.amount
|
||||
# for aml in invoice.move_id.line_id:
|
||||
# if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
|
||||
# inv_amount_company_currency += aml.debit
|
||||
# inv_amount_company_currency -= aml.credit
|
||||
# inv_amount_company_currency = abs(inv_amount_company_currency)
|
||||
inv_amount_company_currency = 0
|
||||
for aml in invoice.move_id.line_id:
|
||||
if aml.account_id.id == invoice.account_id.id or aml.account_id.type in ('receivable', 'payable'):
|
||||
inv_amount_company_currency += aml.debit
|
||||
inv_amount_company_currency -= aml.credit
|
||||
inv_amount_company_currency = abs(inv_amount_company_currency)
|
||||
|
||||
# Get the current amount paid in company currency
|
||||
if journal.currency and invoice.company_id.currency_id.id<>journal.currency.id:
|
||||
|
||||
Reference in New Issue
Block a user