[FIX] Account :Residual amount unclear when used with partial payments.

lp bug: https://launchpad.net/bugs/424214 fixed

bzr revid: jvo@tinyerp.com-20090904145207-0vfhvnougdl2599q
This commit is contained in:
GPA(OpenERP) 2009-09-04 20:22:07 +05:30 committed by Jay (Open ERP)
parent a45c87c780
commit 140aeda373
1 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ class account_invoice(osv.osv):
to_pay = inv.amount_total
for lines in inv.move_lines:
paid_amt = paid_amt - lines.credit + lines.debit
res[inv.id] = to_pay - abs(paid_amt)
res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy']))
return res
def _get_lines(self, cr, uid, ids, name, arg, context=None):
@ -892,7 +892,7 @@ class account_invoice(osv.osv):
if l.account_id.id==src_account_id:
line_ids.append(l.id)
total += (l.debit or 0.0) - (l.credit or 0.0)
if (not total) or writeoff_acc_id:
if (not round(total,int(config['price_accuracy']))) or writeoff_acc_id:
self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context)
else:
self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context)