diff options
| author | Mantavya Gajjar <mga@tinyerp.com> | 2010-09-14 17:44:31 +0530 |
|---|---|---|
| committer | Mantavya Gajjar <mga@tinyerp.com> | 2010-09-14 17:44:31 +0530 |
| commit | 4a3baffa6dfeca0db4cd0bcbe105c0026883c2ec (patch) | |
| tree | 3c0b9256322f3434d06c690dab156c47a324a546 | |
| parent | 3d71503df84f8b6456f4c744d3801147a7c7a9df (diff) | |
[FIX]: fix a problem of calculating the outstandng lines and debit, credits lines
bzr revid: mga@tinyerp.com-20100914121431-khdj5pm5t60f31xt
| -rw-r--r-- | addons/account_voucher/voucher.py | 14 | ||||
| -rw-r--r-- | addons/account_voucher/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 @@ <notebook colspan="4"> <page string="Payment Information"> <field name="line_dr_ids" default_get="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="140"> - <tree string="Payment Lines" editable="bottom"> + <tree string="Vendor Invoices and Outstanding transactions" editable="bottom"> <field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}" on_change="onchange_move_line_id(move_line_id)" domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]" |
