IO-3509 Correction for date_estimate to handle tz correctly
Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user