Dinero rounding for reconciliation totals IO-608

This commit is contained in:
Patrick Fic
2021-02-04 15:57:52 -08:00
parent d1ef4fffe3
commit 882aa371c9

View File

@@ -28,16 +28,18 @@ export default function JobReconciliationTotals({
.filter((jl) => !!jlLookup[jl.id]) .filter((jl) => !!jlLookup[jl.id])
.reduce((acc, val) => { .reduce((acc, val) => {
return acc.add( return acc.add(
Dinero({ amount: val.act_price * 100 }).multiply(val.part_qty || 1) Dinero({ amount: Math.round((val.act_price || 0) * 100) }).multiply(
val.part_qty || 1
)
); );
}, Dinero()), }, Dinero()),
billLinesTotal: billLines billLinesTotal: billLines
.filter((bl) => !!billLookup[bl.id]) .filter((bl) => !!billLookup[bl.id])
.reduce((acc, val) => { .reduce((acc, val) => {
return acc.add( return acc.add(
Dinero({ amount: val.actual_price * 100 }).multiply( Dinero({
val.quantity || 1 amount: Math.round((val.actual_price || 0) * 100),
) }).multiply(val.quantity || 1)
); );
}, Dinero()), }, Dinero()),
}; };