IO-885 Add parts price discrepancy indicator

This commit is contained in:
Patrick Fic
2021-04-12 15:32:34 -07:00
parent c216295e66
commit ca18c51654

View File

@@ -1,13 +1,16 @@
import React from "react"; import React from "react";
import { WarningFilled } from "@ant-design/icons";
export default function JobLinesBillRefernece({ jobline }) { export default function JobLinesBillRefernece({ jobline }) {
const billLine = jobline.billlines && jobline.billlines[0]; const billLine = jobline.billlines && jobline.billlines[0];
if (!billLine) return null; if (!billLine) return null;
const subletRequired = billLine.actual_price !== jobline.act_price;
return ( return (
<div>{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${ <div style={{ color: subletRequired && "tomato" }}>
billLine.bill.vendor.name {subletRequired && <WarningFilled />}
})`}</div> {`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
billLine.bill.vendor.name
})`}
</div>
); );
} }