From 2acddcb9ac013750d4a743ced4ce84823222f6a8 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 23 Jan 2026 22:51:53 -0800 Subject: [PATCH] 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" }); } };