diff --git a/server/job/job-costing.js b/server/job/job-costing.js index 19cd70f0a..36628273f 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -336,6 +336,7 @@ function GenerateCostingData(job) { console.log("Unknown type", val.line_desc, val.mod_lbr_ty); const rateName = `rate_${(val.mod_lbr_ty || "").toLowerCase()}`; + const laborAmount = Dinero({ amount: Math.round((job[rateName] || 0) * 100), }).multiply(val.mod_lb_hrs || 0); @@ -344,6 +345,19 @@ function GenerateCostingData(job) { acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add(laborAmount); + if ( + val.mod_lb_hrs === 0 && + val.act_price > 0 && + val.lbr_op === "OP14" + ) { + //Scenario where SGI may pay out hours using a part price. + acc.labor[laborProfitCenter] = acc.labor[laborProfitCenter].add( + Dinero({ + amount: Math.round((val.act_price || 0) * 100), + }).multiply(val.part_qty) + ); + } + if (val.mod_lbr_ty === "LAR") { materialsHours.mapaHrs += val.mod_lb_hrs || 0; }