IO-2293 Autohouse & Job Costing Dinero Type Casting

All type cast to Dinero round to integer to prevent cast errors
This commit is contained in:
Allan Carr
2023-05-19 09:39:37 -07:00
parent 4c6a2d6d63
commit 57d8ca5829
2 changed files with 18 additions and 12 deletions

View File

@@ -792,10 +792,11 @@ const CreateCosts = (job) => {
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mapa * 100) ||
0,
0
),
}).multiply(job.job_totals.rates.mapa.hours)
);
}
@@ -806,10 +807,11 @@ const CreateCosts = (job) => {
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mapa * 100) ||
0,
0
),
}).multiply(job.job_totals.rates.mapa.hours)
);
}
@@ -829,10 +831,11 @@ const CreateCosts = (job) => {
job.bodyshop.md_responsibility_centers.defaults.costs.MASH
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mash * 100) ||
0,
0
),
}).multiply(job.job_totals.rates.mash.hours)
);
}

View File

@@ -642,10 +642,11 @@ function GenerateCostingData(job) {
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mapa * 100) ||
0,
0
),
}).multiply(materialsHours.mapaHrs)
);
}
@@ -656,10 +657,11 @@ function GenerateCostingData(job) {
job.bodyshop.md_responsibility_centers.defaults.costs.MAPA
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mapa * 100) ||
0,
0
),
}).multiply(materialsHours.mapaHrs)
);
}
@@ -680,10 +682,11 @@ function GenerateCostingData(job) {
job.bodyshop.md_responsibility_centers.defaults.costs.MASH
].add(
Dinero({
amount:
amount: Math.round(
(job.bodyshop.jc_hourly_rates &&
job.bodyshop.jc_hourly_rates.mash * 100) ||
0,
0
),
}).multiply(materialsHours.mashHrs)
);
}