Added quantity to entering invoices BOD-182

This commit is contained in:
Patrick Fic
2020-06-25 16:29:12 -07:00
parent 288e5e4c02
commit ea77478b02
17 changed files with 315 additions and 186 deletions

View File

@@ -19,9 +19,10 @@ export default function JobInvoiceTotals({ loading, invoices, jobTotals }) {
i.invoicelines.forEach((il) => {
invoiceTotals = invoiceTotals.add(
Dinero({
amount:
((il.actual_price || 0) * i.is_credit_memo ? -1 : 1 || 0) * 100,
})
amount: Math.round(
(il.actual_cost || 0) * (i.is_credit_memo ? -1 : 1) * 100
),
}).multiply(il.quantity)
);
})
);