Fix: Rounding error prevented some bills from getting settled. This is related to the half even rounding in python.
This commit is contained in:
parent
ca3a599386
commit
e0ef5e7b64
|
@ -326,7 +326,11 @@ export class BillService {
|
||||||
(t, k) =>
|
(t, k) =>
|
||||||
k.inventories.reduce(
|
k.inventories.reduce(
|
||||||
(a, c) =>
|
(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,
|
0,
|
||||||
) + t,
|
) + t,
|
||||||
0,
|
0,
|
||||||
|
|
Loading…
Reference in New Issue