[FIX] point_of_sale: Fix js compute_all taxes

The compute_all JS-side hasn't be updated since recent changes in the tax computation introduced by:
https://github.com/odoo/odoo/commit/9b7d14c6b3caba5cde0b98bfaf8aaf887fc94abd

closes odoo/odoo#45801

X-original-commit: d9601cceab365276e43634260be29e2f23749020
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
Laurent Smet
2020-02-20 11:11:38 +00:00
parent d3bbe14c8d
commit ffbb32209a
+3 -2
View File
@@ -1906,6 +1906,7 @@ exports.Orderline = Backbone.Model.extend({
var round_tax = this.pos.company.tax_calculation_rounding_method != 'round_globally';
var initial_currency_rounding = currency_rounding;
if(!round_tax)
currency_rounding = currency_rounding * 0.00001;
@@ -1914,7 +1915,7 @@ exports.Orderline = Backbone.Model.extend({
return (base_amount - fixed_amount) / (1.0 + percent_amount / 100.0) * (100 - division_amount) / 100;
}
var base = round_pr(price_unit * quantity, currency_rounding);
var base = round_pr(price_unit * quantity, initial_currency_rounding);
var sign = 1;
if(base < 0){
@@ -1960,7 +1961,7 @@ exports.Orderline = Backbone.Model.extend({
i -= 1;
});
var total_excluded = recompute_base(base, incl_fixed_amount, incl_percent_amount, incl_division_amount);
var total_excluded = round_pr(recompute_base(base, incl_fixed_amount, incl_percent_amount, incl_division_amount), initial_currency_rounding);
var total_included = total_excluded;
// 5) Iterate the taxes in the sequence order to fill missing base/amount values.