Merged in feature/IO-3262-Tech-Console-Job-Clock-Out (pull request #2692)

IO-3262 Correction for v_year in Project Mexico

Approved-by: Dave Richer
This commit is contained in:
Allan Carr
2025-12-05 19:00:38 +00:00
committed by Dave Richer
2 changed files with 8 additions and 10 deletions

View File

@@ -234,11 +234,10 @@ const CreateRepairOrderTag = (job, errorCallback) => {
const ret = {
ro_number: crypto.createHash("md5").update(job.id, "utf8").digest("hex"),
v_vin: job.v_vin || "",
v_year: job.v_model_yr
? parseInt(job.v_model_yr.match(/\d/g))
? parseInt(job.v_model_yr.match(/\d/g).join(""), 10)
: ""
: "",
v_year: (() => {
const y = parseInt(job.v_model_yr);
return isNaN(y) ? null : y < 100 ? y + (y >= (new Date().getFullYear() + 1) % 100 ? 1900 : 2000) : y;
})(),
v_make: job.v_makedesc || "",
v_model: job.v_model || "",

View File

@@ -286,11 +286,10 @@ const CreateRepairOrderTag = (job, errorCallback) => {
const ret = {
ro_number: crypto.createHash("md5").update(job.ro_number, "utf8").digest("hex"),
v_vin: job.v_vin || "",
v_year: job.v_model_yr
? parseInt(job.v_model_yr.match(/\d/g))
? parseInt(job.v_model_yr.match(/\d/g).join(""), 10)
: ""
: "",
v_year: (() => {
const y = parseInt(job.v_model_yr);
return isNaN(y) ? null : y < 100 ? y + (y >= (new Date().getFullYear() + 1) % 100 ? 1900 : 2000) : y;
})(),
v_make: job.v_make_desc || "",
v_model: job.v_model_desc || "",