Skip to content

Commit

Permalink
[FIX] fiscal_epos_print: fix compute receipt.full_price
Browse files Browse the repository at this point in the history
  • Loading branch information
Borruso committed Jan 20, 2025
1 parent d751db4 commit 2802b29
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fiscal_epos_print/static/src/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ odoo.define("fiscal_epos_print.models", function (require) {
if (receipt.tax_department.included_in_price === true) {
receipt.full_price = this.price;
} else {
// This strategy was used because JavaScript's Math.round rounds to the nearest integer
// This strategy was used because rounds to the nearest integer
const dec_precision = this.pos.currency.decimal_places;
const full_price = Number(
(
Expand All @@ -209,8 +209,7 @@ odoo.define("fiscal_epos_print.models", function (require) {
).toFixed(dec_precision)
);
const rounding_factor = Math.pow(10, dec_precision);
receipt.full_price =
Math.trunc(full_price * rounding_factor) / rounding_factor;
receipt.full_price = parseFloat(full_price.toFixed(dec_precision));
}
}

Expand Down

0 comments on commit 2802b29

Please sign in to comment.