From 2acddcb9ac013750d4a743ced4ce84823222f6a8 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 23 Jan 2026 22:51:53 -0800 Subject: [PATCH 1/2] IO-3509 Duplicate Job Open Estimate Date Signed-off-by: Allan Carr --- .../jobs-detail-header-actions.duplicate.util.js | 3 +++ server/job/job-totals-USA.js | 4 ++-- server/job/job-totals.js | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js index 8e0705e79..8edbe1199 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js @@ -31,9 +31,12 @@ export default async function DuplicateJob({ delete existingJob.updatedat; delete existingJob.cieca_stl; delete existingJob.cieca_ttl; + !keepJobLines && delete existingJob.clm_total; const newJob = { ...existingJob, + date_open: dayjs(), + date_estimated: dayjs(), status: defaultOpenStatus }; diff --git a/server/job/job-totals-USA.js b/server/job/job-totals-USA.js index 27fced83e..a8bd632cc 100644 --- a/server/job/job-totals-USA.js +++ b/server/job/job-totals-USA.js @@ -47,14 +47,14 @@ exports.totalsSsu = async function (req, res) { throw new Error("Failed to update job totals"); } - res.status(200).send(); + res.status(200).json({ success: true }); } catch (error) { logger.log("job-totals-ssu-USA-error", "error", req?.user?.email, id, { jobid: id, error: error.message, stack: error.stack }); - res.status(503).send(); + res.status(503).json({ error: "Failed to calculate totals" }); } }; diff --git a/server/job/job-totals.js b/server/job/job-totals.js index c11d8d7de..35cc4e6c1 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -47,14 +47,14 @@ exports.totalsSsu = async function (req, res) { throw new Error("Failed to update job totals"); } - res.status(200).send(); + res.status(200).json({ success: true }); } catch (error) { logger.log("job-totals-ssu-error", "error", req.user.email, id, { jobid: id, error: error.message, stack: error.stack }); - res.status(503).send(); + res.status(503).json({ error: "Failed to calculate totals" }); } }; From cca23a5b1133d1fd95172cee0aec940af09615d1 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 23 Jan 2026 23:07:11 -0800 Subject: [PATCH 2/2] IO-3509 Correction for date_estimate to handle tz correctly Signed-off-by: Allan Carr --- .../job-create-iou/job-create-iou.component.jsx | 3 ++- .../jobs-detail-header-actions.component.jsx | 4 ++-- .../jobs-detail-header-actions.duplicate.util.js | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/client/src/components/job-create-iou/job-create-iou.component.jsx b/client/src/components/job-create-iou/job-create-iou.component.jsx index cbe1c570d..d44dfa6ff 100644 --- a/client/src/components/job-create-iou/job-create-iou.component.jsx +++ b/client/src/components/job-create-iou/job-create-iou.component.jsx @@ -50,7 +50,8 @@ export function JobCreateIOU({ bodyshop, currentUser, job, selectedJobLines, tec config: { status: bodyshop.md_ro_statuses.default_open, bodyshopid: bodyshop.id, - useremail: currentUser.email + useremail: currentUser.email, + timezone: bodyshop.timezone }, currentUser }); diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx index 6855fdfe9..25f9e22a1 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.component.jsx @@ -264,7 +264,7 @@ export function JobsDetailHeaderActions({ DuplicateJob({ apolloClient: client, jobId: job.id, - config: { defaultOpenStatus: bodyshop.md_ro_statuses.default_imported }, + config: { defaultOpenStatus: bodyshop.md_ro_statuses.default_imported, timezone: bodyshop.timezone }, completionCallback: (newJobId) => { history(`/manage/jobs/${newJobId}`); notification.success({ @@ -279,7 +279,7 @@ export function JobsDetailHeaderActions({ DuplicateJob({ apolloClient: client, jobId: job.id, - config: { defaultOpenStatus: bodyshop.md_ro_statuses.default_imported }, + config: { defaultOpenStatus: bodyshop.md_ro_statuses.default_imported, timezone: bodyshop.timezone }, completionCallback: (newJobId) => { history(`/manage/jobs/${newJobId}`); notification.success({ diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js index 8edbe1199..cbc2ed23c 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js @@ -15,7 +15,7 @@ export default async function DuplicateJob({ }) { logImEXEvent("job_duplicate"); - const { defaultOpenStatus } = config; + const { defaultOpenStatus, timezone } = config; //get a list of all fields on the job const res = await apolloClient.query({ query: QUERY_JOB_FOR_DUPE, @@ -35,8 +35,8 @@ export default async function DuplicateJob({ const newJob = { ...existingJob, + date_estimated: dayjs().tz(timezone, false).format("YYYY-MM-DD"), date_open: dayjs(), - date_estimated: dayjs(), status: defaultOpenStatus }; @@ -73,7 +73,7 @@ export default async function DuplicateJob({ export async function CreateIouForJob({ apolloClient, jobId, config, jobLinesToKeep, currentUser }) { logImEXEvent("job_create_iou"); - const { status } = config; + const { status, timezone } = config; //get a list of all fields on the job const res = await apolloClient.query({ query: QUERY_JOB_FOR_DUPE, @@ -91,10 +91,10 @@ export async function CreateIouForJob({ apolloClient, jobId, config, jobLinesToK const newJob = { ...existingJob, - converted: true, status: status, iouparent: jobId, + date_estimated: dayjs().tz(timezone, false).format("YYYY-MM-DD"), date_open: dayjs(), audit_trails: { data: [