diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 5d61b7b155f0627129f7949d681d27b65f954966..5151ec75b442a0e8c16b33464d5e95fab12f2d13 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -869,7 +869,7 @@ class AccountTax(models.Model): incl_fixed_amount = incl_percent_amount = 0 if tax.price_include: if tax.amount_type == 'fixed': - incl_fixed_amount += tax.amount + incl_fixed_amount += quantity * tax.amount elif tax.amount_type == 'percent': incl_percent_amount += tax.amount # Start the computation of accumulated amounts at the total_excluded value. diff --git a/addons/account/tests/test_tax.py b/addons/account/tests/test_tax.py index cfd5470981bae782e966fb295fcad484ac94722f..806c0e5cda4b454b12aac89247a9a11e8d78cc0e 100644 --- a/addons/account/tests/test_tax.py +++ b/addons/account/tests/test_tax.py @@ -232,6 +232,22 @@ class TestTax(AccountTestUsers): res ) + self.fixed_tax.price_include = True + self.fixed_tax.include_base_amount = False + res = self.fixed_tax.compute_all(100.0, quantity=2.0) + self._check_compute_all_results( + 180, # 'base' + 200, # 'total_included' + 180, # 'total_excluded' + [ + # base , amount | seq | amount | incl | incl_base + # --------------------------------------------------- + (180.0, 20.0), # | 1 | 20 | | t + # --------------------------------------------------- + ], + res + ) + def test_tax_include_base_amount_2(self): self.percent_tax.price_include = True self.percent_tax.amount = 21.0 diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index d6f3f39b173cee369ff4fa19cf271333313e13f2..b268e88571ce865e3cbfa7d259538d09b9bbaecf 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1502,7 +1502,7 @@ exports.Orderline = Backbone.Model.extend({ } if(tax.price_include){ if(tax.amount_type === 'fixed') - incl_fixed_amount += tax.amount; + incl_fixed_amount += quantity * tax.amount; else if(tax.amount_type === 'percent') incl_percent_amount += tax.amount; } @@ -1518,7 +1518,7 @@ exports.Orderline = Backbone.Model.extend({ var amount = self._compute_all(tax, base, quantity, false); if(!tax.price_include || base_gaps.length == 0) - return tax_amount; + return amount; var new_gap = base_gaps[base_gaps.length - 1] - amount;