[FIX] account: if tax is , total base is

applied only on the main tax and does not carry the child tax amount into base, it is compulsory to add child tax amount to tax base
becuase the next tax i.e. VAT is applied on total tax base amount
This commit is contained in:
Rifakat 2013-06-13 15:13:30 +05:30
parent bbbb085e5d
commit 1dceb70f3b
1 changed files with 4 additions and 1 deletions

View File

@ -2088,12 +2088,15 @@ class account_tax(osv.osv):
data['balance'] = cur_price_unit
amount2 = data.get('amount', 0.0)
amount3 = 0.0
if tax.child_ids:
if tax.child_depend:
latest = res.pop()
amount = amount2
child_tax = self._unit_compute(cr, uid, tax.child_ids, amount, product, partner, quantity)
res.extend(child_tax)
for child in child_tax:
amount3 += child.get('amount', 0.0)
if tax.child_depend:
for r in res:
for name in ('base','ref_base'):
@ -2109,7 +2112,7 @@ class account_tax(osv.osv):
r['amount'] = data['amount']
latest[name+'_code_id'] = False
if tax.include_base_amount:
cur_price_unit+=amount2
cur_price_unit += amount2 + amount3
return res
def compute_all(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None, force_excluded=False):