Add UI elements to Job to new cieca profile fields.

This commit is contained in:
Patrick Fic
2023-09-28 13:32:01 -07:00
parent 68b4bc66ff
commit 53526d9c80
14 changed files with 1619 additions and 19 deletions

View File

@@ -262,8 +262,8 @@ async function CalculateRatesTotals({ job, client }) {
let hasMashLine = false;
let hasMahwLine = false;
let hasCustomMahwLine;
let mapaOpCodes = ParseCalopCode(job.materials["mapa"]?.cal_opcode);
let mashOpCodes = ParseCalopCode(job.materials["mash"]?.cal_opcode);
let mapaOpCodes = ParseCalopCode(job.materials["MAPA"]?.cal_opcode);
let mashOpCodes = ParseCalopCode(job.materials["MASH"]?.cal_opcode);
jobLines.forEach((item) => {
//IO-1317 Use the lines on the estimate if they exist instead.
@@ -352,16 +352,18 @@ async function CalculateRatesTotals({ job, client }) {
}
let threshold;
//Check if there is a max for this type.
if (job.materials && job.materials[property]) {
if (job.materials && job.materials[property.toUpperCase()]) {
//
if (
job.materials[property].cal_maxdlr !== undefined &&
job.materials[property].cal_maxdlr >= 0
job.materials[property.toUpperCase()].cal_maxdlr !== undefined &&
job.materials[property.toUpperCase()].cal_maxdlr >= 0
) {
//It has an upper threshhold.
threshold = Dinero({
amount: Math.round(job.materials[property].cal_maxdlr * 100),
amount: Math.round(
job.materials[property.toUpperCase()].cal_maxdlr * 100
),
});
}
}