[MERGE] fix voucher multi-lines rounding on taxes
bzr revid: fp@tinyerp.com-20121114111705-0ic4me8loy4jq3fl
This commit is contained in:
commit
bfe22e3c72
|
@ -383,7 +383,8 @@ class account_voucher(osv.osv):
|
|||
total_tax = 0.0
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes', []):
|
||||
for line in voucher.line_ids:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line.amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount', 0.0)
|
||||
total += total_tax
|
||||
else:
|
||||
|
@ -415,13 +416,11 @@ class account_voucher(osv.osv):
|
|||
|
||||
line_ids = resolve_o2m_operations(cr, uid, line_pool, line_ids, ["amount"], context)
|
||||
|
||||
total_tax = 0.0
|
||||
for line in line_ids:
|
||||
line_amount = 0.0
|
||||
line_amount = line.get('amount',0.0)
|
||||
voucher_total += line_amount
|
||||
|
||||
total = voucher_total
|
||||
total_tax = 0.0
|
||||
if tax_id:
|
||||
tax = [tax_pool.browse(cr, uid, tax_id, context=context)]
|
||||
if partner_id:
|
||||
|
@ -430,9 +429,11 @@ class account_voucher(osv.osv):
|
|||
tax = tax_pool.browse(cr, uid, taxes, context=context)
|
||||
|
||||
if not tax[0].price_include:
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_total, 1).get('taxes', []):
|
||||
for tax_line in tax_pool.compute_all(cr, uid, tax, line_amount, 1).get('taxes', []):
|
||||
total_tax += tax_line.get('amount')
|
||||
total += total_tax
|
||||
|
||||
voucher_total += line_amount
|
||||
total = voucher_total + total_tax
|
||||
|
||||
res.update({
|
||||
'amount': total or voucher_total,
|
||||
|
|
Loading…
Reference in New Issue