IO-3503 Job Costing Fixes
Correction to handle CAD Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
@@ -267,7 +267,6 @@ function GenerateCostingData(job) {
|
|||||||
|
|
||||||
const materialsHours = { mapaHrs: 0, mashHrs: 0 };
|
const materialsHours = { mapaHrs: 0, mashHrs: 0 };
|
||||||
let mashOpCodes = InstanceManager({
|
let mashOpCodes = InstanceManager({
|
||||||
imex: [],
|
|
||||||
rome: ParseCalopCode(job.materials["MASH"]?.cal_opcode)
|
rome: ParseCalopCode(job.materials["MASH"]?.cal_opcode)
|
||||||
});
|
});
|
||||||
let hasMapaLine = false;
|
let hasMapaLine = false;
|
||||||
@@ -356,8 +355,14 @@ function GenerateCostingData(job) {
|
|||||||
if (val.mod_lbr_ty === "LAR") {
|
if (val.mod_lbr_ty === "LAR") {
|
||||||
materialsHours.mapaHrs += val.mod_lb_hrs || 0;
|
materialsHours.mapaHrs += val.mod_lb_hrs || 0;
|
||||||
}
|
}
|
||||||
if (val.mod_lbr_ty !== "LAR" && mashOpCodes.includes(val.lbr_op)) {
|
if (InstanceManager({ imex: true, rome: false })) {
|
||||||
materialsHours.mashHrs += val.mod_lb_hrs || 0;
|
if (val.mod_lbr_ty !== "LAR") {
|
||||||
|
materialsHours.mashHrs += val.mod_lb_hrs || 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (val.mod_lbr_ty !== "LAR" && mashOpCodes.includes(val.lbr_op)) {
|
||||||
|
materialsHours.mashHrs += val.mod_lb_hrs || 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,7 +540,11 @@ function GenerateCostingData(job) {
|
|||||||
|
|
||||||
if (!hasMapaLine) {
|
if (!hasMapaLine) {
|
||||||
let threshold;
|
let threshold;
|
||||||
if (job.materials["MAPA"].cal_maxdlr !== undefined && job.materials["MAPA"].cal_maxdlr >= 0) {
|
if (
|
||||||
|
job.materials["MAPA"] &&
|
||||||
|
job.materials["MAPA"].cal_maxdlr !== undefined &&
|
||||||
|
job.materials["MAPA"].cal_maxdlr >= 0
|
||||||
|
) {
|
||||||
//It has an upper threshhold.
|
//It has an upper threshhold.
|
||||||
threshold = Dinero({
|
threshold = Dinero({
|
||||||
amount: Math.round(job.materials["MAPA"].cal_maxdlr * 100)
|
amount: Math.round(job.materials["MAPA"].cal_maxdlr * 100)
|
||||||
@@ -581,7 +590,11 @@ function GenerateCostingData(job) {
|
|||||||
}
|
}
|
||||||
if (!hasMashLine) {
|
if (!hasMashLine) {
|
||||||
let threshold;
|
let threshold;
|
||||||
if (job.materials["MASH"].cal_maxdlr !== undefined && job.materials["MASH"].cal_maxdlr >= 0) {
|
if (
|
||||||
|
job.materials["MASH"] &&
|
||||||
|
job.materials["MASH"].cal_maxdlr !== undefined &&
|
||||||
|
job.materials["MASH"].cal_maxdlr >= 0
|
||||||
|
) {
|
||||||
//It has an upper threshhold.
|
//It has an upper threshhold.
|
||||||
threshold = Dinero({
|
threshold = Dinero({
|
||||||
amount: Math.round(job.materials["MASH"].cal_maxdlr * 100)
|
amount: Math.round(job.materials["MASH"].cal_maxdlr * 100)
|
||||||
|
|||||||
Reference in New Issue
Block a user