IO-1606 Include additional costs in reconciliation.

This commit is contained in:
Patrick Fic
2022-01-17 11:48:12 -08:00
parent 933e0a62fb
commit 821b044515
2 changed files with 22 additions and 4 deletions

View File

@@ -64,9 +64,9 @@ export default function JobBillsTotalComponent({
})
);
const totalPartsSublet = Dinero(totals.parts.parts.total).add(
Dinero(totals.parts.sublets.total)
);
const totalPartsSublet = Dinero(totals.parts.parts.total)
.add(Dinero(totals.parts.sublets.total))
.add(Dinero(totals.additional.additionalCosts));
const discrepancy = totalPartsSublet.subtract(billTotals);

View File

@@ -18,7 +18,8 @@ export default function JobReconciliationModalComponent({ job, bills }) {
.flat() || [];
const jobLineData = job.joblines.filter(
(j) => j.part_type !== null && j.part_type !== "PAE"
(j) =>
(j.part_type !== null && j.part_type !== "PAE") || IsAdditionalCost(j)
);
return (
@@ -50,3 +51,20 @@ export default function JobReconciliationModalComponent({ job, bills }) {
</div>
);
}
function IsAdditionalCost(jobLine) {
//May be able to use db_ref here to help.
//936012 is Haz Waste Dispoal
//936008 is Paint/Materials
//936007 is Shop/Materials
//Remove paint and shop mat lines. They're calculated under rates.
const isPaintOrShopMat =
jobLine.db_ref === "936008" || jobLine.db_ref === "936007";
return (
(jobLine.lbr_op === "OP13" || //Added to resolve manual job lines coming into other totals because they have no reference.
(jobLine.db_ref && jobLine.db_ref.startsWith("9360"))) &&
!isPaintOrShopMat
);
}