[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) <jcb@odoo.com>
This commit is contained in:
vlst
2023-06-05 13:31:40 +02:00
parent 04bdf6dc5a
commit e69dbd3203
+3 -1
View File
@@ -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,
};