From dab78e3dc9d872bc0eaa04de47174f51e5357abd Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 May 2023 16:07:28 -0700 Subject: [PATCH] IO-2190 Paint Costs for JC if Cost/Hr is 0 --- server/job/job-costing.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/job/job-costing.js b/server/job/job-costing.js index 94af28402..33ae5722b 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -612,7 +612,12 @@ function GenerateCostingData(job) { //If the hourly rates for job costing are set, add them in. - if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) { + if ( + job.bodyshop.jc_hourly_rates && + (job.bodyshop.jc_hourly_rates.mapa || + typeof job.bodyshop.jc_hourly_rates.mapa === "number" || + isNaN(job.bodyshop.jc_hourly_rates.mapa) === false) + ) { if ( !billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA @@ -626,7 +631,9 @@ function GenerateCostingData(job) { billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA ] = Dinero({ - amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100) + amount: Math.round( + ((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100 + ), }); } else { billTotalsByCostCenters.additionalCosts[