diff options
Diffstat (limited to 'addons/point_of_sale/static/src/js/models.js')
| -rw-r--r-- | addons/point_of_sale/static/src/js/models.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 62424ef80ef..a5cae7702c6 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -3333,12 +3333,19 @@ exports.Order = Backbone.Model.extend({ if (utils.float_is_zero(rounding_applied, this.pos.currency.decimals)){ // https://xkcd.com/217/ return 0; - } else if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied < 0) { + } + else if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied < 0 && remaining > 0) { rounding_applied += this.pos.cash_rounding[0].rounding; } - else if(this.pos.cash_rounding[0].rounding_method === "DOWN" && rounding_applied > 0){ + else if(this.pos.cash_rounding[0].rounding_method === "UP" && rounding_applied > 0 && remaining < 0) { + rounding_applied -= this.pos.cash_rounding[0].rounding; + } + else if(this.pos.cash_rounding[0].rounding_method === "DOWN" && rounding_applied > 0 && remaining > 0){ rounding_applied -= this.pos.cash_rounding[0].rounding; } + else if(this.pos.cash_rounding[0].rounding_method === "DOWN" && rounding_applied < 0 && remaining < 0){ + rounding_applied += this.pos.cash_rounding[0].rounding; + } return sign * rounding_applied; } else { |
