From 4a3baffa6dfeca0db4cd0bcbe105c0026883c2ec Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 14 Sep 2010 17:44:31 +0530 Subject: [PATCH] [FIX]: fix a problem of calculating the outstandng lines and debit, credits lines bzr revid: mga@tinyerp.com-20100914121431-khdj5pm5t60f31xt --- addons/account_voucher/voucher.py | 14 ++++++++++---- .../voucher_payment_receipt_view.xml | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index 95100bbbe91..f3ad12dcf0b 100644 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -320,17 +320,22 @@ class account_voucher(osv.osv): total_debit = currency_pool.compute(cr, uid, currency_id, company_currency, total_debit) elif company_currency != currency_id and ttype == 'receipt': total_credit = currency_pool.compute(cr, uid, currency_id, company_currency, total_credit) - + for line in moves: - if line.credit and line.reconcile_partial_id: + if line.credit and line.reconcile_partial_id and ttype == 'receipt': + continue + if line.debit and line.reconcile_partial_id and ttype == 'payment': continue total_credit += line.credit or 0.0 total_debit += line.debit or 0.0 for line in moves: - if line.credit and line.reconcile_partial_id: + if line.credit and line.reconcile_partial_id and ttype == 'receipt': continue + if line.debit and line.reconcile_partial_id and ttype == 'payment': + continue + rs = { 'name':line.move_id.name, 'type': line.credit and 'dr' or 'cr', @@ -588,7 +593,8 @@ class account_voucher(osv.osv): 'debit':diff<0 and -diff or 0.0, } account_id = False - if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'): + if inv.type in ('sale', 'receipt'): +# if inv.journal_id.type in ('sale','sale_refund', 'cash', 'bank'): account_id = inv.partner_id.property_account_receivable.id else: account_id = inv.partner_id.property_account_payable.id diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 8656e819d6c..62380cd08bb 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -26,7 +26,7 @@ - +