IO-3509 Duplicate Job Open Estimate Date
Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
@@ -31,9 +31,12 @@ export default async function DuplicateJob({
|
|||||||
delete existingJob.updatedat;
|
delete existingJob.updatedat;
|
||||||
delete existingJob.cieca_stl;
|
delete existingJob.cieca_stl;
|
||||||
delete existingJob.cieca_ttl;
|
delete existingJob.cieca_ttl;
|
||||||
|
!keepJobLines && delete existingJob.clm_total;
|
||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...existingJob,
|
...existingJob,
|
||||||
|
date_open: dayjs(),
|
||||||
|
date_estimated: dayjs(),
|
||||||
status: defaultOpenStatus
|
status: defaultOpenStatus
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ exports.totalsSsu = async function (req, res) {
|
|||||||
throw new Error("Failed to update job totals");
|
throw new Error("Failed to update job totals");
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(200).send();
|
res.status(200).json({ success: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("job-totals-ssu-USA-error", "error", req?.user?.email, id, {
|
logger.log("job-totals-ssu-USA-error", "error", req?.user?.email, id, {
|
||||||
jobid: id,
|
jobid: id,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
});
|
});
|
||||||
res.status(503).send();
|
res.status(503).json({ error: "Failed to calculate totals" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -47,14 +47,14 @@ exports.totalsSsu = async function (req, res) {
|
|||||||
throw new Error("Failed to update job totals");
|
throw new Error("Failed to update job totals");
|
||||||
}
|
}
|
||||||
|
|
||||||
res.status(200).send();
|
res.status(200).json({ success: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("job-totals-ssu-error", "error", req.user.email, id, {
|
logger.log("job-totals-ssu-error", "error", req.user.email, id, {
|
||||||
jobid: id,
|
jobid: id,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
});
|
});
|
||||||
res.status(503).send();
|
res.status(503).json({ error: "Failed to calculate totals" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user