From e69dbd320355ce1045a26e110801fc5160e46be0 Mon Sep 17 00:00:00 2001 From: vlst Date: Thu, 1 Jun 2023 08:46:59 +0000 Subject: [PATCH] [FIX] point_of_sale: fix improperly formatted value Currently, the `Counted` value in the closing popup is improperly formatted. Steps to reproduce: 1. Open a new session and create an order'; 2. Pay 5.06 dollars with `Bank` and the rest with `Cash`; 3. Close the session; 4. Observe the value `5.0600000000000005` instead of the expected `5.06` in the `Counted` field for the `Bank Payment Method` This PR addresses the issue by correctly formatting the value. closes odoo/odoo#123234 Taskid: #3332861 Signed-off-by: Joseph Caburnay (jcb) --- addons/point_of_sale/static/src/js/models.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index 97d0644c2b7..8b533dce7e7 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -888,7 +888,9 @@ export class PosGlobalState extends PosModel { otherPaymentMethods.forEach((pm) => { if (pm.type === "bank") { state.payments[pm.id] = { - counted: this.env.utils.roundCurrency(pm.amount), + counted: this.env.utils + .roundCurrency(pm.amount) + .toFixed(this.currency.decimal_places), difference: 0, number: pm.number, };