diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 1fe17d449a50d29de6aab6a6be0f00a4306e5969..054776e658c8b1b07e01bb919ce11c1342857f15 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -1573,6 +1573,7 @@ exports.Orderline = Backbone.Model.extend({ price_display : this.get_display_price(), price_with_tax : this.get_price_with_tax(), price_without_tax: this.get_price_without_tax(), + price_with_tax_before_discount: this.get_price_with_tax_before_discount(), tax: this.get_tax(), product_description: this.get_product().description, product_description_sale: this.get_product().description_sale, @@ -1669,6 +1670,9 @@ exports.Orderline = Backbone.Model.extend({ get_price_with_tax: function(){ return this.get_all_prices().priceWithTax; }, + get_price_with_tax_before_discount: function () { + return this.get_all_prices().priceWithTaxBeforeDiscount; + }, get_tax: function(){ return this.get_all_prices().tax; }, @@ -1822,6 +1826,7 @@ exports.Orderline = Backbone.Model.extend({ }); var all_taxes = this.compute_all(product_taxes, price_unit, this.get_quantity(), this.pos.currency.rounding); + var all_taxes_before_discount = this.compute_all(product_taxes, this.get_unit_price(), this.get_quantity(), this.pos.currency.rounding); _(all_taxes.taxes).each(function(tax) { taxtotal += tax.amount; taxdetail[tax.id] = tax.amount; @@ -1831,6 +1836,7 @@ exports.Orderline = Backbone.Model.extend({ "priceWithTax": all_taxes.total_included, "priceWithoutTax": all_taxes.total_excluded, "priceSumTaxVoid": all_taxes.total_void, + "priceWithTaxBeforeDiscount": all_taxes_before_discount.total_included, "tax": taxtotal, "taxDetails": taxdetail, }; diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml index 17c47b154add4b0e2dcac3d83376b0fcab7c88e6..0ac71c215305745af7a64496a71bf8dc4e8873f1 100644 --- a/addons/point_of_sale/static/src/xml/pos.xml +++ b/addons/point_of_sale/static/src/xml/pos.xml @@ -812,7 +812,12 @@ <line indent='1'> <left> <value t-att-value-decimals='pos.dp["Product Price"]'> - <t t-esc="line.price_lst" /> + <t t-if="pos.config.iface_tax_included === 'total'"> + <t t-esc="line.price_with_tax_before_discount" /> + </t> + <t t-else=""> + <t t-esc="line.price_lst" /> + </t> </value> </left> </line>