From 56d832dbc5083bd24146416caeb092e2d49850e2 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Fri, 26 Jun 2015 09:15:35 +0200 Subject: [PATCH] [FIX] point of sale: rounding globally The price without taxe must be rounded on each line like 'price_subtotal' in "sale.order.line" with digits_compute= dp.get_precision('Account'). The total taxes included must be the sum of the rounded total without taxe and the rounded taxes like in "sale.order" in _amount_all. opw:643254 --- addons/point_of_sale/static/src/js/models.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 460a2d9890b..fa6473e4194 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -937,6 +937,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal taxtotal += tax.amount; taxdetail[tax.id] = tax.amount; }); + totalNoTax = round_pr(totalNoTax, this.pos.currency.rounding); return { "priceWithTax": totalTax, @@ -1123,9 +1124,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal }), 0), this.pos.currency.rounding); }, getTotalTaxIncluded: function() { - return round_pr((this.get('orderLines')).reduce((function(sum, orderLine) { - return sum + orderLine.get_price_with_tax(); - }), 0), this.pos.currency.rounding); + return this.getTotalTaxExcluded() + this.getTax(); }, getDiscountTotal: function() { return round_pr((this.get('orderLines')).reduce((function(sum, orderLine) {