[FIX] point_of_sale: round globally
Commit 06754b32 brings an inconsistency between the PoS frontend, the
pos_order and the account_invoice tax calculation. Part of the commit is
correct since it corrects the matching between the `compute_all`
methods, however.
opw-680891
This commit is contained in:
@@ -1386,6 +1386,7 @@ exports.Orderline = Backbone.Model.extend({
|
||||
},
|
||||
get_all_prices: function(){
|
||||
var price_unit = this.get_unit_price() * (1.0 - (this.get_discount() / 100.0));
|
||||
var taxtotal = 0;
|
||||
|
||||
var product = this.get_product();
|
||||
var taxes_ids = product.taxes_id;
|
||||
@@ -1401,13 +1402,14 @@ exports.Orderline = Backbone.Model.extend({
|
||||
|
||||
var all_taxes = this.compute_all(product_taxes, price_unit, this.get_quantity(), this.pos.currency.rounding);
|
||||
_(all_taxes.taxes).each(function(tax) {
|
||||
taxtotal += tax.amount;
|
||||
taxdetail[tax.id] = tax.amount;
|
||||
});
|
||||
|
||||
return {
|
||||
"priceWithTax": all_taxes.total_included,
|
||||
"priceWithoutTax": all_taxes.total_excluded,
|
||||
"tax": all_taxes.total_included - all_taxes.total_excluded,
|
||||
"tax": taxtotal,
|
||||
"taxDetails": taxdetail,
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user