[FIX] point_of_sale: rounding error in discount computing + removing duplicated code
This commit is contained in:
parent
e826e84af5
commit
d30103c29e
|
@ -810,10 +810,13 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||||
get_unit_price: function(){
|
get_unit_price: function(){
|
||||||
return this.price;
|
return this.price;
|
||||||
},
|
},
|
||||||
get_display_price: function(){
|
get_base_price: function(){
|
||||||
var rounding = this.pos.currency.rounding;
|
var rounding = this.pos.currency.rounding;
|
||||||
return round_pr(round_pr(this.get_unit_price() * this.get_quantity(),rounding) * (1- this.get_discount()/100.0),rounding);
|
return round_pr(round_pr(this.get_unit_price() * this.get_quantity(),rounding) * (1- this.get_discount()/100.0),rounding);
|
||||||
},
|
},
|
||||||
|
get_display_price: function(){
|
||||||
|
return this.get_base_price();
|
||||||
|
},
|
||||||
get_price_without_tax: function(){
|
get_price_without_tax: function(){
|
||||||
return this.get_all_prices().priceWithoutTax;
|
return this.get_all_prices().priceWithoutTax;
|
||||||
},
|
},
|
||||||
|
@ -829,7 +832,7 @@ function openerp_pos_models(instance, module){ //module is instance.point_of_sal
|
||||||
get_all_prices: function(){
|
get_all_prices: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
var currency_rounding = this.pos.currency.rounding;
|
var currency_rounding = this.pos.currency.rounding;
|
||||||
var base = round_pr(this.get_quantity() * this.get_unit_price() * (1.0 - (this.get_discount() / 100.0)), currency_rounding);
|
var base = this.get_base_price();
|
||||||
var totalTax = base;
|
var totalTax = base;
|
||||||
var totalNoTax = base;
|
var totalNoTax = base;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue