[FIX] account: corrected tax base amount calculation
It first rounds base value and then multiplies with the qty which leads to wrong calculation lp bug: https://launchpad.net/bugs/1058390 fixed bzr revid: rha@tinyerp.com-20121003103919-slne7ppo75k9478m
This commit is contained in:
committed by
Rifakat
parent
faaf115ed8
commit
0a5fbeb82e
@@ -1586,14 +1586,13 @@ class account_invoice_tax(osv.osv):
|
||||
|
||||
for line in inv.invoice_line:
|
||||
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, inv.address_invoice_id.id, line.product_id, inv.partner_id)['taxes']:
|
||||
tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
|
||||
val={}
|
||||
val['invoice_id'] = inv.id
|
||||
val['name'] = tax['name']
|
||||
val['amount'] = tax['amount']
|
||||
val['manual'] = False
|
||||
val['sequence'] = tax['sequence']
|
||||
val['base'] = tax['price_unit'] * line['quantity']
|
||||
val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity'])
|
||||
|
||||
if inv.type in ('out_invoice','in_invoice'):
|
||||
val['base_code_id'] = tax['base_code_id']
|
||||
|
||||
Reference in New Issue
Block a user