IO-829 Resolve Parts Order Calculations issues.

This commit is contained in:
Patrick Fic
2021-03-31 11:35:08 -07:00
parent 315b816e50
commit eca5bd21ae
2 changed files with 19 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ export default function JobBillsTotalComponent({
if (p.return) {
totalReturns = totalReturns.add(
Dinero({
amount: Math.round((pol.cost || 0) * 100),
amount: Math.round((pol.act_price || 0) * 100),
}).multiply(pol.quantity)
);
}
@@ -74,7 +74,7 @@ export default function JobBillsTotalComponent({
const discrepWithLbrAdj = discrepancy.add(lbrAdjustments);
const discrepWithCms = discrepWithLbrAdj.subtract(billCms);
const creditsNotReceived = totalReturns.subtract(billCms);
const creditsNotReceived = totalReturns.add(billCms); //billCms is tracked as a negative number.
return (
<Card title={t("jobs.labels.jobtotals")}>
<Space wrap size="large">
@@ -89,7 +89,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepancy")}
valueStyle={{
color: discrepancy.getAmount === 0 ? "green" : "red",
color: discrepancy.getAmount() === 0 ? "green" : "red",
}}
value={discrepancy.toFormat()}
/>
@@ -100,7 +100,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepwithlbradj")}
valueStyle={{
color: discrepWithLbrAdj.getAmount === 0 ? "green" : "red",
color: discrepWithLbrAdj.getAmount() === 0 ? "green" : "red",
}}
value={discrepWithLbrAdj.toFormat()}
/>
@@ -111,7 +111,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.discrepwithcms")}
valueStyle={{
color: discrepWithCms.getAmount === 0 ? "green" : "red",
color: discrepWithCms.getAmount() === 0 ? "green" : "red",
}}
value={discrepWithCms.toFormat()}
/>
@@ -126,7 +126,7 @@ export default function JobBillsTotalComponent({
<Statistic
title={t("bills.labels.creditsnotreceived")}
valueStyle={{
color: creditsNotReceived.getAmount === 0 ? "green" : "red",
color: creditsNotReceived.getAmount() === 0 ? "green" : "red",
}}
value={creditsNotReceived.toFormat()}
/>