Fix: Rounding error prevented some bills from getting settled. This is related to the half even rounding in python.

This commit is contained in:
Amritanshu Agrawal 2021-06-26 08:45:24 +05:30
parent ca3a599386
commit e0ef5e7b64
1 changed files with 5 additions and 1 deletions

View File

@ -326,7 +326,11 @@ export class BillService {
(t, k) =>
k.inventories.reduce(
(a, c) =>
a + (c.isHappyHour ? 0 : c.price) * c.quantity * (1 - c.discount) * (1 + c.taxRate),
a +
this.math.halfRoundEven(
(c.isHappyHour ? 0 : c.price) * c.quantity * (1 - c.discount) * (1 + c.taxRate),
2,
),
0,
) + t,
0,