Compare commits
31 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1934ae0758 | ||
|
|
953e70efef | ||
|
|
a6bae390e5 | ||
|
|
cf9d8d649d | ||
|
|
a25051c4c2 | ||
|
|
d5c3152631 | ||
|
|
66c425bf96 | ||
|
|
ffad0dfbf7 | ||
|
|
17285fc029 | ||
|
|
401e3cff73 | ||
|
|
865680e019 | ||
|
|
9f97ca0336 | ||
|
|
5df38f8612 | ||
|
|
63c5719420 | ||
|
|
d6c80f1420 | ||
|
|
fade927c9e | ||
|
|
9f472ce1d0 | ||
|
|
47a56e32b9 | ||
|
|
f13f79acb6 | ||
|
|
bfa9fddb9e | ||
|
|
28abd9707e | ||
|
|
5f621e1ae0 | ||
|
|
624414799e | ||
|
|
72091e9eae | ||
|
|
9cfacdd025 | ||
|
|
655e516246 | ||
|
|
7b12f0a3b9 | ||
|
|
5c4267f3ef | ||
|
|
e79e512291 | ||
|
|
f0064abfbe | ||
|
|
32bdea559e |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -130,3 +130,5 @@ test-output.txt
|
|||||||
server/job/test/fixtures
|
server/job/test/fixtures
|
||||||
|
|
||||||
.github
|
.github
|
||||||
|
_reference/ragmate/.ragmate.env
|
||||||
|
docker_data
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
client_max_body_size 50M;
|
client_max_body_size 50M;
|
||||||
client_body_buffer_size 5M;
|
client_body_buffer_size 5M;
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,411 @@
|
|||||||
|
import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined } from "@ant-design/icons";
|
||||||
|
import { Card, Space, Switch, Table, Tooltip, Typography } from "antd";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
import { TimeFormatter } from "../../../utils/DateFormatter";
|
||||||
|
import { onlyUnique } from "../../../utils/arrayHelper";
|
||||||
|
import dayjs from "../../../utils/day";
|
||||||
|
import { alphaSort, dateSort } from "../../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../../utils/useLocalStorage";
|
||||||
|
import ChatOpenButton from "../../chat-open-button/chat-open-button.component";
|
||||||
|
import OwnerNameDisplay, { OwnerNameDisplayFunction } from "../../owner-name-display/owner-name-display.component";
|
||||||
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
|
|
||||||
|
export default function DashboardScheduledDeliveryToday({ data, ...cardProps }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [state, setState] = useState({
|
||||||
|
sortedInfo: {},
|
||||||
|
filteredInfo: {}
|
||||||
|
});
|
||||||
|
const [isTvModeScheduledDelivery, setIsTvModeScheduledDelivery] = useLocalStorage("isTvModeScheduledDelivery", false);
|
||||||
|
if (!data) return null;
|
||||||
|
if (!data.scheduled_delivery_today) return <DashboardRefreshRequired {...cardProps} />;
|
||||||
|
|
||||||
|
const scheduledDeliveryToday = data.scheduled_delivery_today.map((item) => {
|
||||||
|
const joblines_body = item.joblines
|
||||||
|
? item.joblines.filter((l) => l.mod_lbr_ty !== "LAR").reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
|
: 0;
|
||||||
|
const joblines_ref = item.joblines
|
||||||
|
? item.joblines.filter((l) => l.mod_lbr_ty === "LAR").reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
|
: 0;
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
joblines_body,
|
||||||
|
joblines_ref
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const tvFontSize = 18;
|
||||||
|
const tvFontWeight = "bold";
|
||||||
|
|
||||||
|
const tvColumns = [
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.scheduled_delivery"),
|
||||||
|
dataIndex: "scheduled_delivery",
|
||||||
|
key: "scheduled_delivery",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => dateSort(a.scheduled_delivery, b.scheduled_delivery),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "scheduled_delivery" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<TimeFormatter>{record.scheduled_delivery}</TimeFormatter>
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ro_number"),
|
||||||
|
dataIndex: "ro_number",
|
||||||
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<Link to={"/manage/jobs/" + record.jobid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
<Space>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.ro_number || t("general.labels.na")}
|
||||||
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
|
) : null}
|
||||||
|
{record.suspended && <PauseCircleOutlined style={{ color: "orangered" }} />}
|
||||||
|
{record.iouparent && (
|
||||||
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.owner"),
|
||||||
|
dataIndex: "owner",
|
||||||
|
key: "owner",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.ownerid ? (
|
||||||
|
<Link to={"/manage/owners/" + record.ownerid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${a.v_model_desc || ""}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link to={"/manage/vehicles/" + record.vehicleid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{`${
|
||||||
|
record.v_model_yr || ""
|
||||||
|
} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.alt_transport"),
|
||||||
|
dataIndex: "alt_transport",
|
||||||
|
key: "alt_transport",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "alt_transport" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(scheduledDeliveryToday &&
|
||||||
|
scheduledDeliveryToday
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || t("dashboard.errors.atp"),
|
||||||
|
value: [s]
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport),
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{record.alt_transport}</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.status"),
|
||||||
|
dataIndex: "status",
|
||||||
|
key: "status",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(scheduledDeliveryToday &&
|
||||||
|
scheduledDeliveryToday
|
||||||
|
.map((j) => j.status)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || t("dashboard.errors.status"),
|
||||||
|
value: [s]
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
|
render: (text, record) => <span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{record.status}</span>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lab"),
|
||||||
|
dataIndex: "joblines_body",
|
||||||
|
key: "joblines_body",
|
||||||
|
sorter: (a, b) => a.joblines_body - b.joblines_body,
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "joblines_body" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{record.joblines_body.toFixed(1)}</span>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lar"),
|
||||||
|
dataIndex: "joblines_ref",
|
||||||
|
key: "joblines_ref",
|
||||||
|
sorter: (a, b) => a.joblines_ref - b.joblines_ref,
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "joblines_ref" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{record.joblines_ref.toFixed(1)}</span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.scheduled_delivery"),
|
||||||
|
dataIndex: "scheduled_delivery",
|
||||||
|
key: "scheduled_delivery",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => dateSort(a.scheduled_delivery, b.scheduled_delivery),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "scheduled_delivery" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => <TimeFormatter>{record.scheduled_delivery}</TimeFormatter>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ro_number"),
|
||||||
|
dataIndex: "ro_number",
|
||||||
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<Link to={"/manage/jobs/" + record.jobid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
<Space>
|
||||||
|
{record.ro_number || t("general.labels.na")}
|
||||||
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
|
) : null}
|
||||||
|
{record.suspended && <PauseCircleOutlined style={{ color: "orangered" }} />}
|
||||||
|
{record.iouparent && (
|
||||||
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.owner"),
|
||||||
|
dataIndex: "owner",
|
||||||
|
key: "owner",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.ownerid ? (
|
||||||
|
<Link to={"/manage/owners/" + record.ownerid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("dashboard.labels.phone"),
|
||||||
|
dataIndex: "ownr_ph",
|
||||||
|
key: "ownr_ph",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
render: (text, record) => (
|
||||||
|
<Space size="small" wrap>
|
||||||
|
<ChatOpenButton phone={record.ownr_ph1} jobid={record.jobid} />
|
||||||
|
|
||||||
|
<ChatOpenButton phone={record.ownr_ph2} jobid={record.jobid} />
|
||||||
|
</Space>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ownr_ea"),
|
||||||
|
dataIndex: "ownr_ea",
|
||||||
|
key: "ownr_ea",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
render: (text, record) => <a href={`mailto:${record.ownr_ea}`}>{record.ownr_ea}</a>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${a.v_model_desc || ""}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link to={"/manage/vehicles/" + record.vehicleid} onClick={(e) => e.stopPropagation()}>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ins_co_nm"),
|
||||||
|
dataIndex: "ins_co_nm",
|
||||||
|
key: "ins_co_nm",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "ins_co_nm" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(scheduledDeliveryToday &&
|
||||||
|
scheduledDeliveryToday
|
||||||
|
.map((j) => j.ins_co_nm)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || t("dashboard.errors.insco"),
|
||||||
|
value: [s]
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.ins_co_nm)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.alt_transport"),
|
||||||
|
dataIndex: "alt_transport",
|
||||||
|
key: "alt_transport",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder: state.sortedInfo.columnKey === "alt_transport" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(scheduledDeliveryToday &&
|
||||||
|
scheduledDeliveryToday
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || t("dashboard.errors.atp"),
|
||||||
|
value: [s]
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
title={t("dashboard.titles.scheduleddeliverydate", {
|
||||||
|
date: dayjs().startOf("day").format("MM/DD/YYYY")
|
||||||
|
})}
|
||||||
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Typography.Text>{t("general.labels.tvmode")}</Typography.Text>
|
||||||
|
<Switch
|
||||||
|
onClick={() => setIsTvModeScheduledDelivery(!isTvModeScheduledDelivery)}
|
||||||
|
defaultChecked={isTvModeScheduledDelivery}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
{...cardProps}
|
||||||
|
>
|
||||||
|
<div style={{ height: "100%" }}>
|
||||||
|
<Table
|
||||||
|
onChange={handleTableChange}
|
||||||
|
pagination={false}
|
||||||
|
columns={isTvModeScheduledDelivery ? tvColumns : columns}
|
||||||
|
scroll={{ x: true, y: "calc(100% - 2em)" }}
|
||||||
|
rowKey="id"
|
||||||
|
style={{ height: "85%" }}
|
||||||
|
dataSource={scheduledDeliveryToday}
|
||||||
|
size={isTvModeScheduledDelivery ? "small" : "middle"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const DashboardScheduledDeliveryTodayGql = `
|
||||||
|
scheduled_delivery_today: jobs(where: {
|
||||||
|
date_invoiced: {_is_null: true},
|
||||||
|
ro_number: {_is_null: false},
|
||||||
|
voided: {_eq: false},
|
||||||
|
scheduled_delivery: {_gte: "${dayjs().startOf("day").toISOString()}",
|
||||||
|
_lte: "${dayjs().endOf("day").toISOString()}"}}) {
|
||||||
|
alt_transport
|
||||||
|
clm_no
|
||||||
|
jobid: id
|
||||||
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
|
mod_lb_hrs
|
||||||
|
mod_lbr_ty
|
||||||
|
}
|
||||||
|
ins_co_nm
|
||||||
|
iouparent
|
||||||
|
ownerid
|
||||||
|
ownr_co_nm
|
||||||
|
ownr_ea
|
||||||
|
ownr_fn
|
||||||
|
ownr_ln
|
||||||
|
ownr_ph1
|
||||||
|
ownr_ph2
|
||||||
|
production_vars
|
||||||
|
ro_number
|
||||||
|
scheduled_delivery
|
||||||
|
status
|
||||||
|
suspended
|
||||||
|
v_make_desc
|
||||||
|
v_model_desc
|
||||||
|
v_model_yr
|
||||||
|
v_vin
|
||||||
|
vehicleid
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined } from "@ant-design/icons";
|
import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined } from "@ant-design/icons";
|
||||||
import { Card, Space, Switch, Table, Tooltip, Typography } from "antd";
|
import { Card, Space, Switch, Table, Tooltip, Typography } from "antd";
|
||||||
import dayjs from "../../../utils/day";
|
import { useState } from "react";
|
||||||
import React, { useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { TimeFormatter } from "../../../utils/DateFormatter";
|
import { TimeFormatter } from "../../../utils/DateFormatter";
|
||||||
import { onlyUnique } from "../../../utils/arrayHelper";
|
import { onlyUnique } from "../../../utils/arrayHelper";
|
||||||
|
import dayjs from "../../../utils/day";
|
||||||
import { alphaSort, dateSort } from "../../../utils/sorters";
|
import { alphaSort, dateSort } from "../../../utils/sorters";
|
||||||
import useLocalStorage from "../../../utils/useLocalStorage";
|
import useLocalStorage from "../../../utils/useLocalStorage";
|
||||||
import ChatOpenButton from "../../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../../chat-open-button/chat-open-button.component";
|
||||||
@@ -169,7 +169,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Alt. Transport",
|
text: s || t("dashboard.errors.atp"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -313,7 +313,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Ins. Co.*",
|
text: s || t("dashboard.errors.insco"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -335,7 +335,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Alt. Transport",
|
text: s || t("dashboard.errors.atp"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined } from "@ant-design/icons";
|
import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined } from "@ant-design/icons";
|
||||||
import { Card, Space, Switch, Table, Tooltip, Typography } from "antd";
|
import { Card, Space, Switch, Table, Tooltip, Typography } from "antd";
|
||||||
import dayjs from "../../../utils/day";
|
import { useState } from "react";
|
||||||
import React, { useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { TimeFormatter } from "../../../utils/DateFormatter";
|
import { TimeFormatter } from "../../../utils/DateFormatter";
|
||||||
import { onlyUnique } from "../../../utils/arrayHelper";
|
import { onlyUnique } from "../../../utils/arrayHelper";
|
||||||
|
import dayjs from "../../../utils/day";
|
||||||
import { alphaSort, dateSort } from "../../../utils/sorters";
|
import { alphaSort, dateSort } from "../../../utils/sorters";
|
||||||
import useLocalStorage from "../../../utils/useLocalStorage";
|
import useLocalStorage from "../../../utils/useLocalStorage";
|
||||||
import ChatOpenButton from "../../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../../chat-open-button/chat-open-button.component";
|
||||||
@@ -138,7 +138,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Alt. Transport*",
|
text: s || t("dashboard.errors.atp"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -154,7 +154,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
sortOrder: state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
filters:
|
filters:
|
||||||
(scheduledOutToday &&
|
(scheduledOutToday &&
|
||||||
@@ -163,7 +163,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Status*",
|
text: s || t("dashboard.errors.status"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -306,7 +306,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Ins. Co.*",
|
text: s || t("dashboard.errors.insco"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -328,7 +328,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "No Alt. Transport*",
|
text: s || t("dashboard.errors.atp"),
|
||||||
value: [s]
|
value: [s]
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,30 +1,33 @@
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import DashboardTotalProductionDollars from "../dashboard-components/total-production-dollars/total-production-dollars.component.jsx";
|
import JobLifecycleDashboardComponent, {
|
||||||
import {
|
JobLifecycleDashboardGQL
|
||||||
DashboardTotalProductionHours,
|
} from "../dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx";
|
||||||
DashboardTotalProductionHoursGql
|
|
||||||
} from "../dashboard-components/total-production-hours/total-production-hours.component.jsx";
|
|
||||||
import DashboardProjectedMonthlySales, {
|
|
||||||
DashboardProjectedMonthlySalesGql
|
|
||||||
} from "../dashboard-components/pojected-monthly-sales/projected-monthly-sales.component.jsx";
|
|
||||||
import DashboardMonthlyRevenueGraph, {
|
|
||||||
DashboardMonthlyRevenueGraphGql
|
|
||||||
} from "../dashboard-components/monthly-revenue-graph/monthly-revenue-graph.component.jsx";
|
|
||||||
import DashboardMonthlyJobCosting from "../dashboard-components/monthly-job-costing/monthly-job-costing.component.jsx";
|
|
||||||
import DashboardMonthlyPartsSales from "../dashboard-components/monthly-parts-sales/monthly-parts-sales.component.jsx";
|
|
||||||
import DashboardMonthlyLaborSales from "../dashboard-components/monthly-labor-sales/monthly-labor-sales.component.jsx";
|
|
||||||
import DashboardMonthlyEmployeeEfficiency, {
|
import DashboardMonthlyEmployeeEfficiency, {
|
||||||
DashboardMonthlyEmployeeEfficiencyGql
|
DashboardMonthlyEmployeeEfficiencyGql
|
||||||
} from "../dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx";
|
} from "../dashboard-components/monthly-employee-efficiency/monthly-employee-efficiency.component.jsx";
|
||||||
|
import DashboardMonthlyJobCosting from "../dashboard-components/monthly-job-costing/monthly-job-costing.component.jsx";
|
||||||
|
import DashboardMonthlyLaborSales from "../dashboard-components/monthly-labor-sales/monthly-labor-sales.component.jsx";
|
||||||
|
import DashboardMonthlyPartsSales from "../dashboard-components/monthly-parts-sales/monthly-parts-sales.component.jsx";
|
||||||
|
import DashboardMonthlyRevenueGraph, {
|
||||||
|
DashboardMonthlyRevenueGraphGql
|
||||||
|
} from "../dashboard-components/monthly-revenue-graph/monthly-revenue-graph.component.jsx";
|
||||||
|
import DashboardProjectedMonthlySales, {
|
||||||
|
DashboardProjectedMonthlySalesGql
|
||||||
|
} from "../dashboard-components/pojected-monthly-sales/projected-monthly-sales.component.jsx";
|
||||||
|
import DashboardScheduledDeliveryToday, {
|
||||||
|
DashboardScheduledDeliveryTodayGql
|
||||||
|
} from "../dashboard-components/scheduled-delivery-today/scheduled-delivery-today.component.jsx";
|
||||||
import DashboardScheduledInToday, {
|
import DashboardScheduledInToday, {
|
||||||
DashboardScheduledInTodayGql
|
DashboardScheduledInTodayGql
|
||||||
} from "../dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx";
|
} from "../dashboard-components/scheduled-in-today/scheduled-in-today.component.jsx";
|
||||||
import DashboardScheduledOutToday, {
|
import DashboardScheduledOutToday, {
|
||||||
DashboardScheduledOutTodayGql
|
DashboardScheduledOutTodayGql
|
||||||
} from "../dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx";
|
} from "../dashboard-components/scheduled-out-today/scheduled-out-today.component.jsx";
|
||||||
import JobLifecycleDashboardComponent, {
|
import DashboardTotalProductionDollars from "../dashboard-components/total-production-dollars/total-production-dollars.component.jsx";
|
||||||
JobLifecycleDashboardGQL
|
import {
|
||||||
} from "../dashboard-components/job-lifecycle/job-lifecycle-dashboard.component.jsx";
|
DashboardTotalProductionHours,
|
||||||
|
DashboardTotalProductionHoursGql
|
||||||
|
} from "../dashboard-components/total-production-hours/total-production-hours.component.jsx";
|
||||||
|
|
||||||
const componentList = {
|
const componentList = {
|
||||||
ProductionDollars: {
|
ProductionDollars: {
|
||||||
@@ -118,6 +121,15 @@ const componentList = {
|
|||||||
w: 10,
|
w: 10,
|
||||||
h: 3
|
h: 3
|
||||||
},
|
},
|
||||||
|
ScheduleDeliveryToday: {
|
||||||
|
label: i18next.t("dashboard.titles.scheduleddeliverytoday"),
|
||||||
|
component: DashboardScheduledDeliveryToday,
|
||||||
|
gqlFragment: DashboardScheduledDeliveryTodayGql,
|
||||||
|
minW: 6,
|
||||||
|
minH: 2,
|
||||||
|
w: 10,
|
||||||
|
h: 3
|
||||||
|
},
|
||||||
JobLifecycle: {
|
JobLifecycle: {
|
||||||
label: i18next.t("dashboard.titles.joblifecycle"),
|
label: i18next.t("dashboard.titles.joblifecycle"),
|
||||||
component: JobLifecycleDashboardComponent,
|
component: JobLifecycleDashboardComponent,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { DatePicker, Space, TimePicker } from "antd";
|
import { DatePicker, Space, TimePicker } from "antd";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import React, { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -94,7 +94,24 @@ const DateTimePicker = ({
|
|||||||
showTime={false}
|
showTime={false}
|
||||||
format="MM/DD/YYYY"
|
format="MM/DD/YYYY"
|
||||||
value={value ? dayjs(value) : null}
|
value={value ? dayjs(value) : null}
|
||||||
onChange={handleChange}
|
onChange={(dateValue) => {
|
||||||
|
if (dateValue) {
|
||||||
|
// When date changes, preserve the existing time if it exists
|
||||||
|
if (value && dayjs(value).isValid()) {
|
||||||
|
const existingTime = dayjs(value);
|
||||||
|
const newDateTime = dayjs(dateValue)
|
||||||
|
.hour(existingTime.hour())
|
||||||
|
.minute(existingTime.minute())
|
||||||
|
.second(existingTime.second());
|
||||||
|
handleChange(newDateTime);
|
||||||
|
} else {
|
||||||
|
// If no existing time, just set the date without time
|
||||||
|
handleChange(dateValue);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
handleChange(dateValue);
|
||||||
|
}
|
||||||
|
}}
|
||||||
placeholder={t("general.labels.date")}
|
placeholder={t("general.labels.date")}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
disabledDate={handleDisabledDate}
|
disabledDate={handleDisabledDate}
|
||||||
@@ -105,13 +122,25 @@ const DateTimePicker = ({
|
|||||||
<TimePicker
|
<TimePicker
|
||||||
format="hh:mm a"
|
format="hh:mm a"
|
||||||
minuteStep={15}
|
minuteStep={15}
|
||||||
|
value={value && dayjs(value).hour() === 0 && dayjs(value).minute() === 0 ? null : dayjs(value)}
|
||||||
defaultOpenValue={dayjs(value)
|
defaultOpenValue={dayjs(value)
|
||||||
.hour(dayjs().hour())
|
.hour(dayjs().hour())
|
||||||
.minute(Math.floor(dayjs().minute() / 15) * 15)
|
.minute(Math.floor(dayjs().minute() / 15) * 15)
|
||||||
.second(0)}
|
.second(0)}
|
||||||
onChange={(value) => {
|
onChange={(timeValue) => {
|
||||||
handleChange(value);
|
if (timeValue) {
|
||||||
onBlur();
|
// When time changes, combine it with the existing date
|
||||||
|
const existingDate = dayjs(value);
|
||||||
|
const newDateTime = existingDate
|
||||||
|
.hour(timeValue.hour())
|
||||||
|
.minute(timeValue.minute())
|
||||||
|
.second(0);
|
||||||
|
handleChange(newDateTime);
|
||||||
|
} else {
|
||||||
|
// If time is cleared, just update with null time but keep date
|
||||||
|
handleChange(timeValue);
|
||||||
|
}
|
||||||
|
if (onBlur) onBlur();
|
||||||
}}
|
}}
|
||||||
placeholder={t("general.labels.time")}
|
placeholder={t("general.labels.time")}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
|
|||||||
@@ -385,7 +385,9 @@ export function ScheduleEventComponent({
|
|||||||
previousEvent: event.id,
|
previousEvent: event.id,
|
||||||
color: event.color,
|
color: event.color,
|
||||||
alt_transport: event.job && event.job.alt_transport,
|
alt_transport: event.job && event.job.alt_transport,
|
||||||
note: event.note
|
note: event.note,
|
||||||
|
scheduled_in: event.job && event.job.scheduled_in,
|
||||||
|
scheduled_completion: event.job && event.job.scheduled_completion
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { PushpinFilled, PushpinOutlined } from "@ant-design/icons";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { GET_JOB_BY_PK } from "../../graphql/jobs.queries";
|
||||||
|
import { UPDATE_NOTE } from "../../graphql/notes.queries";
|
||||||
|
|
||||||
|
function JobNotesPinToggle({ note }) {
|
||||||
|
const [updateNote] = useMutation(UPDATE_NOTE, {
|
||||||
|
update(cache, { data: { updateNote: updatedNote } }) {
|
||||||
|
try {
|
||||||
|
const existingJob = cache.readQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: note.jobid }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (existingJob) {
|
||||||
|
cache.writeQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: note.jobid },
|
||||||
|
data: {
|
||||||
|
...existingJob,
|
||||||
|
job: {
|
||||||
|
...existingJob.job,
|
||||||
|
notes: updatedNote.pinned
|
||||||
|
? [updatedNote, ...existingJob.job.notes]
|
||||||
|
: existingJob.job.notes.filter((n) => n.id !== updatedNote.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Query not yet executed is most likely. No logging as this isn't a fatal error.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const handlePinToggle = () => {
|
||||||
|
updateNote({
|
||||||
|
variables: {
|
||||||
|
noteId: note.id,
|
||||||
|
note: { pinned: !note.pinned }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return note.pinned ? (
|
||||||
|
<PushpinFilled size="large" onClick={handlePinToggle} style={{ color: "gold" }} />
|
||||||
|
) : (
|
||||||
|
<PushpinOutlined size="large" onClick={handlePinToggle} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default JobNotesPinToggle;
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Form, Statistic, Tooltip } from "antd";
|
import { Form, Statistic, Tooltip } from "antd";
|
||||||
import React, { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
import FormRow from "../layout-form-row/layout-form-row.component";
|
import FormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import dayjs from "../../utils/day";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -43,14 +43,14 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.estimate_sent_approval")} name="estimate_sent_approval">
|
<Form.Item label={t("jobs.fields.estimate_sent_approval")} name="estimate_sent_approval">
|
||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
disabled={true}
|
disabled={jobRO}
|
||||||
value={job.estimate_sent_approval ? dayjs(job.estimate_sent_approval) : null}
|
value={job.estimate_sent_approval ? dayjs(job.estimate_sent_approval) : null}
|
||||||
placeholder={t("general.labels.na")}
|
placeholder={t("general.labels.na")}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.estimate_approved")} name="estimate_approved">
|
<Form.Item label={t("jobs.fields.estimate_approved")} name="estimate_approved">
|
||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
disabled={true}
|
disabled={jobRO}
|
||||||
value={job.estimate_approved ? dayjs(job.estimate_approved) : null}
|
value={job.estimate_approved ? dayjs(job.estimate_approved) : null}
|
||||||
placeholder={t("general.labels.na")}
|
placeholder={t("general.labels.na")}
|
||||||
/>
|
/>
|
||||||
@@ -63,7 +63,7 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Tooltip title={t("jobs.labels.scheduledinchange")}>
|
<Tooltip title={t("jobs.labels.scheduledinchange")}>
|
||||||
<Form.Item label={t("jobs.fields.scheduled_in")} name="scheduled_in">
|
<Form.Item label={t("jobs.fields.scheduled_in")} name="scheduled_in">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Form.Item label={t("jobs.fields.actual_in")} name="actual_in">
|
<Form.Item label={t("jobs.fields.actual_in")} name="actual_in">
|
||||||
@@ -110,16 +110,16 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
|
|||||||
</FormRow>
|
</FormRow>
|
||||||
<FormRow header={t("jobs.forms.admindates")}>
|
<FormRow header={t("jobs.forms.admindates")}>
|
||||||
<Form.Item label={t("jobs.fields.date_invoiced")} name="date_invoiced">
|
<Form.Item label={t("jobs.fields.date_invoiced")} name="date_invoiced">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_exported")} name="date_exported">
|
<Form.Item label={t("jobs.fields.date_exported")} name="date_exported">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
<Form.Item label={t("jobs.fields.date_void")} name="date_void">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.date_lost_sale")} name="date_lost_sale">
|
<Form.Item label={t("jobs.fields.date_lost_sale")} name="date_lost_sale">
|
||||||
<DateTimePicker disabled={true || jobRO} />
|
<DateTimePicker disabled={true} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -673,7 +673,9 @@ export function JobsDetailHeaderActions({
|
|||||||
context: {
|
context: {
|
||||||
jobId: job.id,
|
jobId: job.id,
|
||||||
job: job,
|
job: job,
|
||||||
alt_transport: job.alt_transport
|
alt_transport: job.alt_transport,
|
||||||
|
scheduled_in: job.scheduled_in,
|
||||||
|
scheduled_completion: job.scheduled_completion
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1090,11 +1092,7 @@ export function JobsDetailHeaderActions({
|
|||||||
{t("menus.jobsactions.deletejob")}
|
{t("menus.jobsactions.deletejob")}
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
) : (
|
) : (
|
||||||
<Popconfirm
|
<Popconfirm title={t("jobs.labels.deletewatchers")} onClick={(e) => e.stopPropagation()} showCancel={false}>
|
||||||
title={t("jobs.labels.deletewatchers")}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
showCancel={false}
|
|
||||||
>
|
|
||||||
{t("menus.jobsactions.deletejob")}
|
{t("menus.jobsactions.deletejob")}
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import JobAltTransportChange from "../job-at-change/job-at-change.component";
|
|||||||
import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container";
|
import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container";
|
||||||
import JobsRelatedRos from "../jobs-related-ros/jobs-related-ros.component";
|
import JobsRelatedRos from "../jobs-related-ros/jobs-related-ros.component";
|
||||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
||||||
|
import PinnedJobNotes from "../pinned-job-notes/pinned-job-notes.component.jsx";
|
||||||
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
||||||
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
|
||||||
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
|
import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component";
|
||||||
@@ -102,254 +103,257 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail })
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]} style={{ alignItems: "stretch" }}>
|
<>
|
||||||
<Col {...colSpan}>
|
<Row gutter={[16, 16]} style={{ alignItems: "stretch" }}>
|
||||||
<Card title={"Job Status"} style={{ height: "100%" }}>
|
<Col {...colSpan}>
|
||||||
<div>
|
<Card title={"Job Status"} style={{ height: "100%" }}>
|
||||||
<DataLabel label={t("jobs.fields.status")}>
|
<div>
|
||||||
|
<DataLabel label={t("jobs.fields.status")}>
|
||||||
|
<Space wrap>
|
||||||
|
{job.status}
|
||||||
|
{job.inproduction && <Tag color="#f50">{t("jobs.labels.inproduction")}</Tag>}
|
||||||
|
{job.suspended && <PauseCircleOutlined style={{ color: "orangered" }} />}
|
||||||
|
{job.iouparent && (
|
||||||
|
<Link to={`/manage/jobs/${job.iouparent}`}>
|
||||||
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
|
</Tooltip>
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
{job.production_vars && job.production_vars.alert ? (
|
||||||
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
|
) : null}
|
||||||
|
{job.status === bodyshop.md_ro_statuses.default_scheduled && job.scheduled_in ? (
|
||||||
|
<Tag>
|
||||||
|
<Link to={`/manage/schedule?date=${dayjs(job.scheduled_in).format("YYYY-MM-DD")}`}>
|
||||||
|
<DateTimeFormatter>{job.scheduled_in}</DateTimeFormatter>
|
||||||
|
</Link>
|
||||||
|
</Tag>
|
||||||
|
) : null}
|
||||||
|
</Space>
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.comment")} valueStyle={{ overflow: "hidden", textOverflow: "ellipsis" }}>
|
||||||
|
<ProductionListColumnComment record={job} />
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.ins_co_nm_short")}>{job.ins_co_nm}</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.clm_no")}>{job.clm_no}</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.ponumber")} hideIfNull>
|
||||||
|
{job.po_number}
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.repairtotal")}>
|
||||||
|
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
|
||||||
|
<span style={{ margin: "0rem .5rem" }}>/</span>
|
||||||
|
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.alt_transport")}>
|
||||||
|
{job.alt_transport}
|
||||||
|
<JobAltTransportChange job={job} />
|
||||||
|
</DataLabel>
|
||||||
|
{job?.cccontracts?.length > 0 && (
|
||||||
|
<DataLabel label={t("jobs.labels.contracts")}>
|
||||||
|
{job.cccontracts.map((c, index) => (
|
||||||
|
<Space key={c.id} wrap>
|
||||||
|
<Link to={`/manage/courtesycars/contracts/${c.id}`}>
|
||||||
|
{`${c.agreementnumber} - ${c.courtesycar.fleetnumber} ${c.courtesycar.year} ${c.courtesycar.make} ${c.courtesycar.model}`}
|
||||||
|
{index !== job.cccontracts.length - 1 ? "," : null}
|
||||||
|
</Link>
|
||||||
|
</Space>
|
||||||
|
))}
|
||||||
|
</DataLabel>
|
||||||
|
)}
|
||||||
|
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
||||||
|
<ProductionListColumnProductionNote record={job} />
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.estimate_sent_approval")}>
|
||||||
|
<Space>
|
||||||
|
<Checkbox
|
||||||
|
checked={!!job.estimate_sent_approval}
|
||||||
|
onChange={(e) => handleCheckboxChange("estimate_sent_approval", e.target.checked)}
|
||||||
|
disabled={disabled}
|
||||||
|
>
|
||||||
|
{job.estimate_sent_approval && (
|
||||||
|
<span style={{ color: "#888" }}>
|
||||||
|
<DateTimeFormatter>{job.estimate_sent_approval}</DateTimeFormatter>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</Checkbox>
|
||||||
|
</Space>
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.estimate_approved")}>
|
||||||
|
<Space>
|
||||||
|
<Checkbox
|
||||||
|
checked={!!job.estimate_approved}
|
||||||
|
onChange={(e) => handleCheckboxChange("estimate_approved", e.target.checked)}
|
||||||
|
disabled={disabled}
|
||||||
|
>
|
||||||
|
{job.estimate_approved && (
|
||||||
|
<span style={{ color: "#888" }}>
|
||||||
|
<DateTimeFormatter>{job.estimate_approved}</DateTimeFormatter>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</Checkbox>
|
||||||
|
</Space>
|
||||||
|
</DataLabel>
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{job.status}
|
{job.special_coverage_policy && (
|
||||||
{job.inproduction && <Tag color="#f50">{t("jobs.labels.inproduction")}</Tag>}
|
<Tag color="tomato">
|
||||||
{job.suspended && <PauseCircleOutlined style={{ color: "orangered" }} />}
|
<Space>
|
||||||
{job.iouparent && (
|
<WarningFilled />
|
||||||
<Link to={`/manage/jobs/${job.iouparent}`}>
|
<span>{t("jobs.labels.specialcoveragepolicy")}</span>
|
||||||
<Tooltip title={t("jobs.labels.iou")}>
|
</Space>
|
||||||
<BranchesOutlined style={{ color: "orangered" }} />
|
|
||||||
</Tooltip>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
{job.production_vars && job.production_vars.alert ? (
|
|
||||||
<ExclamationCircleFilled className="production-alert" />
|
|
||||||
) : null}
|
|
||||||
{job.status === bodyshop.md_ro_statuses.default_scheduled && job.scheduled_in ? (
|
|
||||||
<Tag>
|
|
||||||
<Link to={`/manage/schedule?date=${dayjs(job.scheduled_in).format("YYYY-MM-DD")}`}>
|
|
||||||
<DateTimeFormatter>{job.scheduled_in}</DateTimeFormatter>
|
|
||||||
</Link>
|
|
||||||
</Tag>
|
</Tag>
|
||||||
) : null}
|
)}
|
||||||
|
{job.ca_gst_registrant && (
|
||||||
|
<Tag color="geekblue">
|
||||||
|
<Space>
|
||||||
|
<WarningFilled />
|
||||||
|
<span>{t("jobs.fields.ca_gst_registrant")}</span>
|
||||||
|
</Space>
|
||||||
|
</Tag>
|
||||||
|
)}
|
||||||
|
{job.hit_and_run && (
|
||||||
|
<Tag color="green">
|
||||||
|
<Space>
|
||||||
|
<WarningFilled />
|
||||||
|
<span>{t("jobs.fields.hit_and_run")}</span>
|
||||||
|
</Space>
|
||||||
|
</Tag>
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
</DataLabel>
|
</div>
|
||||||
<DataLabel label={t("jobs.fields.comment")} valueStyle={{ overflow: "hidden", textOverflow: "ellipsis" }}>
|
</Card>
|
||||||
<ProductionListColumnComment record={job} />
|
</Col>
|
||||||
</DataLabel>
|
<Col {...colSpan}>
|
||||||
<DataLabel label={t("jobs.fields.ins_co_nm_short")}>{job.ins_co_nm}</DataLabel>
|
<Card
|
||||||
<DataLabel label={t("jobs.fields.clm_no")}>{job.clm_no}</DataLabel>
|
style={{ height: "100%" }}
|
||||||
<DataLabel label={t("jobs.fields.ponumber")} hideIfNull>
|
title={
|
||||||
{job.po_number}
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.fields.repairtotal")}>
|
|
||||||
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
|
|
||||||
<span style={{ margin: "0rem .5rem" }}>/</span>
|
|
||||||
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.fields.alt_transport")}>
|
|
||||||
{job.alt_transport}
|
|
||||||
<JobAltTransportChange job={job} />
|
|
||||||
</DataLabel>
|
|
||||||
{job?.cccontracts?.length > 0 && (
|
|
||||||
<DataLabel label={t("jobs.labels.contracts")}>
|
|
||||||
{job.cccontracts.map((c, index) => (
|
|
||||||
<Space key={c.id} wrap>
|
|
||||||
<Link to={`/manage/courtesycars/contracts/${c.id}`}>
|
|
||||||
{`${c.agreementnumber} - ${c.courtesycar.fleetnumber} ${c.courtesycar.year} ${c.courtesycar.make} ${c.courtesycar.model}`}
|
|
||||||
{index !== job.cccontracts.length - 1 ? "," : null}
|
|
||||||
</Link>
|
|
||||||
</Space>
|
|
||||||
))}
|
|
||||||
</DataLabel>
|
|
||||||
)}
|
|
||||||
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
|
||||||
<ProductionListColumnProductionNote record={job} />
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.fields.estimate_sent_approval")}>
|
|
||||||
<Space>
|
|
||||||
<Checkbox
|
|
||||||
checked={!!job.estimate_sent_approval}
|
|
||||||
onChange={(e) => handleCheckboxChange("estimate_sent_approval", e.target.checked)}
|
|
||||||
disabled={disabled}
|
|
||||||
>
|
|
||||||
{job.estimate_sent_approval && (
|
|
||||||
<span style={{ color: "#888" }}>
|
|
||||||
<DateTimeFormatter>{job.estimate_sent_approval}</DateTimeFormatter>
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</Checkbox>
|
|
||||||
</Space>
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.fields.estimate_approved")}>
|
|
||||||
<Space>
|
|
||||||
<Checkbox
|
|
||||||
checked={!!job.estimate_approved}
|
|
||||||
onChange={(e) => handleCheckboxChange("estimate_approved", e.target.checked)}
|
|
||||||
disabled={disabled}
|
|
||||||
>
|
|
||||||
{job.estimate_approved && (
|
|
||||||
<span style={{ color: "#888" }}>
|
|
||||||
<DateTimeFormatter>{job.estimate_approved}</DateTimeFormatter>
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</Checkbox>
|
|
||||||
</Space>
|
|
||||||
</DataLabel>
|
|
||||||
<Space wrap>
|
|
||||||
{job.special_coverage_policy && (
|
|
||||||
<Tag color="tomato">
|
|
||||||
<Space>
|
|
||||||
<WarningFilled />
|
|
||||||
<span>{t("jobs.labels.specialcoveragepolicy")}</span>
|
|
||||||
</Space>
|
|
||||||
</Tag>
|
|
||||||
)}
|
|
||||||
{job.ca_gst_registrant && (
|
|
||||||
<Tag color="geekblue">
|
|
||||||
<Space>
|
|
||||||
<WarningFilled />
|
|
||||||
<span>{t("jobs.fields.ca_gst_registrant")}</span>
|
|
||||||
</Space>
|
|
||||||
</Tag>
|
|
||||||
)}
|
|
||||||
{job.hit_and_run && (
|
|
||||||
<Tag color="green">
|
|
||||||
<Space>
|
|
||||||
<WarningFilled />
|
|
||||||
<span>{t("jobs.fields.hit_and_run")}</span>
|
|
||||||
</Space>
|
|
||||||
</Tag>
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</Col>
|
|
||||||
<Col {...colSpan}>
|
|
||||||
<Card
|
|
||||||
style={{ height: "100%" }}
|
|
||||||
title={
|
|
||||||
disabled ? (
|
|
||||||
<>{ownerTitle.length > 0 ? ownerTitle : t("owner.labels.noownerinfo")}</>
|
|
||||||
) : (
|
|
||||||
<Link to={`/manage/owners/${job.owner.id}`}>
|
|
||||||
{ownerTitle.length > 0 ? ownerTitle : t("owner.labels.noownerinfo")}
|
|
||||||
</Link>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<DataLabel key="2" label={t("jobs.fields.ownr_ph1")}>
|
|
||||||
{disabled ? (
|
|
||||||
<PhoneNumberFormatter>{job.ownr_ph1}</PhoneNumberFormatter>
|
|
||||||
) : (
|
|
||||||
<ChatOpenButton phone={job.ownr_ph1} jobid={job.id} />
|
|
||||||
)}
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel key="22" label={t("jobs.fields.ownr_ph2")}>
|
|
||||||
{disabled ? (
|
|
||||||
<PhoneNumberFormatter>{job.ownr_ph2}</PhoneNumberFormatter>
|
|
||||||
) : (
|
|
||||||
<ChatOpenButton phone={job.ownr_ph2} jobid={job.id} />
|
|
||||||
)}
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel key="3" label={t("owners.fields.address")}>
|
|
||||||
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
|
|
||||||
job.ownr_city || ""
|
|
||||||
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel key="4" label={t("owners.fields.ownr_ea")}>
|
|
||||||
{disabled ? (
|
|
||||||
<>{job.ownr_ea || ""}</>
|
|
||||||
) : job.ownr_ea ? (
|
|
||||||
<a href={`mailto:${job.ownr_ea}`}>{job.ownr_ea}</a>
|
|
||||||
) : null}
|
|
||||||
</DataLabel>
|
|
||||||
{job.owner?.tax_number && (
|
|
||||||
<DataLabel key="5" label={t("owners.fields.tax_number")}>
|
|
||||||
{job.owner?.tax_number || ""}
|
|
||||||
</DataLabel>
|
|
||||||
)}
|
|
||||||
<DataLabel label={t("owners.fields.note")} valueStyle={{ overflow: "hidden", textOverflow: "ellipsis" }}>
|
|
||||||
{job.owner?.note || ""}
|
|
||||||
</DataLabel>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</Col>
|
|
||||||
<Col {...colSpan}>
|
|
||||||
<Card
|
|
||||||
style={{ height: "100%" }}
|
|
||||||
title={
|
|
||||||
job.vehicle ? (
|
|
||||||
disabled ? (
|
disabled ? (
|
||||||
<>{vehicleTitle.length > 0 ? vehicleTitle : t("vehicles.labels.novehinfo")} </>
|
<>{ownerTitle.length > 0 ? ownerTitle : t("owner.labels.noownerinfo")}</>
|
||||||
) : (
|
) : (
|
||||||
<Link to={job.vehicle && `/manage/vehicles/${job.vehicle.id}`}>
|
<Link to={`/manage/owners/${job.owner.id}`}>
|
||||||
{vehicleTitle.length > 0 ? vehicleTitle : t("vehicles.labels.novehinfo")}
|
{ownerTitle.length > 0 ? ownerTitle : t("owner.labels.noownerinfo")}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
) : (
|
}
|
||||||
<span></span>
|
>
|
||||||
)
|
<div>
|
||||||
}
|
<DataLabel key="2" label={t("jobs.fields.ownr_ph1")}>
|
||||||
>
|
{disabled ? (
|
||||||
<div>
|
<PhoneNumberFormatter>{job.ownr_ph1}</PhoneNumberFormatter>
|
||||||
<DataLabel key="2" label={t("vehicles.fields.plate_no")}>
|
) : (
|
||||||
{`${job.plate_no || t("general.labels.na")} (${`${job.plate_st || t("general.labels.na")}`})`}
|
<ChatOpenButton phone={job.ownr_ph1} jobid={job.id} />
|
||||||
</DataLabel>
|
)}
|
||||||
<DataLabel key="4" label={t("vehicles.fields.v_vin")}>
|
|
||||||
<VehicleVinDisplay>{`${job.v_vin || t("general.labels.na")}`}</VehicleVinDisplay>
|
|
||||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
|
||||||
job.v_vin?.length !== 17 ? (
|
|
||||||
<WarningFilled style={{ color: "tomato", marginLeft: ".3rem" }} />
|
|
||||||
) : null
|
|
||||||
) : null}
|
|
||||||
</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.fields.regie_number")}>{job.regie_number || t("general.labels.na")}</DataLabel>
|
|
||||||
<DataLabel label={t("jobs.labels.relatedros")}>
|
|
||||||
<JobsRelatedRos jobid={job.id} job={job} disabled={disabled} />
|
|
||||||
</DataLabel>
|
|
||||||
{job.vehicle && job.vehicle.notes && (
|
|
||||||
<DataLabel
|
|
||||||
label={t("vehicles.fields.notes")}
|
|
||||||
valueStyle={{ whiteSpace: "pre-wrap" }}
|
|
||||||
valueClassName={notesClamped ? "clamp" : ""}
|
|
||||||
onValueClick={() => setNotesClamped(!notesClamped)}
|
|
||||||
>
|
|
||||||
{job.vehicle.notes}
|
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
)}
|
<DataLabel key="22" label={t("jobs.fields.ownr_ph2")}>
|
||||||
{job.vehicle && job.vehicle.v_paint_codes && (
|
{disabled ? (
|
||||||
<DataLabel label={t("vehicles.fields.v_paint_codes", { number: "" })}>
|
<PhoneNumberFormatter>{job.ownr_ph2}</PhoneNumberFormatter>
|
||||||
<span style={{ whiteSpace: "pre" }}>
|
) : (
|
||||||
{Object.keys(job.vehicle.v_paint_codes)
|
<ChatOpenButton phone={job.ownr_ph2} jobid={job.id} />
|
||||||
.filter(
|
)}
|
||||||
(key) =>
|
|
||||||
job.vehicle.v_paint_codes[key] !== "" &&
|
|
||||||
job.vehicle.v_paint_codes[key] !== null &&
|
|
||||||
job.vehicle.v_paint_codes[key] !== undefined
|
|
||||||
)
|
|
||||||
.map((key, idx) => (
|
|
||||||
<Tag key={idx}>{job.vehicle.v_paint_codes[key]}</Tag>
|
|
||||||
))}
|
|
||||||
</span>
|
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
)}
|
<DataLabel key="3" label={t("owners.fields.address")}>
|
||||||
</div>
|
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
|
||||||
</Card>
|
job.ownr_city || ""
|
||||||
</Col>
|
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
|
||||||
<Col {...colSpan}>
|
</DataLabel>
|
||||||
<Card
|
<DataLabel key="4" label={t("owners.fields.ownr_ea")}>
|
||||||
style={{ height: "100%" }}
|
{disabled ? (
|
||||||
title={<span id="job-employee-assignments-title">{t("jobs.labels.employeeassignments")}</span>}
|
<>{job.ownr_ea || ""}</>
|
||||||
id={"job-employee-assignments"}
|
) : job.ownr_ea ? (
|
||||||
>
|
<a href={`mailto:${job.ownr_ea}`}>{job.ownr_ea}</a>
|
||||||
<div>
|
) : null}
|
||||||
<JobEmployeeAssignments job={job} />
|
</DataLabel>
|
||||||
<Divider style={{ margin: ".5rem" }} />
|
{job.owner?.tax_number && (
|
||||||
<DataLabel label={t("jobs.labels.labor_hrs")}>
|
<DataLabel key="5" label={t("owners.fields.tax_number")}>
|
||||||
{bodyHrs.toFixed(1)} / {refinishHrs.toFixed(1)} / {(bodyHrs + refinishHrs).toFixed(1)}
|
{job.owner?.tax_number || ""}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
</div>
|
)}
|
||||||
</Card>
|
<DataLabel label={t("owners.fields.note")} valueStyle={{ overflow: "hidden", textOverflow: "ellipsis" }}>
|
||||||
</Col>
|
{job.owner?.note || ""}
|
||||||
</Row>
|
</DataLabel>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
<Col {...colSpan}>
|
||||||
|
<Card
|
||||||
|
style={{ height: "100%" }}
|
||||||
|
title={
|
||||||
|
job.vehicle ? (
|
||||||
|
disabled ? (
|
||||||
|
<>{vehicleTitle.length > 0 ? vehicleTitle : t("vehicles.labels.novehinfo")} </>
|
||||||
|
) : (
|
||||||
|
<Link to={job.vehicle && `/manage/vehicles/${job.vehicle.id}`}>
|
||||||
|
{vehicleTitle.length > 0 ? vehicleTitle : t("vehicles.labels.novehinfo")}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<span></span>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<DataLabel key="2" label={t("vehicles.fields.plate_no")}>
|
||||||
|
{`${job.plate_no || t("general.labels.na")} (${`${job.plate_st || t("general.labels.na")}`})`}
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel key="4" label={t("vehicles.fields.v_vin")}>
|
||||||
|
<VehicleVinDisplay>{`${job.v_vin || t("general.labels.na")}`}</VehicleVinDisplay>
|
||||||
|
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||||
|
job.v_vin?.length !== 17 ? (
|
||||||
|
<WarningFilled style={{ color: "tomato", marginLeft: ".3rem" }} />
|
||||||
|
) : null
|
||||||
|
) : null}
|
||||||
|
</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.fields.regie_number")}>{job.regie_number || t("general.labels.na")}</DataLabel>
|
||||||
|
<DataLabel label={t("jobs.labels.relatedros")}>
|
||||||
|
<JobsRelatedRos jobid={job.id} job={job} disabled={disabled} />
|
||||||
|
</DataLabel>
|
||||||
|
{job.vehicle && job.vehicle.notes && (
|
||||||
|
<DataLabel
|
||||||
|
label={t("vehicles.fields.notes")}
|
||||||
|
valueStyle={{ whiteSpace: "pre-wrap" }}
|
||||||
|
valueClassName={notesClamped ? "clamp" : ""}
|
||||||
|
onValueClick={() => setNotesClamped(!notesClamped)}
|
||||||
|
>
|
||||||
|
{job.vehicle.notes}
|
||||||
|
</DataLabel>
|
||||||
|
)}
|
||||||
|
{job.vehicle && job.vehicle.v_paint_codes && (
|
||||||
|
<DataLabel label={t("vehicles.fields.v_paint_codes", { number: "" })}>
|
||||||
|
<span style={{ whiteSpace: "pre" }}>
|
||||||
|
{Object.keys(job.vehicle.v_paint_codes)
|
||||||
|
.filter(
|
||||||
|
(key) =>
|
||||||
|
job.vehicle.v_paint_codes[key] !== "" &&
|
||||||
|
job.vehicle.v_paint_codes[key] !== null &&
|
||||||
|
job.vehicle.v_paint_codes[key] !== undefined
|
||||||
|
)
|
||||||
|
.map((key, idx) => (
|
||||||
|
<Tag key={idx}>{job.vehicle.v_paint_codes[key]}</Tag>
|
||||||
|
))}
|
||||||
|
</span>
|
||||||
|
</DataLabel>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
<Col {...colSpan}>
|
||||||
|
<Card
|
||||||
|
style={{ height: "100%" }}
|
||||||
|
title={<span id="job-employee-assignments-title">{t("jobs.labels.employeeassignments")}</span>}
|
||||||
|
id={"job-employee-assignments"}
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<JobEmployeeAssignments job={job} />
|
||||||
|
<Divider style={{ margin: ".5rem" }} />
|
||||||
|
<DataLabel label={t("jobs.labels.labor_hrs")}>
|
||||||
|
{bodyHrs.toFixed(1)} / {refinishHrs.toFixed(1)} / {(bodyHrs + refinishHrs).toFixed(1)}
|
||||||
|
</DataLabel>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<PinnedJobNotes job={job} />
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Button, Card, Input, Space, Table, Typography } from "antd";
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
@@ -20,7 +20,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = () => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -203,6 +203,8 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
|
id="all-jobs-list"
|
||||||
|
title={t("titles.bc.jobs-all")}
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{search.search && (
|
{search.search && (
|
||||||
@@ -256,6 +258,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={search?.search ? openSearchResults : jobs}
|
dataSource={search?.search ? openSearchResults : jobs}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
|
id="all-jobs-list-table"
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { BranchesOutlined, ExclamationCircleFilled, PauseCircleOutlined, SyncOut
|
|||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
@@ -22,7 +22,7 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({});
|
const mapDispatchToProps = () => ({});
|
||||||
|
|
||||||
export function JobsList({ bodyshop }) {
|
export function JobsList({ bodyshop }) {
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
@@ -342,13 +342,14 @@ export function JobsList({ bodyshop }) {
|
|||||||
type: "radio"
|
type: "radio"
|
||||||
}}
|
}}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record) => {
|
||||||
return {
|
return {
|
||||||
onClick: (event) => {
|
onClick: () => {
|
||||||
handleOnRowClick(record);
|
handleOnRowClick(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
id="active-jobs-list-table"
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import useLocalStorage from "../../utils/useLocalStorage";
|
|||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container";
|
import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container";
|
||||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||||
|
import JobNotesPinToggle from "../job-notes-pin-toggle/job-notes-pin-toggle.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly
|
jobRO: selectJobReadOnly
|
||||||
@@ -47,6 +48,9 @@ export function JobNotesComponent({
|
|||||||
key: "icons",
|
key: "icons",
|
||||||
width: 80,
|
width: 80,
|
||||||
filteredValue: filter?.icons || null,
|
filteredValue: filter?.icons || null,
|
||||||
|
defaultSortOrder: "desc",
|
||||||
|
multiple: 1,
|
||||||
|
sorter: (a, b) => a.pinned - b.pinned,
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
text: t("notes.labels.usernotes"),
|
text: t("notes.labels.usernotes"),
|
||||||
@@ -63,6 +67,7 @@ export function JobNotesComponent({
|
|||||||
{record.critical ? <WarningFilled style={{ margin: 4, color: "red" }} /> : null}
|
{record.critical ? <WarningFilled style={{ margin: 4, color: "red" }} /> : null}
|
||||||
{record.private ? <EyeInvisibleFilled style={{ margin: 4 }} /> : null}
|
{record.private ? <EyeInvisibleFilled style={{ margin: 4 }} /> : null}
|
||||||
{record.audit ? <AuditOutlined style={{ margin: 4 }} /> : null}
|
{record.audit ? <AuditOutlined style={{ margin: 4 }} /> : null}
|
||||||
|
<JobNotesPinToggle note={record} />
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@@ -100,6 +105,7 @@ export function JobNotesComponent({
|
|||||||
dataIndex: "updated_at",
|
dataIndex: "updated_at",
|
||||||
key: "updated_at",
|
key: "updated_at",
|
||||||
defaultSortOrder: "descend",
|
defaultSortOrder: "descend",
|
||||||
|
multiple: 2,
|
||||||
width: 200,
|
width: 200,
|
||||||
sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at),
|
sorter: (a, b) => new Date(a.updated_at) - new Date(b.updated_at),
|
||||||
render: (text, record) => <DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
render: (text, record) => <DateTimeFormatter>{record.updated_at}</DateTimeFormatter>
|
||||||
|
|||||||
@@ -23,17 +23,22 @@ export function NoteUpsertModalComponent({ form, noteUpsertModal }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={8}>
|
<Col span={6}>
|
||||||
<Form.Item label={t("notes.fields.critical")} name="critical" valuePropName="checked">
|
<Form.Item label={t("notes.fields.critical")} name="critical" valuePropName="checked">
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={6}>
|
||||||
<Form.Item label={t("notes.fields.private")} name="private" valuePropName="checked">
|
<Form.Item label={t("notes.fields.private")} name="private" valuePropName="checked">
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8}>
|
<Col span={6}>
|
||||||
|
<Form.Item label={t("notes.fields.pinned")} name="pinned" valuePropName="checked">
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
</Col>
|
||||||
|
<Col span={6}>
|
||||||
<Form.Item label={t("notes.fields.type")} name="type" initialValue="general">
|
<Form.Item label={t("notes.fields.type")} name="type" initialValue="general">
|
||||||
<Select
|
<Select
|
||||||
options={[
|
options={[
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Form, Modal } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import React, { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import { GET_JOB_BY_PK } from "../../graphql/jobs.queries.js";
|
||||||
import { INSERT_NEW_NOTE, UPDATE_NOTE } from "../../graphql/notes.queries";
|
import { INSERT_NEW_NOTE, UPDATE_NOTE } from "../../graphql/notes.queries";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
import { toggleModalVisible } from "../../redux/modals/modals.actions";
|
||||||
@@ -12,7 +14,6 @@ import { selectNoteUpsert } from "../../redux/modals/modals.selectors";
|
|||||||
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import NoteUpsertModalComponent from "./note-upsert-modal.component";
|
import NoteUpsertModalComponent from "./note-upsert-modal.component";
|
||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -65,6 +66,33 @@ export function NoteUpsertModalContainer({ currentUser, noteUpsertModal, toggleM
|
|||||||
variables: {
|
variables: {
|
||||||
noteId: existingNote.id,
|
noteId: existingNote.id,
|
||||||
note: values
|
note: values
|
||||||
|
},
|
||||||
|
update(cache, { data: { updateNote: updatedNote } }) {
|
||||||
|
try {
|
||||||
|
const existingJob = cache.readQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: jobId }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (existingJob) {
|
||||||
|
cache.writeQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: jobId },
|
||||||
|
data: {
|
||||||
|
...existingJob,
|
||||||
|
job: {
|
||||||
|
...existingJob.job,
|
||||||
|
notes: updatedNote.pinned
|
||||||
|
? [updatedNote, ...existingJob.job.notes]
|
||||||
|
: existingJob.job.notes.filter((n) => n.id !== updatedNote.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Cache miss is okay, query hasn't been executed yet
|
||||||
|
console.log("Cache miss for GET_JOB_BY_PK");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
@@ -86,6 +114,33 @@ export function NoteUpsertModalContainer({ currentUser, noteUpsertModal, toggleM
|
|||||||
variables: {
|
variables: {
|
||||||
noteInput: [{ ...values, jobid: jobId, created_by: currentUser.email }]
|
noteInput: [{ ...values, jobid: jobId, created_by: currentUser.email }]
|
||||||
},
|
},
|
||||||
|
update(cache, { data: { updateNote: updatedNote } }) {
|
||||||
|
try {
|
||||||
|
const existingJob = cache.readQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: jobId }
|
||||||
|
});
|
||||||
|
|
||||||
|
if (existingJob) {
|
||||||
|
cache.writeQuery({
|
||||||
|
query: GET_JOB_BY_PK,
|
||||||
|
variables: { id: jobId },
|
||||||
|
data: {
|
||||||
|
...existingJob,
|
||||||
|
job: {
|
||||||
|
...existingJob.job,
|
||||||
|
notes: updatedNote.pinned
|
||||||
|
? [updatedNote, ...existingJob.job.notes]
|
||||||
|
: existingJob.job.notes.filter((n) => n.id !== updatedNote.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// Cache miss is okay, query hasn't been executed yet
|
||||||
|
console.log("Cache miss for GET_JOB_BY_PK");
|
||||||
|
}
|
||||||
|
},
|
||||||
refetchQueries: ["QUERY_NOTES_BY_JOB_PK"]
|
refetchQueries: ["QUERY_NOTES_BY_JOB_PK"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { Card, Divider, Space } from "antd";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import JobNotesPinToggle from "../job-notes-pin-toggle/job-notes-pin-toggle.component";
|
||||||
|
|
||||||
|
function PinnedJobNotes({ job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const pinnedNotes = useMemo(() => {
|
||||||
|
return job?.notes?.filter((note) => note.pinned); //This will be typically filtered, but adding this to maximize flexibility of the component.
|
||||||
|
}, [job.notes]);
|
||||||
|
|
||||||
|
return pinnedNotes?.length ? (
|
||||||
|
<>
|
||||||
|
<Divider />
|
||||||
|
<Space direction="vertical" style={{ width: "100%" }}>
|
||||||
|
{pinnedNotes?.map((note) => (
|
||||||
|
<Card
|
||||||
|
key={note.id}
|
||||||
|
title={`${t("notes.labels.pinned_note")} - ${t(`notes.fields.types.${note.type}`)}`}
|
||||||
|
extra={<JobNotesPinToggle note={note} />}
|
||||||
|
>
|
||||||
|
{note.text}
|
||||||
|
</Card>
|
||||||
|
))}
|
||||||
|
</Space>
|
||||||
|
</>
|
||||||
|
) : null;
|
||||||
|
}
|
||||||
|
export default PinnedJobNotes;
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useMutation, useQuery } from "@apollo/client";
|
import { useMutation, useQuery } from "@apollo/client";
|
||||||
import { Form, Modal } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import dayjs from "../../utils/day";
|
import { useEffect, useState } from "react";
|
||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
CANCEL_APPOINTMENT_BY_ID,
|
CANCEL_APPOINTMENT_BY_ID,
|
||||||
@@ -19,9 +19,9 @@ import { selectSchedule } from "../../redux/modals/modals.selectors";
|
|||||||
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import { DateTimeFormat } from "../../utils/DateFormatter";
|
import { DateTimeFormat } from "../../utils/DateFormatter";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
import ScheduleJobModalComponent from "./schedule-job-modal.component";
|
||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -72,7 +72,7 @@ export function ScheduleJobModalContainer({
|
|||||||
variables: { jobid: jobId },
|
variables: { jobid: jobId },
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
skip: !open || !!!jobId
|
skip: !open || !jobId
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -93,12 +93,12 @@ export function ScheduleJobModalContainer({
|
|||||||
logImEXEvent("schedule_new_appointment");
|
logImEXEvent("schedule_new_appointment");
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
if (!!previousEvent) {
|
if (previousEvent) {
|
||||||
const cancelAppt = await cancelAppointment({
|
const cancelAppt = await cancelAppointment({
|
||||||
variables: { appid: previousEvent }
|
variables: { appid: previousEvent }
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!cancelAppt.errors) {
|
if (cancelAppt.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("appointments.errors.canceling", {
|
message: t("appointments.errors.canceling", {
|
||||||
message: JSON.stringify(cancelAppt.errors)
|
message: JSON.stringify(cancelAppt.errors)
|
||||||
@@ -146,7 +146,7 @@ export function ScheduleJobModalContainer({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!!appt.errors) {
|
if (appt.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("appointments.errors.saving", {
|
message: t("appointments.errors.saving", {
|
||||||
message: JSON.stringify(appt.errors)
|
message: JSON.stringify(appt.errors)
|
||||||
@@ -172,7 +172,7 @@ export function ScheduleJobModalContainer({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!!jobUpdate.errors) {
|
if (jobUpdate.errors) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("appointments.errors.saving", {
|
message: t("appointments.errors.saving", {
|
||||||
message: JSON.stringify(jobUpdate.errors)
|
message: JSON.stringify(jobUpdate.errors)
|
||||||
@@ -222,9 +222,9 @@ export function ScheduleJobModalContainer({
|
|||||||
initialValues={{
|
initialValues={{
|
||||||
notifyCustomer: !!(job && job.ownr_ea),
|
notifyCustomer: !!(job && job.ownr_ea),
|
||||||
email: (job && job.ownr_ea) || "",
|
email: (job && job.ownr_ea) || "",
|
||||||
start: null,
|
|
||||||
// smartDates: [],
|
// smartDates: [],
|
||||||
scheduled_completion: null,
|
start: context.scheduled_in,
|
||||||
|
scheduled_completion: context.scheduled_completion ,
|
||||||
color: context.color,
|
color: context.color,
|
||||||
alt_transport: context.alt_transport,
|
alt_transport: context.alt_transport,
|
||||||
note: context.note
|
note: context.note
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const SocketProvider = ({ children, bodyshop, navigate, currentUser }) => {
|
|||||||
const socketRef = useRef(null);
|
const socketRef = useRef(null);
|
||||||
const [clientId, setClientId] = useState(null);
|
const [clientId, setClientId] = useState(null);
|
||||||
const [isConnected, setIsConnected] = useState(false);
|
const [isConnected, setIsConnected] = useState(false);
|
||||||
|
const [socketInitialized, setSocketInitialized] = useState(false);
|
||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
const userAssociationId = bodyshop?.associations?.[0]?.id;
|
const userAssociationId = bodyshop?.associations?.[0]?.id;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -147,6 +148,13 @@ const SocketProvider = ({ children, bodyshop, navigate, currentUser }) => {
|
|||||||
onError: (err) => console.error("MARK_ALL_NOTIFICATIONS_READ error:", err)
|
onError: (err) => console.error("MARK_ALL_NOTIFICATIONS_READ error:", err)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const checkAndReconnect = () => {
|
||||||
|
if (socketRef.current && !socketRef.current.connected) {
|
||||||
|
console.log("Attempting manual reconnect due to event trigger");
|
||||||
|
socketRef.current.connect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const initializeSocket = async (token) => {
|
const initializeSocket = async (token) => {
|
||||||
if (!bodyshop || !bodyshop.id || socketRef.current) return;
|
if (!bodyshop || !bodyshop.id || socketRef.current) return;
|
||||||
@@ -158,10 +166,14 @@ const SocketProvider = ({ children, bodyshop, navigate, currentUser }) => {
|
|||||||
auth: { token, bodyshopId: bodyshop.id },
|
auth: { token, bodyshopId: bodyshop.id },
|
||||||
reconnectionAttempts: Infinity,
|
reconnectionAttempts: Infinity,
|
||||||
reconnectionDelay: 2000,
|
reconnectionDelay: 2000,
|
||||||
reconnectionDelayMax: 10000
|
reconnectionDelayMax: 60000,
|
||||||
|
randomizationFactor: 0.5,
|
||||||
|
transports: ["websocket", "polling"], // Add this to prefer WebSocket with polling fallback
|
||||||
|
rememberUpgrade: true
|
||||||
});
|
});
|
||||||
|
|
||||||
socketRef.current = socketInstance;
|
socketRef.current = socketInstance;
|
||||||
|
setSocketInitialized(true);
|
||||||
|
|
||||||
const handleBodyshopMessage = (message) => {
|
const handleBodyshopMessage = (message) => {
|
||||||
if (!message || !message.type) return;
|
if (!message || !message.type) return;
|
||||||
@@ -546,6 +558,57 @@ const SocketProvider = ({ children, bodyshop, navigate, currentUser }) => {
|
|||||||
t
|
t
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!socketInitialized) return;
|
||||||
|
|
||||||
|
const onVisibilityChange = () => {
|
||||||
|
if (document.visibilityState === "visible") {
|
||||||
|
checkAndReconnect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const onFocus = () => {
|
||||||
|
checkAndReconnect();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onOnline = () => {
|
||||||
|
checkAndReconnect();
|
||||||
|
};
|
||||||
|
|
||||||
|
const onPageShow = (event) => {
|
||||||
|
if (event.persisted) {
|
||||||
|
checkAndReconnect();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener("visibilitychange", onVisibilityChange);
|
||||||
|
window.addEventListener("focus", onFocus);
|
||||||
|
window.addEventListener("online", onOnline);
|
||||||
|
window.addEventListener("pageshow", onPageShow);
|
||||||
|
|
||||||
|
// Sleep/wake detection using timer
|
||||||
|
let lastTime = Date.now();
|
||||||
|
const intervalMs = 1000; // Check every second
|
||||||
|
const thresholdMs = 2000; // If more than 2 seconds elapsed, assume sleep/wake
|
||||||
|
|
||||||
|
const sleepCheckInterval = setInterval(() => {
|
||||||
|
const currentTime = Date.now();
|
||||||
|
if (currentTime > lastTime + intervalMs + thresholdMs) {
|
||||||
|
console.log("Detected potential wake from sleep/hibernate");
|
||||||
|
checkAndReconnect();
|
||||||
|
}
|
||||||
|
lastTime = currentTime;
|
||||||
|
}, intervalMs);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
||||||
|
window.removeEventListener("focus", onFocus);
|
||||||
|
window.removeEventListener("online", onOnline);
|
||||||
|
window.removeEventListener("pageshow", onPageShow);
|
||||||
|
clearInterval(sleepCheckInterval);
|
||||||
|
};
|
||||||
|
}, [socketInitialized]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SocketContext.Provider
|
<SocketContext.Provider
|
||||||
value={{
|
value={{
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
|
|||||||
color
|
color
|
||||||
note
|
note
|
||||||
job {
|
job {
|
||||||
|
scheduled_in
|
||||||
|
scheduled_completion
|
||||||
alt_transport
|
alt_transport
|
||||||
ro_number
|
ro_number
|
||||||
ownr_ln
|
ownr_ln
|
||||||
|
|||||||
@@ -713,6 +713,19 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
v_model_yr
|
v_model_yr
|
||||||
v_model_desc
|
v_model_desc
|
||||||
v_vin
|
v_vin
|
||||||
|
notes(where:{pinned: {_eq: true}}, order_by: {updated_at: desc}) {
|
||||||
|
created_at
|
||||||
|
created_by
|
||||||
|
critical
|
||||||
|
id
|
||||||
|
jobid
|
||||||
|
private
|
||||||
|
text
|
||||||
|
updated_at
|
||||||
|
audit
|
||||||
|
type
|
||||||
|
pinned
|
||||||
|
}
|
||||||
vehicle {
|
vehicle {
|
||||||
id
|
id
|
||||||
jobs {
|
jobs {
|
||||||
@@ -959,6 +972,8 @@ export const QUERY_JOB_CARD_DETAILS = gql`
|
|||||||
critical
|
critical
|
||||||
private
|
private
|
||||||
created_at
|
created_at
|
||||||
|
pinned
|
||||||
|
type
|
||||||
}
|
}
|
||||||
updated_at
|
updated_at
|
||||||
clm_total
|
clm_total
|
||||||
@@ -984,6 +999,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
|
|||||||
key
|
key
|
||||||
type
|
type
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -1048,6 +1064,8 @@ export const QUERY_TECH_JOB_DETAILS = gql`
|
|||||||
critical
|
critical
|
||||||
private
|
private
|
||||||
created_at
|
created_at
|
||||||
|
pinned
|
||||||
|
type
|
||||||
}
|
}
|
||||||
updated_at
|
updated_at
|
||||||
documents(order_by: { created_at: desc }) {
|
documents(order_by: { created_at: desc }) {
|
||||||
@@ -2323,7 +2341,7 @@ export const QUERY_JOBS_TECH_ASIGNED_TO_BY_TEAM = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const QUERY_PARTS_QUEUE_CARD_DETAILS = gql`
|
export const QUERY_PARTS_QUEUE_CARD_DETAILS = gql`
|
||||||
query QUERY_JOB_CARD_DETAILS($id: uuid!) {
|
query QUERY_PARTS_QUEUE_CARD_DETAILS($id: uuid!) {
|
||||||
jobs_by_pk(id: $id) {
|
jobs_by_pk(id: $id) {
|
||||||
actual_completion
|
actual_completion
|
||||||
actual_delivery
|
actual_delivery
|
||||||
@@ -2349,6 +2367,19 @@ export const QUERY_PARTS_QUEUE_CARD_DETAILS = gql`
|
|||||||
start
|
start
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
|
notes(where:{pinned: {_eq: true}}, order_by: {updated_at: desc}) {
|
||||||
|
created_at
|
||||||
|
created_by
|
||||||
|
critical
|
||||||
|
id
|
||||||
|
jobid
|
||||||
|
private
|
||||||
|
text
|
||||||
|
updated_at
|
||||||
|
audit
|
||||||
|
type
|
||||||
|
pinned
|
||||||
|
}
|
||||||
clm_no
|
clm_no
|
||||||
clm_total
|
clm_total
|
||||||
comment
|
comment
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export const INSERT_NEW_NOTE = gql`
|
|||||||
updated_at
|
updated_at
|
||||||
audit
|
audit
|
||||||
type
|
type
|
||||||
|
pinned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,6 +44,7 @@ export const QUERY_NOTES_BY_JOB_PK = gql`
|
|||||||
updated_at
|
updated_at
|
||||||
audit
|
audit
|
||||||
type
|
type
|
||||||
|
pinned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,6 +65,7 @@ export const UPDATE_NOTE = gql`
|
|||||||
updated_at
|
updated_at
|
||||||
audit
|
audit
|
||||||
type
|
type
|
||||||
|
pinned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,6 +426,11 @@
|
|||||||
"messagingtext": "Messaging Preset Text",
|
"messagingtext": "Messaging Preset Text",
|
||||||
"noteslabel": "Note Label",
|
"noteslabel": "Note Label",
|
||||||
"notestext": "Note Text",
|
"notestext": "Note Text",
|
||||||
|
"notifications": {
|
||||||
|
"description": "Select employees to automatically follow new jobs and receive notifications for job updates.",
|
||||||
|
"invalid_followers": "Invalid selection. Please select valid employees.",
|
||||||
|
"placeholder": "Search for employees"
|
||||||
|
},
|
||||||
"partslocation": "Parts Location",
|
"partslocation": "Parts Location",
|
||||||
"phone": "Phone",
|
"phone": "Phone",
|
||||||
"prodtargethrs": "Production Target Hours",
|
"prodtargethrs": "Production Target Hours",
|
||||||
@@ -648,15 +653,9 @@
|
|||||||
"use_paint_scale_data": "Use Paint Scale Data for Job Costing?",
|
"use_paint_scale_data": "Use Paint Scale Data for Job Costing?",
|
||||||
"uselocalmediaserver": "Use Local Media Server?",
|
"uselocalmediaserver": "Use Local Media Server?",
|
||||||
"website": "Website",
|
"website": "Website",
|
||||||
"zip_post": "Zip/Postal Code",
|
"zip_post": "Zip/Postal Code"
|
||||||
"notifications": {
|
|
||||||
"description": "Select employees to automatically follow new jobs and receive notifications for job updates.",
|
|
||||||
"placeholder": "Search for employees",
|
|
||||||
"invalid_followers": "Invalid selection. Please select valid employees."
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consent_settings": "Phone Number Opt-Out List",
|
|
||||||
"2tiername": "Name => RO",
|
"2tiername": "Name => RO",
|
||||||
"2tiersetup": "2 Tier Setup",
|
"2tiersetup": "2 Tier Setup",
|
||||||
"2tiersource": "Source => RO",
|
"2tiersource": "Source => RO",
|
||||||
@@ -667,6 +666,7 @@
|
|||||||
"apptcolors": "Appointment Colors",
|
"apptcolors": "Appointment Colors",
|
||||||
"businessinformation": "Business Information",
|
"businessinformation": "Business Information",
|
||||||
"checklists": "Checklists",
|
"checklists": "Checklists",
|
||||||
|
"consent_settings": "Phone Number Opt-Out List",
|
||||||
"csiq": "CSI Questions",
|
"csiq": "CSI Questions",
|
||||||
"customtemplates": "Custom Templates",
|
"customtemplates": "Custom Templates",
|
||||||
"defaultcostsmapping": "Default Costs Mapping",
|
"defaultcostsmapping": "Default Costs Mapping",
|
||||||
@@ -704,6 +704,9 @@
|
|||||||
"messagingpresets": "Messaging Presets",
|
"messagingpresets": "Messaging Presets",
|
||||||
"notemplatesavailable": "No templates available to add.",
|
"notemplatesavailable": "No templates available to add.",
|
||||||
"notespresets": "Notes Presets",
|
"notespresets": "Notes Presets",
|
||||||
|
"notifications": {
|
||||||
|
"followers": "Notifications"
|
||||||
|
},
|
||||||
"orderstatuses": "Order Statuses",
|
"orderstatuses": "Order Statuses",
|
||||||
"partslocations": "Parts Locations",
|
"partslocations": "Parts Locations",
|
||||||
"partsscan": "Parts Scanning",
|
"partsscan": "Parts Scanning",
|
||||||
@@ -734,10 +737,7 @@
|
|||||||
"ssbuckets": "Job Size Definitions",
|
"ssbuckets": "Job Size Definitions",
|
||||||
"systemsettings": "System Settings",
|
"systemsettings": "System Settings",
|
||||||
"task-presets": "Task Presets",
|
"task-presets": "Task Presets",
|
||||||
"workingdays": "Working Days",
|
"workingdays": "Working Days"
|
||||||
"notifications": {
|
|
||||||
"followers": "Notifications"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "Contains",
|
"contains": "Contains",
|
||||||
@@ -783,6 +783,15 @@
|
|||||||
"completed": "Job checklist completed."
|
"completed": "Job checklist completed."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"consent": {
|
||||||
|
"associated_owners": "Associated Owners",
|
||||||
|
"created_at": "Opt-Out Date",
|
||||||
|
"no_owners": "No Associated Owners",
|
||||||
|
"phone_1": "Phone 1",
|
||||||
|
"phone_2": "Phone 2",
|
||||||
|
"phone_number": "Phone Number",
|
||||||
|
"text_body": "Users can opt out of receiving SMS messages by replying with keywords such as STOP, UNSUBSCRIBE, CANCEL, END, QUIT, STOPALL, REVOKE and OPTOUT. To opt back in, users can reply with START, YES, or UNSTOP. Even after opting out, users can still send messages to us, which will be received and processed as needed. Ensure customers are informed to reply with these keywords to manage their messaging preferences. After opting out, users receive a confirmation message and will not receive further messages until they opt back in."
|
||||||
|
},
|
||||||
"contracts": {
|
"contracts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"changerate": "Change Contract Rates",
|
"changerate": "Change Contract Rates",
|
||||||
@@ -975,7 +984,10 @@
|
|||||||
"addcomponent": "Add Component"
|
"addcomponent": "Add Component"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
|
"atp": "No Alt. Transport*",
|
||||||
|
"insco": "No Ins. Co.*",
|
||||||
"refreshrequired": "You must refresh the dashboard data to see this component.",
|
"refreshrequired": "You must refresh the dashboard data to see this component.",
|
||||||
|
"status": "No Status*",
|
||||||
"updatinglayout": "Error saving updated layout {{message}}"
|
"updatinglayout": "Error saving updated layout {{message}}"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
@@ -998,6 +1010,8 @@
|
|||||||
"productiondollars": "Total Dollars in Production",
|
"productiondollars": "Total Dollars in Production",
|
||||||
"productionhours": "Total Hours in Production",
|
"productionhours": "Total Hours in Production",
|
||||||
"projectedmonthlysales": "Projected Monthly Sales",
|
"projectedmonthlysales": "Projected Monthly Sales",
|
||||||
|
"scheduleddeliverydate": "Scheduled Delivery Date: {{date}}",
|
||||||
|
"scheduleddeliverytoday": "Scheduled Delivery Today",
|
||||||
"scheduledindate": "Scheduled In Today: {{date}}",
|
"scheduledindate": "Scheduled In Today: {{date}}",
|
||||||
"scheduledintoday": "Scheduled In Today",
|
"scheduledintoday": "Scheduled In Today",
|
||||||
"scheduledoutdate": "Scheduled Out Today: {{date}}",
|
"scheduledoutdate": "Scheduled Out Today: {{date}}",
|
||||||
@@ -1230,11 +1244,11 @@
|
|||||||
"fcm": "You must allow notification permissions to have real time messaging. Click to try again.",
|
"fcm": "You must allow notification permissions to have real time messaging. Click to try again.",
|
||||||
"notfound": "No record was found.",
|
"notfound": "No record was found.",
|
||||||
"sizelimit": "The selected items exceed the size limit.",
|
"sizelimit": "The selected items exceed the size limit.",
|
||||||
"submit-for-testing": "Error submitting Job for testing.",
|
|
||||||
"sub_status": {
|
"sub_status": {
|
||||||
"expired": "The subscription for this shop has expired. Please contact Sales to reactivate.",
|
"expired": "The subscription for this shop has expired. Please contact Sales to reactivate.",
|
||||||
"trial-expired": "The trial for this shop has expired. Please contact Sales to reactivate."
|
"trial-expired": "The trial for this shop has expired. Please contact Sales to reactivate."
|
||||||
}
|
},
|
||||||
|
"submit-for-testing": "Error submitting Job for testing."
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "CC Contract",
|
"contract": "CC Contract",
|
||||||
@@ -1654,8 +1668,6 @@
|
|||||||
"adjustment_bottom_line": "Adjustments",
|
"adjustment_bottom_line": "Adjustments",
|
||||||
"adjustmenthours": "Adjustment Hours",
|
"adjustmenthours": "Adjustment Hours",
|
||||||
"alt_transport": "Alt. Trans.",
|
"alt_transport": "Alt. Trans.",
|
||||||
"estimate_sent_approval": "Estimate Sent for Approval",
|
|
||||||
"estimate_approved": "Estimate Approved",
|
|
||||||
"area_of_damage_impact": {
|
"area_of_damage_impact": {
|
||||||
"10": "Left Front Side",
|
"10": "Left Front Side",
|
||||||
"11": "Left Front Corner",
|
"11": "Left Front Corner",
|
||||||
@@ -1778,6 +1790,8 @@
|
|||||||
"est_ct_ln": "Estimator Last Name",
|
"est_ct_ln": "Estimator Last Name",
|
||||||
"est_ea": "Estimator Email",
|
"est_ea": "Estimator Email",
|
||||||
"est_ph1": "Estimator Phone #",
|
"est_ph1": "Estimator Phone #",
|
||||||
|
"estimate_approved": "Estimate Approved",
|
||||||
|
"estimate_sent_approval": "Estimate Sent for Approval",
|
||||||
"federal_tax_payable": "Federal Tax Payable",
|
"federal_tax_payable": "Federal Tax Payable",
|
||||||
"federal_tax_rate": "Federal Tax Rate",
|
"federal_tax_rate": "Federal Tax Rate",
|
||||||
"flat_rate_ats": "Flat Rate ATS?",
|
"flat_rate_ats": "Flat Rate ATS?",
|
||||||
@@ -1961,8 +1975,6 @@
|
|||||||
"scheddates": "Schedule Dates"
|
"scheddates": "Schedule Dates"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"sent": "",
|
|
||||||
"approved": "",
|
|
||||||
"accountsreceivable": "Accounts Receivable",
|
"accountsreceivable": "Accounts Receivable",
|
||||||
"act_price_ppc": "New Part Price",
|
"act_price_ppc": "New Part Price",
|
||||||
"actual_completion_inferred": "$t(jobs.fields.actual_completion) inferred using $t(jobs.fields.scheduled_completion).",
|
"actual_completion_inferred": "$t(jobs.fields.actual_completion) inferred using $t(jobs.fields.scheduled_completion).",
|
||||||
@@ -1977,6 +1989,7 @@
|
|||||||
"alreadyaddedtoscoreboard": "Job has already been added to scoreboard. Saving will update the previous entry.",
|
"alreadyaddedtoscoreboard": "Job has already been added to scoreboard. Saving will update the previous entry.",
|
||||||
"alreadyclosed": "This Job has already been closed.",
|
"alreadyclosed": "This Job has already been closed.",
|
||||||
"appointmentconfirmation": "Send confirmation to customer?",
|
"appointmentconfirmation": "Send confirmation to customer?",
|
||||||
|
"approved": "",
|
||||||
"associationwarning": "Any changes to associations will require updating the data from the new parent record to the Job.",
|
"associationwarning": "Any changes to associations will require updating the data from the new parent record to the Job.",
|
||||||
"audit": "Audit Trail",
|
"audit": "Audit Trail",
|
||||||
"available": "Available",
|
"available": "Available",
|
||||||
@@ -2167,6 +2180,7 @@
|
|||||||
"sales": "Sales",
|
"sales": "Sales",
|
||||||
"savebeforeconversion": "You have unsaved changes on the Job. Please save them before converting it. ",
|
"savebeforeconversion": "You have unsaved changes on the Job. Please save them before converting it. ",
|
||||||
"scheduledinchange": "The scheduled in is based off the latest appointment. To change this date, please schedule or reschedule the Job. ",
|
"scheduledinchange": "The scheduled in is based off the latest appointment. To change this date, please schedule or reschedule the Job. ",
|
||||||
|
"sent": "",
|
||||||
"specialcoveragepolicy": "Special Coverage Policy Applies",
|
"specialcoveragepolicy": "Special Coverage Policy Applies",
|
||||||
"state_tax_amt": "Provincial/State Taxes",
|
"state_tax_amt": "Provincial/State Taxes",
|
||||||
"subletsnotcompleted": "Outstanding Sublets",
|
"subletsnotcompleted": "Outstanding Sublets",
|
||||||
@@ -2383,15 +2397,16 @@
|
|||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"invalidphone": "The phone number is invalid. Unable to open conversation. ",
|
"invalidphone": "The phone number is invalid. Unable to open conversation. ",
|
||||||
|
"no_consent": "This phone number has opted-out of Messaging.",
|
||||||
"noattachedjobs": "No Jobs have been associated to this conversation. ",
|
"noattachedjobs": "No Jobs have been associated to this conversation. ",
|
||||||
"updatinglabel": "Error updating label. {{error}}",
|
"updatinglabel": "Error updating label. {{error}}"
|
||||||
"no_consent": "This phone number has opted-out of Messaging."
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"addlabel": "Add a label to this conversation.",
|
"addlabel": "Add a label to this conversation.",
|
||||||
"archive": "Archive",
|
"archive": "Archive",
|
||||||
"maxtenimages": "You can only select up to a maximum of 10 images at a time.",
|
"maxtenimages": "You can only select up to a maximum of 10 images at a time.",
|
||||||
"messaging": "Messaging",
|
"messaging": "Messaging",
|
||||||
|
"no_consent": "Opted-out",
|
||||||
"noallowtxt": "This customer has not indicated their permission to be messaged.",
|
"noallowtxt": "This customer has not indicated their permission to be messaged.",
|
||||||
"nojobs": "Not associated to any Job.",
|
"nojobs": "Not associated to any Job.",
|
||||||
"nopush": "Polling Mode Enabled",
|
"nopush": "Polling Mode Enabled",
|
||||||
@@ -2401,8 +2416,7 @@
|
|||||||
"selectmedia": "Select Media",
|
"selectmedia": "Select Media",
|
||||||
"sentby": "Sent by {{by}} at {{time}}",
|
"sentby": "Sent by {{by}} at {{time}}",
|
||||||
"typeamessage": "Send a message...",
|
"typeamessage": "Send a message...",
|
||||||
"unarchive": "Unarchive",
|
"unarchive": "Unarchive"
|
||||||
"no_consent": "Opted-out"
|
|
||||||
},
|
},
|
||||||
"render": {
|
"render": {
|
||||||
"conversation_list": "Conversation List"
|
"conversation_list": "Conversation List"
|
||||||
@@ -2422,6 +2436,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"createdby": "Created By",
|
"createdby": "Created By",
|
||||||
"critical": "Critical",
|
"critical": "Critical",
|
||||||
|
"pinned": "Pinned",
|
||||||
"private": "Private",
|
"private": "Private",
|
||||||
"text": "Contents",
|
"text": "Contents",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
@@ -2440,6 +2455,7 @@
|
|||||||
"addtorelatedro": "Add to Related ROs",
|
"addtorelatedro": "Add to Related ROs",
|
||||||
"newnoteplaceholder": "Add a note...",
|
"newnoteplaceholder": "Add a note...",
|
||||||
"notetoadd": "Note to Add",
|
"notetoadd": "Note to Add",
|
||||||
|
"pinned_note": "Pinned Note",
|
||||||
"systemnotes": "System Notes",
|
"systemnotes": "System Notes",
|
||||||
"usernotes": "User Notes"
|
"usernotes": "User Notes"
|
||||||
},
|
},
|
||||||
@@ -2462,11 +2478,15 @@
|
|||||||
"fcm": "Push"
|
"fcm": "Push"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"auto-add": "Automatically watch Jobs I import",
|
|
||||||
"auto-add-success": "Auto watcher status successfully changed.",
|
|
||||||
"auto-add-failure": "Something went wrong updating your auto watcher status.",
|
|
||||||
"add-watchers": "Add Watchers",
|
"add-watchers": "Add Watchers",
|
||||||
"add-watchers-team": "Add Team Members",
|
"add-watchers-team": "Add Team Members",
|
||||||
|
"auto-add": "Automatically watch Jobs I import",
|
||||||
|
"auto-add-description": "",
|
||||||
|
"auto-add-failure": "Something went wrong updating your auto watcher status.",
|
||||||
|
"auto-add-off": "",
|
||||||
|
"auto-add-on": "",
|
||||||
|
"auto-add-success": "Auto watcher status successfully changed.",
|
||||||
|
"employee-notification": "Notifications are disabled because you do not have an associated Employee record.",
|
||||||
"employee-search": "Search for an Employee",
|
"employee-search": "Search for an Employee",
|
||||||
"mark-all-read": "Mark All Read",
|
"mark-all-read": "Mark All Read",
|
||||||
"new-notification-title": "New Notification:",
|
"new-notification-title": "New Notification:",
|
||||||
@@ -2483,8 +2503,7 @@
|
|||||||
"teams-search": "Search for a Team",
|
"teams-search": "Search for a Team",
|
||||||
"unwatch": "Unwatch",
|
"unwatch": "Unwatch",
|
||||||
"watch": "Watch",
|
"watch": "Watch",
|
||||||
"watching-issue": "Watching",
|
"watching-issue": "Watching"
|
||||||
"employee-notification": "Notifications are disabled because you do not have an associated Employee record."
|
|
||||||
},
|
},
|
||||||
"scenarios": {
|
"scenarios": {
|
||||||
"alternate-transport-changed": "Alternate Transport Changed",
|
"alternate-transport-changed": "Alternate Transport Changed",
|
||||||
@@ -3294,17 +3313,10 @@
|
|||||||
"updated": "Scoreboard updated."
|
"updated": "Scoreboard updated."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"settings": {
|
||||||
|
"title": "Phone Number Opt-Out List"
|
||||||
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"labels": {
|
|
||||||
"my_tasks_center": "Task Center",
|
|
||||||
"go_to_job": "Go to Job",
|
|
||||||
"overdue": "Overdue",
|
|
||||||
"due_today": "Today",
|
|
||||||
"upcoming": "Upcoming",
|
|
||||||
"no_due_date": "Incomplete",
|
|
||||||
"ro-number": "RO #{{ro_number}}",
|
|
||||||
"no_tasks": "No Tasks Found"
|
|
||||||
},
|
|
||||||
"actions": {
|
"actions": {
|
||||||
"edit": "Edit Task",
|
"edit": "Edit Task",
|
||||||
"new": "New Task",
|
"new": "New Task",
|
||||||
@@ -3319,9 +3331,6 @@
|
|||||||
"myTasks": "Mine",
|
"myTasks": "Mine",
|
||||||
"refresh": "Refresh"
|
"refresh": "Refresh"
|
||||||
},
|
},
|
||||||
"errors": {
|
|
||||||
"load_failure": "Failed to load Tasks."
|
|
||||||
},
|
|
||||||
"date_presets": {
|
"date_presets": {
|
||||||
"completion": "Completion",
|
"completion": "Completion",
|
||||||
"day": "Day",
|
"day": "Day",
|
||||||
@@ -3335,6 +3344,9 @@
|
|||||||
"tomorrow": "Tomorrow",
|
"tomorrow": "Tomorrow",
|
||||||
"two_weeks": "Two Weeks"
|
"two_weeks": "Two Weeks"
|
||||||
},
|
},
|
||||||
|
"errors": {
|
||||||
|
"load_failure": "Failed to load Tasks."
|
||||||
|
},
|
||||||
"failures": {
|
"failures": {
|
||||||
"completed": "Failed to toggle Task completion.",
|
"completed": "Failed to toggle Task completion.",
|
||||||
"created": "Failed to create Task.",
|
"created": "Failed to create Task.",
|
||||||
@@ -3369,6 +3381,16 @@
|
|||||||
"remind_at": "Remind At",
|
"remind_at": "Remind At",
|
||||||
"title": "Title"
|
"title": "Title"
|
||||||
},
|
},
|
||||||
|
"labels": {
|
||||||
|
"due_today": "Today",
|
||||||
|
"go_to_job": "Go to Job",
|
||||||
|
"my_tasks_center": "Task Center",
|
||||||
|
"no_due_date": "Incomplete",
|
||||||
|
"no_tasks": "No Tasks Found",
|
||||||
|
"overdue": "Overdue",
|
||||||
|
"ro-number": "RO #{{ro_number}}",
|
||||||
|
"upcoming": "Upcoming"
|
||||||
|
},
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"assigned_to": "Select an Employee",
|
"assigned_to": "Select an Employee",
|
||||||
"billid": "Select a Bill",
|
"billid": "Select a Bill",
|
||||||
@@ -3518,7 +3540,7 @@
|
|||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
"dms": "DMS Export",
|
"dms": "DMS Export",
|
||||||
"export-logs": "Export Logs",
|
"export-logs": "Export Logs",
|
||||||
"feature-request": "Feature Requet",
|
"feature-request": "Feature Request",
|
||||||
"inventory": "Inventory",
|
"inventory": "Inventory",
|
||||||
"jobs": "Jobs",
|
"jobs": "Jobs",
|
||||||
"jobs-active": "Active Jobs",
|
"jobs-active": "Active Jobs",
|
||||||
@@ -3884,18 +3906,6 @@
|
|||||||
"validation": {
|
"validation": {
|
||||||
"unique_vendor_name": "You must enter a unique vendor name."
|
"unique_vendor_name": "You must enter a unique vendor name."
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"consent": {
|
|
||||||
"phone_number": "Phone Number",
|
|
||||||
"associated_owners": "Associated Owners",
|
|
||||||
"created_at": "Opt-Out Date",
|
|
||||||
"no_owners": "No Associated Owners",
|
|
||||||
"phone_1": "Phone 1",
|
|
||||||
"phone_2": "Phone 2",
|
|
||||||
"text_body": "Users can opt out of receiving SMS messages by replying with keywords such as STOP, UNSUBSCRIBE, CANCEL, END, QUIT, STOPALL, REVOKE and OPTOUT. To opt back in, users can reply with START, YES, or UNSTOP. Even after opting out, users can still send messages to us, which will be received and processed as needed. Ensure customers are informed to reply with these keywords to manage their messaging preferences. After opting out, users receive a confirmation message and will not receive further messages until they opt back in."
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"title": "Phone Number Opt-Out List"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,6 +426,11 @@
|
|||||||
"messagingtext": "",
|
"messagingtext": "",
|
||||||
"noteslabel": "",
|
"noteslabel": "",
|
||||||
"notestext": "",
|
"notestext": "",
|
||||||
|
"notifications": {
|
||||||
|
"description": "",
|
||||||
|
"invalid_followers": "",
|
||||||
|
"placeholder": ""
|
||||||
|
},
|
||||||
"partslocation": "",
|
"partslocation": "",
|
||||||
"phone": "",
|
"phone": "",
|
||||||
"prodtargethrs": "",
|
"prodtargethrs": "",
|
||||||
@@ -648,15 +653,9 @@
|
|||||||
"use_paint_scale_data": "",
|
"use_paint_scale_data": "",
|
||||||
"uselocalmediaserver": "",
|
"uselocalmediaserver": "",
|
||||||
"website": "",
|
"website": "",
|
||||||
"zip_post": "",
|
"zip_post": ""
|
||||||
"notifications": {
|
|
||||||
"description": "",
|
|
||||||
"placeholder": "",
|
|
||||||
"invalid_followers": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consent_settings": "",
|
|
||||||
"2tiername": "",
|
"2tiername": "",
|
||||||
"2tiersetup": "",
|
"2tiersetup": "",
|
||||||
"2tiersource": "",
|
"2tiersource": "",
|
||||||
@@ -667,6 +666,7 @@
|
|||||||
"apptcolors": "",
|
"apptcolors": "",
|
||||||
"businessinformation": "",
|
"businessinformation": "",
|
||||||
"checklists": "",
|
"checklists": "",
|
||||||
|
"consent_settings": "",
|
||||||
"csiq": "",
|
"csiq": "",
|
||||||
"customtemplates": "",
|
"customtemplates": "",
|
||||||
"defaultcostsmapping": "",
|
"defaultcostsmapping": "",
|
||||||
@@ -704,6 +704,9 @@
|
|||||||
"messagingpresets": "",
|
"messagingpresets": "",
|
||||||
"notemplatesavailable": "",
|
"notemplatesavailable": "",
|
||||||
"notespresets": "",
|
"notespresets": "",
|
||||||
|
"notifications": {
|
||||||
|
"followers": ""
|
||||||
|
},
|
||||||
"orderstatuses": "",
|
"orderstatuses": "",
|
||||||
"partslocations": "",
|
"partslocations": "",
|
||||||
"partsscan": "",
|
"partsscan": "",
|
||||||
@@ -734,10 +737,7 @@
|
|||||||
"ssbuckets": "",
|
"ssbuckets": "",
|
||||||
"systemsettings": "",
|
"systemsettings": "",
|
||||||
"task-presets": "",
|
"task-presets": "",
|
||||||
"workingdays": "",
|
"workingdays": ""
|
||||||
"notifications": {
|
|
||||||
"followers": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
@@ -783,6 +783,15 @@
|
|||||||
"completed": ""
|
"completed": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"consent": {
|
||||||
|
"associated_owners": "",
|
||||||
|
"created_at": "",
|
||||||
|
"no_owners": "",
|
||||||
|
"phone_1": "",
|
||||||
|
"phone_2": "",
|
||||||
|
"phone_number": "",
|
||||||
|
"text_body": ""
|
||||||
|
},
|
||||||
"contracts": {
|
"contracts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"changerate": "",
|
"changerate": "",
|
||||||
@@ -975,7 +984,10 @@
|
|||||||
"addcomponent": ""
|
"addcomponent": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
|
"atp": "",
|
||||||
|
"insco": "",
|
||||||
"refreshrequired": "",
|
"refreshrequired": "",
|
||||||
|
"status": "",
|
||||||
"updatinglayout": ""
|
"updatinglayout": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
@@ -998,6 +1010,8 @@
|
|||||||
"productiondollars": "",
|
"productiondollars": "",
|
||||||
"productionhours": "",
|
"productionhours": "",
|
||||||
"projectedmonthlysales": "",
|
"projectedmonthlysales": "",
|
||||||
|
"scheduleddeliverydate": "",
|
||||||
|
"scheduleddeliverytoday": "",
|
||||||
"scheduledindate": "",
|
"scheduledindate": "",
|
||||||
"scheduledintoday": "",
|
"scheduledintoday": "",
|
||||||
"scheduledoutdate": "",
|
"scheduledoutdate": "",
|
||||||
@@ -1230,11 +1244,11 @@
|
|||||||
"fcm": "",
|
"fcm": "",
|
||||||
"notfound": "",
|
"notfound": "",
|
||||||
"sizelimit": "",
|
"sizelimit": "",
|
||||||
"submit-for-testing": "",
|
|
||||||
"sub_status": {
|
"sub_status": {
|
||||||
"expired": "",
|
"expired": "",
|
||||||
"trial-expired": ""
|
"trial-expired": ""
|
||||||
}
|
},
|
||||||
|
"submit-for-testing": ""
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "",
|
"contract": "",
|
||||||
@@ -1646,8 +1660,6 @@
|
|||||||
"voiding": ""
|
"voiding": ""
|
||||||
},
|
},
|
||||||
"fields": {
|
"fields": {
|
||||||
"estimate_sent_approval": "",
|
|
||||||
"estimate_approved": "",
|
|
||||||
"active_tasks": "",
|
"active_tasks": "",
|
||||||
"actual_completion": "Realización real",
|
"actual_completion": "Realización real",
|
||||||
"actual_delivery": "Entrega real",
|
"actual_delivery": "Entrega real",
|
||||||
@@ -1778,6 +1790,8 @@
|
|||||||
"est_ct_ln": "Apellido del tasador",
|
"est_ct_ln": "Apellido del tasador",
|
||||||
"est_ea": "Correo electrónico del tasador",
|
"est_ea": "Correo electrónico del tasador",
|
||||||
"est_ph1": "Número de teléfono del tasador",
|
"est_ph1": "Número de teléfono del tasador",
|
||||||
|
"estimate_approved": "",
|
||||||
|
"estimate_sent_approval": "",
|
||||||
"federal_tax_payable": "Impuesto federal por pagar",
|
"federal_tax_payable": "Impuesto federal por pagar",
|
||||||
"federal_tax_rate": "",
|
"federal_tax_rate": "",
|
||||||
"flat_rate_ats": "",
|
"flat_rate_ats": "",
|
||||||
@@ -1961,8 +1975,6 @@
|
|||||||
"scheddates": ""
|
"scheddates": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"sent": "",
|
|
||||||
"approved": "",
|
|
||||||
"accountsreceivable": "",
|
"accountsreceivable": "",
|
||||||
"act_price_ppc": "",
|
"act_price_ppc": "",
|
||||||
"actual_completion_inferred": "",
|
"actual_completion_inferred": "",
|
||||||
@@ -1977,6 +1989,7 @@
|
|||||||
"alreadyaddedtoscoreboard": "",
|
"alreadyaddedtoscoreboard": "",
|
||||||
"alreadyclosed": "",
|
"alreadyclosed": "",
|
||||||
"appointmentconfirmation": "¿Enviar confirmación al cliente?",
|
"appointmentconfirmation": "¿Enviar confirmación al cliente?",
|
||||||
|
"approved": "",
|
||||||
"associationwarning": "",
|
"associationwarning": "",
|
||||||
"audit": "",
|
"audit": "",
|
||||||
"available": "",
|
"available": "",
|
||||||
@@ -2167,6 +2180,7 @@
|
|||||||
"sales": "",
|
"sales": "",
|
||||||
"savebeforeconversion": "",
|
"savebeforeconversion": "",
|
||||||
"scheduledinchange": "",
|
"scheduledinchange": "",
|
||||||
|
"sent": "",
|
||||||
"specialcoveragepolicy": "",
|
"specialcoveragepolicy": "",
|
||||||
"state_tax_amt": "",
|
"state_tax_amt": "",
|
||||||
"subletsnotcompleted": "",
|
"subletsnotcompleted": "",
|
||||||
@@ -2383,15 +2397,16 @@
|
|||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"invalidphone": "",
|
"invalidphone": "",
|
||||||
|
"no_consent": "",
|
||||||
"noattachedjobs": "",
|
"noattachedjobs": "",
|
||||||
"updatinglabel": "",
|
"updatinglabel": ""
|
||||||
"no_consent": ""
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"addlabel": "",
|
"addlabel": "",
|
||||||
"archive": "",
|
"archive": "",
|
||||||
"maxtenimages": "",
|
"maxtenimages": "",
|
||||||
"messaging": "Mensajería",
|
"messaging": "Mensajería",
|
||||||
|
"no_consent": "",
|
||||||
"noallowtxt": "",
|
"noallowtxt": "",
|
||||||
"nojobs": "",
|
"nojobs": "",
|
||||||
"nopush": "",
|
"nopush": "",
|
||||||
@@ -2401,8 +2416,7 @@
|
|||||||
"selectmedia": "",
|
"selectmedia": "",
|
||||||
"sentby": "",
|
"sentby": "",
|
||||||
"typeamessage": "Enviar un mensaje...",
|
"typeamessage": "Enviar un mensaje...",
|
||||||
"unarchive": "",
|
"unarchive": ""
|
||||||
"no_consent": ""
|
|
||||||
},
|
},
|
||||||
"render": {
|
"render": {
|
||||||
"conversation_list": ""
|
"conversation_list": ""
|
||||||
@@ -2422,6 +2436,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"createdby": "Creado por",
|
"createdby": "Creado por",
|
||||||
"critical": "Crítico",
|
"critical": "Crítico",
|
||||||
|
"pinned": "",
|
||||||
"private": "Privado",
|
"private": "Privado",
|
||||||
"text": "Contenido",
|
"text": "Contenido",
|
||||||
"type": "",
|
"type": "",
|
||||||
@@ -2440,6 +2455,7 @@
|
|||||||
"addtorelatedro": "",
|
"addtorelatedro": "",
|
||||||
"newnoteplaceholder": "Agrega una nota...",
|
"newnoteplaceholder": "Agrega una nota...",
|
||||||
"notetoadd": "",
|
"notetoadd": "",
|
||||||
|
"pinned_note": "",
|
||||||
"systemnotes": "",
|
"systemnotes": "",
|
||||||
"usernotes": ""
|
"usernotes": ""
|
||||||
},
|
},
|
||||||
@@ -2462,13 +2478,15 @@
|
|||||||
"fcm": ""
|
"fcm": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"auto-add-on": "",
|
|
||||||
"auto-add-off": "",
|
|
||||||
"auto-add-success": "",
|
|
||||||
"auto-add-failure": "",
|
|
||||||
"auto-add-description": "",
|
|
||||||
"add-watchers": "",
|
"add-watchers": "",
|
||||||
"add-watchers-team": "",
|
"add-watchers-team": "",
|
||||||
|
"auto-add": "",
|
||||||
|
"auto-add-description": "",
|
||||||
|
"auto-add-failure": "",
|
||||||
|
"auto-add-off": "",
|
||||||
|
"auto-add-on": "",
|
||||||
|
"auto-add-success": "",
|
||||||
|
"employee-notification": "",
|
||||||
"employee-search": "",
|
"employee-search": "",
|
||||||
"mark-all-read": "",
|
"mark-all-read": "",
|
||||||
"new-notification-title": "",
|
"new-notification-title": "",
|
||||||
@@ -2485,8 +2503,7 @@
|
|||||||
"teams-search": "",
|
"teams-search": "",
|
||||||
"unwatch": "",
|
"unwatch": "",
|
||||||
"watch": "",
|
"watch": "",
|
||||||
"watching-issue": "",
|
"watching-issue": ""
|
||||||
"employee-notification": ""
|
|
||||||
},
|
},
|
||||||
"scenarios": {
|
"scenarios": {
|
||||||
"alternate-transport-changed": "",
|
"alternate-transport-changed": "",
|
||||||
@@ -3296,17 +3313,10 @@
|
|||||||
"updated": ""
|
"updated": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"settings": {
|
||||||
|
"title": ""
|
||||||
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"labels": {
|
|
||||||
"my_tasks_center": "",
|
|
||||||
"go_to_job": "",
|
|
||||||
"overdue": "",
|
|
||||||
"due_today": "",
|
|
||||||
"upcoming": "",
|
|
||||||
"no_due_date": "",
|
|
||||||
"ro-number": "",
|
|
||||||
"no_tasks": ""
|
|
||||||
},
|
|
||||||
"actions": {
|
"actions": {
|
||||||
"edit": "",
|
"edit": "",
|
||||||
"new": "",
|
"new": "",
|
||||||
@@ -3321,9 +3331,6 @@
|
|||||||
"myTasks": "",
|
"myTasks": "",
|
||||||
"refresh": ""
|
"refresh": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
|
||||||
"load_failure": ""
|
|
||||||
},
|
|
||||||
"date_presets": {
|
"date_presets": {
|
||||||
"completion": "",
|
"completion": "",
|
||||||
"day": "",
|
"day": "",
|
||||||
@@ -3337,6 +3344,9 @@
|
|||||||
"tomorrow": "",
|
"tomorrow": "",
|
||||||
"two_weeks": ""
|
"two_weeks": ""
|
||||||
},
|
},
|
||||||
|
"errors": {
|
||||||
|
"load_failure": ""
|
||||||
|
},
|
||||||
"failures": {
|
"failures": {
|
||||||
"completed": "",
|
"completed": "",
|
||||||
"created": "",
|
"created": "",
|
||||||
@@ -3371,6 +3381,16 @@
|
|||||||
"remind_at": "",
|
"remind_at": "",
|
||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
|
"labels": {
|
||||||
|
"due_today": "",
|
||||||
|
"go_to_job": "",
|
||||||
|
"my_tasks_center": "",
|
||||||
|
"no_due_date": "",
|
||||||
|
"no_tasks": "",
|
||||||
|
"overdue": "",
|
||||||
|
"ro-number": "",
|
||||||
|
"upcoming": ""
|
||||||
|
},
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"assigned_to": "",
|
"assigned_to": "",
|
||||||
"billid": "",
|
"billid": "",
|
||||||
@@ -3886,18 +3906,6 @@
|
|||||||
"validation": {
|
"validation": {
|
||||||
"unique_vendor_name": ""
|
"unique_vendor_name": ""
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"consent": {
|
|
||||||
"phone_number": "",
|
|
||||||
"associated_owners": "",
|
|
||||||
"created_at": "",
|
|
||||||
"no_owners": "",
|
|
||||||
"phone_1": "",
|
|
||||||
"phone_2": "",
|
|
||||||
"text_body": ""
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"title": ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,6 +426,11 @@
|
|||||||
"messagingtext": "",
|
"messagingtext": "",
|
||||||
"noteslabel": "",
|
"noteslabel": "",
|
||||||
"notestext": "",
|
"notestext": "",
|
||||||
|
"notifications": {
|
||||||
|
"description": "",
|
||||||
|
"invalid_followers": "",
|
||||||
|
"placeholder": ""
|
||||||
|
},
|
||||||
"partslocation": "",
|
"partslocation": "",
|
||||||
"phone": "",
|
"phone": "",
|
||||||
"prodtargethrs": "",
|
"prodtargethrs": "",
|
||||||
@@ -648,15 +653,9 @@
|
|||||||
"use_paint_scale_data": "",
|
"use_paint_scale_data": "",
|
||||||
"uselocalmediaserver": "",
|
"uselocalmediaserver": "",
|
||||||
"website": "",
|
"website": "",
|
||||||
"zip_post": "",
|
"zip_post": ""
|
||||||
"notifications": {
|
|
||||||
"description": "",
|
|
||||||
"placeholder": "",
|
|
||||||
"invalid_followers": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"consent_settings": "",
|
|
||||||
"2tiername": "",
|
"2tiername": "",
|
||||||
"2tiersetup": "",
|
"2tiersetup": "",
|
||||||
"2tiersource": "",
|
"2tiersource": "",
|
||||||
@@ -667,6 +666,7 @@
|
|||||||
"apptcolors": "",
|
"apptcolors": "",
|
||||||
"businessinformation": "",
|
"businessinformation": "",
|
||||||
"checklists": "",
|
"checklists": "",
|
||||||
|
"consent_settings": "",
|
||||||
"csiq": "",
|
"csiq": "",
|
||||||
"customtemplates": "",
|
"customtemplates": "",
|
||||||
"defaultcostsmapping": "",
|
"defaultcostsmapping": "",
|
||||||
@@ -704,6 +704,9 @@
|
|||||||
"messagingpresets": "",
|
"messagingpresets": "",
|
||||||
"notemplatesavailable": "",
|
"notemplatesavailable": "",
|
||||||
"notespresets": "",
|
"notespresets": "",
|
||||||
|
"notifications": {
|
||||||
|
"followers": ""
|
||||||
|
},
|
||||||
"orderstatuses": "",
|
"orderstatuses": "",
|
||||||
"partslocations": "",
|
"partslocations": "",
|
||||||
"partsscan": "",
|
"partsscan": "",
|
||||||
@@ -734,10 +737,7 @@
|
|||||||
"ssbuckets": "",
|
"ssbuckets": "",
|
||||||
"systemsettings": "",
|
"systemsettings": "",
|
||||||
"task-presets": "",
|
"task-presets": "",
|
||||||
"workingdays": "",
|
"workingdays": ""
|
||||||
"notifications": {
|
|
||||||
"followers": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
@@ -783,6 +783,15 @@
|
|||||||
"completed": ""
|
"completed": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"consent": {
|
||||||
|
"associated_owners": "Associated Owners",
|
||||||
|
"created_at": "Opt-Out Date",
|
||||||
|
"no_owners": "No Associated Owners",
|
||||||
|
"phone_1": "Phone 1",
|
||||||
|
"phone_2": "Phone 2",
|
||||||
|
"phone_number": "Phone Number",
|
||||||
|
"text_body": ""
|
||||||
|
},
|
||||||
"contracts": {
|
"contracts": {
|
||||||
"actions": {
|
"actions": {
|
||||||
"changerate": "",
|
"changerate": "",
|
||||||
@@ -975,7 +984,10 @@
|
|||||||
"addcomponent": ""
|
"addcomponent": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
|
"atp": "",
|
||||||
|
"insco": "",
|
||||||
"refreshrequired": "",
|
"refreshrequired": "",
|
||||||
|
"status": "",
|
||||||
"updatinglayout": ""
|
"updatinglayout": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
@@ -998,6 +1010,8 @@
|
|||||||
"productiondollars": "",
|
"productiondollars": "",
|
||||||
"productionhours": "",
|
"productionhours": "",
|
||||||
"projectedmonthlysales": "",
|
"projectedmonthlysales": "",
|
||||||
|
"scheduleddeliverydate": "",
|
||||||
|
"scheduleddeliverytoday": "",
|
||||||
"scheduledindate": "",
|
"scheduledindate": "",
|
||||||
"scheduledintoday": "",
|
"scheduledintoday": "",
|
||||||
"scheduledoutdate": "",
|
"scheduledoutdate": "",
|
||||||
@@ -1230,11 +1244,11 @@
|
|||||||
"fcm": "",
|
"fcm": "",
|
||||||
"notfound": "",
|
"notfound": "",
|
||||||
"sizelimit": "",
|
"sizelimit": "",
|
||||||
"submit-for-testing": "",
|
|
||||||
"sub_status": {
|
"sub_status": {
|
||||||
"expired": "",
|
"expired": "",
|
||||||
"trial-expired": ""
|
"trial-expired": ""
|
||||||
}
|
},
|
||||||
|
"submit-for-testing": ""
|
||||||
},
|
},
|
||||||
"itemtypes": {
|
"itemtypes": {
|
||||||
"contract": "",
|
"contract": "",
|
||||||
@@ -1646,8 +1660,6 @@
|
|||||||
"voiding": ""
|
"voiding": ""
|
||||||
},
|
},
|
||||||
"fields": {
|
"fields": {
|
||||||
"estimate_sent_approval": "",
|
|
||||||
"estimate_approved": "",
|
|
||||||
"active_tasks": "",
|
"active_tasks": "",
|
||||||
"actual_completion": "Achèvement réel",
|
"actual_completion": "Achèvement réel",
|
||||||
"actual_delivery": "Livraison réelle",
|
"actual_delivery": "Livraison réelle",
|
||||||
@@ -1778,6 +1790,8 @@
|
|||||||
"est_ct_ln": "Nom de l'évaluateur",
|
"est_ct_ln": "Nom de l'évaluateur",
|
||||||
"est_ea": "Courriel de l'évaluateur",
|
"est_ea": "Courriel de l'évaluateur",
|
||||||
"est_ph1": "Numéro de téléphone de l'évaluateur",
|
"est_ph1": "Numéro de téléphone de l'évaluateur",
|
||||||
|
"estimate_approved": "",
|
||||||
|
"estimate_sent_approval": "",
|
||||||
"federal_tax_payable": "Impôt fédéral à payer",
|
"federal_tax_payable": "Impôt fédéral à payer",
|
||||||
"federal_tax_rate": "",
|
"federal_tax_rate": "",
|
||||||
"flat_rate_ats": "",
|
"flat_rate_ats": "",
|
||||||
@@ -1961,8 +1975,6 @@
|
|||||||
"scheddates": ""
|
"scheddates": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"sent": "",
|
|
||||||
"approved": "",
|
|
||||||
"accountsreceivable": "",
|
"accountsreceivable": "",
|
||||||
"act_price_ppc": "",
|
"act_price_ppc": "",
|
||||||
"actual_completion_inferred": "",
|
"actual_completion_inferred": "",
|
||||||
@@ -1977,6 +1989,7 @@
|
|||||||
"alreadyaddedtoscoreboard": "",
|
"alreadyaddedtoscoreboard": "",
|
||||||
"alreadyclosed": "",
|
"alreadyclosed": "",
|
||||||
"appointmentconfirmation": "Envoyer une confirmation au client?",
|
"appointmentconfirmation": "Envoyer une confirmation au client?",
|
||||||
|
"approved": "",
|
||||||
"associationwarning": "",
|
"associationwarning": "",
|
||||||
"audit": "",
|
"audit": "",
|
||||||
"available": "",
|
"available": "",
|
||||||
@@ -2167,6 +2180,7 @@
|
|||||||
"sales": "",
|
"sales": "",
|
||||||
"savebeforeconversion": "",
|
"savebeforeconversion": "",
|
||||||
"scheduledinchange": "",
|
"scheduledinchange": "",
|
||||||
|
"sent": "",
|
||||||
"specialcoveragepolicy": "",
|
"specialcoveragepolicy": "",
|
||||||
"state_tax_amt": "",
|
"state_tax_amt": "",
|
||||||
"subletsnotcompleted": "",
|
"subletsnotcompleted": "",
|
||||||
@@ -2383,15 +2397,16 @@
|
|||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"invalidphone": "",
|
"invalidphone": "",
|
||||||
|
"no_consent": "",
|
||||||
"noattachedjobs": "",
|
"noattachedjobs": "",
|
||||||
"updatinglabel": "",
|
"updatinglabel": ""
|
||||||
"no_consent": ""
|
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"addlabel": "",
|
"addlabel": "",
|
||||||
"archive": "",
|
"archive": "",
|
||||||
"maxtenimages": "",
|
"maxtenimages": "",
|
||||||
"messaging": "Messagerie",
|
"messaging": "Messagerie",
|
||||||
|
"no_consent": "",
|
||||||
"noallowtxt": "",
|
"noallowtxt": "",
|
||||||
"nojobs": "",
|
"nojobs": "",
|
||||||
"nopush": "",
|
"nopush": "",
|
||||||
@@ -2401,8 +2416,7 @@
|
|||||||
"selectmedia": "",
|
"selectmedia": "",
|
||||||
"sentby": "",
|
"sentby": "",
|
||||||
"typeamessage": "Envoyer un message...",
|
"typeamessage": "Envoyer un message...",
|
||||||
"unarchive": "",
|
"unarchive": ""
|
||||||
"no_consent": ""
|
|
||||||
},
|
},
|
||||||
"render": {
|
"render": {
|
||||||
"conversation_list": ""
|
"conversation_list": ""
|
||||||
@@ -2422,6 +2436,7 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"createdby": "Créé par",
|
"createdby": "Créé par",
|
||||||
"critical": "Critique",
|
"critical": "Critique",
|
||||||
|
"pinned": "",
|
||||||
"private": "privé",
|
"private": "privé",
|
||||||
"text": "Contenu",
|
"text": "Contenu",
|
||||||
"type": "",
|
"type": "",
|
||||||
@@ -2440,6 +2455,7 @@
|
|||||||
"addtorelatedro": "",
|
"addtorelatedro": "",
|
||||||
"newnoteplaceholder": "Ajouter une note...",
|
"newnoteplaceholder": "Ajouter une note...",
|
||||||
"notetoadd": "",
|
"notetoadd": "",
|
||||||
|
"pinned_note": "",
|
||||||
"systemnotes": "",
|
"systemnotes": "",
|
||||||
"usernotes": ""
|
"usernotes": ""
|
||||||
},
|
},
|
||||||
@@ -2462,13 +2478,15 @@
|
|||||||
"fcm": ""
|
"fcm": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"auto-add-on": "",
|
|
||||||
"auto-add-off": "",
|
|
||||||
"auto-add-success": "",
|
|
||||||
"auto-add-failure": "",
|
|
||||||
"auto-add-description": "",
|
|
||||||
"add-watchers": "",
|
"add-watchers": "",
|
||||||
"add-watchers-team": "",
|
"add-watchers-team": "",
|
||||||
|
"auto-add": "",
|
||||||
|
"auto-add-description": "",
|
||||||
|
"auto-add-failure": "",
|
||||||
|
"auto-add-off": "",
|
||||||
|
"auto-add-on": "",
|
||||||
|
"auto-add-success": "",
|
||||||
|
"employee-notification": "",
|
||||||
"employee-search": "",
|
"employee-search": "",
|
||||||
"mark-all-read": "",
|
"mark-all-read": "",
|
||||||
"new-notification-title": "",
|
"new-notification-title": "",
|
||||||
@@ -2485,8 +2503,7 @@
|
|||||||
"teams-search": "",
|
"teams-search": "",
|
||||||
"unwatch": "",
|
"unwatch": "",
|
||||||
"watch": "",
|
"watch": "",
|
||||||
"watching-issue": "",
|
"watching-issue": ""
|
||||||
"employee-notification": ""
|
|
||||||
},
|
},
|
||||||
"scenarios": {
|
"scenarios": {
|
||||||
"alternate-transport-changed": "",
|
"alternate-transport-changed": "",
|
||||||
@@ -3296,17 +3313,10 @@
|
|||||||
"updated": ""
|
"updated": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"settings": {
|
||||||
|
"title": ""
|
||||||
|
},
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"labels": {
|
|
||||||
"my_tasks_center": "",
|
|
||||||
"go_to_job": "",
|
|
||||||
"overdue": "",
|
|
||||||
"due_today": "",
|
|
||||||
"upcoming": "",
|
|
||||||
"no_due_date": "",
|
|
||||||
"ro-number": "",
|
|
||||||
"no_tasks": ""
|
|
||||||
},
|
|
||||||
"actions": {
|
"actions": {
|
||||||
"edit": "",
|
"edit": "",
|
||||||
"new": "",
|
"new": "",
|
||||||
@@ -3321,9 +3331,6 @@
|
|||||||
"myTasks": "",
|
"myTasks": "",
|
||||||
"refresh": ""
|
"refresh": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
|
||||||
"load_failure": ""
|
|
||||||
},
|
|
||||||
"date_presets": {
|
"date_presets": {
|
||||||
"completion": "",
|
"completion": "",
|
||||||
"day": "",
|
"day": "",
|
||||||
@@ -3337,6 +3344,9 @@
|
|||||||
"tomorrow": "",
|
"tomorrow": "",
|
||||||
"two_weeks": ""
|
"two_weeks": ""
|
||||||
},
|
},
|
||||||
|
"errors": {
|
||||||
|
"load_failure": ""
|
||||||
|
},
|
||||||
"failures": {
|
"failures": {
|
||||||
"completed": "",
|
"completed": "",
|
||||||
"created": "",
|
"created": "",
|
||||||
@@ -3371,6 +3381,16 @@
|
|||||||
"remind_at": "",
|
"remind_at": "",
|
||||||
"title": ""
|
"title": ""
|
||||||
},
|
},
|
||||||
|
"labels": {
|
||||||
|
"due_today": "",
|
||||||
|
"go_to_job": "",
|
||||||
|
"my_tasks_center": "",
|
||||||
|
"no_due_date": "",
|
||||||
|
"no_tasks": "",
|
||||||
|
"overdue": "",
|
||||||
|
"ro-number": "",
|
||||||
|
"upcoming": ""
|
||||||
|
},
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"assigned_to": "",
|
"assigned_to": "",
|
||||||
"billid": "",
|
"billid": "",
|
||||||
@@ -3886,18 +3906,6 @@
|
|||||||
"validation": {
|
"validation": {
|
||||||
"unique_vendor_name": ""
|
"unique_vendor_name": ""
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"consent": {
|
|
||||||
"phone_number": "Phone Number",
|
|
||||||
"associated_owners": "Associated Owners",
|
|
||||||
"created_at": "Opt-Out Date",
|
|
||||||
"no_owners": "No Associated Owners",
|
|
||||||
"phone_1": "Phone 1",
|
|
||||||
"phone_2": "Phone 2",
|
|
||||||
"text_body": ""
|
|
||||||
},
|
|
||||||
"settings": {
|
|
||||||
"title": ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4909,6 +4909,7 @@
|
|||||||
- critical
|
- critical
|
||||||
- id
|
- id
|
||||||
- jobid
|
- jobid
|
||||||
|
- pinned
|
||||||
- private
|
- private
|
||||||
- text
|
- text
|
||||||
- type
|
- type
|
||||||
@@ -4923,6 +4924,7 @@
|
|||||||
- critical
|
- critical
|
||||||
- id
|
- id
|
||||||
- jobid
|
- jobid
|
||||||
|
- pinned
|
||||||
- private
|
- private
|
||||||
- text
|
- text
|
||||||
- type
|
- type
|
||||||
@@ -4947,6 +4949,7 @@
|
|||||||
- critical
|
- critical
|
||||||
- id
|
- id
|
||||||
- jobid
|
- jobid
|
||||||
|
- pinned
|
||||||
- private
|
- private
|
||||||
- text
|
- text
|
||||||
- type
|
- type
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."notes" add column "pinned" boolean
|
||||||
|
-- not null default 'false';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."notes" add column "pinned" boolean
|
||||||
|
not null default 'false';
|
||||||
@@ -19,7 +19,7 @@ async function JobCosting(req, res) {
|
|||||||
const client = req.userGraphQLClient;
|
const client = req.userGraphQLClient;
|
||||||
|
|
||||||
//Uncomment for further testing
|
//Uncomment for further testing
|
||||||
// logger.log("job-costing-start", "DEBUG", req.user.email, jobid, null);
|
logger.log("job-costing-start", "DEBUG", req.user.email, jobid, null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await client.setHeaders({ Authorization: BearerToken }).request(queries.QUERY_JOB_COSTING_DETAILS, {
|
const resp = await client.setHeaders({ Authorization: BearerToken }).request(queries.QUERY_JOB_COSTING_DETAILS, {
|
||||||
@@ -47,9 +47,9 @@ async function JobCostingMulti(req, res) {
|
|||||||
const client = req.userGraphQLClient;
|
const client = req.userGraphQLClient;
|
||||||
|
|
||||||
//Uncomment for further testing
|
//Uncomment for further testing
|
||||||
// logger.log("job-costing-multi-start", "DEBUG", req?.user?.email, null, {
|
logger.log("job-costing-multi-start", "DEBUG", req?.user?.email, null, {
|
||||||
// jobids
|
jobids
|
||||||
// });
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const resp = await client
|
const resp = await client
|
||||||
@@ -589,7 +589,7 @@ function GenerateCostingData(job) {
|
|||||||
amount: Math.round((job.storage_payable || 0) * 100)
|
amount: Math.round((job.storage_payable || 0) * 100)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//Is it a DMS Setup?
|
//Is it a DMS Setup?
|
||||||
const selectedDmsAllocationConfig =
|
const selectedDmsAllocationConfig =
|
||||||
(job.bodyshop.md_responsibility_centers.dms_defaults &&
|
(job.bodyshop.md_responsibility_centers.dms_defaults &&
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const getLifecycleStatusColor = require("../utils/getLifecycleStatusColor");
|
|||||||
const jobLifecycle = async (req, res) => {
|
const jobLifecycle = async (req, res) => {
|
||||||
// Grab the jobids and statuses from the request body
|
// Grab the jobids and statuses from the request body
|
||||||
const { jobids, statuses } = req.body;
|
const { jobids, statuses } = req.body;
|
||||||
|
const { logger } = req;
|
||||||
|
|
||||||
if (!jobids) {
|
if (!jobids) {
|
||||||
return res.status(400).json({
|
return res.status(400).json({
|
||||||
@@ -16,102 +17,118 @@ const jobLifecycle = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const jobIDs = _.isArray(jobids) ? jobids : [jobids];
|
const jobIDs = _.isArray(jobids) ? jobids : [jobids];
|
||||||
const client = req.userGraphQLClient;
|
|
||||||
const resp = await client.request(queries.QUERY_TRANSITIONS_BY_JOBID, { jobids: jobIDs });
|
|
||||||
|
|
||||||
const transitions = resp.transitions;
|
logger.log("job-lifecycle-start", "DEBUG", req?.user?.email, null, {
|
||||||
|
jobids: jobIDs
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const client = req.userGraphQLClient;
|
||||||
|
const resp = await client.request(queries.QUERY_TRANSITIONS_BY_JOBID, { jobids: jobIDs });
|
||||||
|
|
||||||
|
const transitions = resp.transitions;
|
||||||
|
|
||||||
|
if (!transitions) {
|
||||||
|
return res.status(200).json({
|
||||||
|
jobIDs,
|
||||||
|
transitions: []
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const transitionsByJobId = _.groupBy(resp.transitions, "jobid");
|
||||||
|
|
||||||
|
const groupedTransitions = {};
|
||||||
|
const allDurations = [];
|
||||||
|
|
||||||
|
for (let jobId in transitionsByJobId) {
|
||||||
|
let lifecycle = transitionsByJobId[jobId].map((transition) => {
|
||||||
|
transition.start_readable = transition.start ? moment(transition.start).fromNow() : "N/A";
|
||||||
|
transition.end_readable = transition.end ? moment(transition.end).fromNow() : "N/A";
|
||||||
|
|
||||||
|
if (transition.duration) {
|
||||||
|
transition.duration_seconds = Math.round(transition.duration / 1000);
|
||||||
|
transition.duration_minutes = Math.round(transition.duration_seconds / 60);
|
||||||
|
let duration = moment.duration(transition.duration);
|
||||||
|
transition.duration_readable = durationToHumanReadable(duration);
|
||||||
|
} else {
|
||||||
|
transition.duration_seconds = 0;
|
||||||
|
transition.duration_minutes = 0;
|
||||||
|
transition.duration_readable = "N/A";
|
||||||
|
}
|
||||||
|
return transition;
|
||||||
|
});
|
||||||
|
|
||||||
|
const durations = calculateStatusDuration(lifecycle, statuses);
|
||||||
|
|
||||||
|
groupedTransitions[jobId] = {
|
||||||
|
lifecycle,
|
||||||
|
durations
|
||||||
|
};
|
||||||
|
|
||||||
|
if (durations?.summations) {
|
||||||
|
allDurations.push(durations.summations);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const finalSummations = [];
|
||||||
|
const flatGroupedAllDurations = _.groupBy(allDurations.flat(), "status");
|
||||||
|
|
||||||
|
const finalStatusCounts = Object.keys(flatGroupedAllDurations).reduce((acc, status) => {
|
||||||
|
acc[status] = flatGroupedAllDurations[status].length;
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
// Calculate total value of all statuses
|
||||||
|
const finalTotal = Object.values(flatGroupedAllDurations).reduce((total, statusArr) => {
|
||||||
|
return total + statusArr.reduce((acc, curr) => acc + curr.value, 0);
|
||||||
|
}, 0);
|
||||||
|
|
||||||
|
Object.keys(flatGroupedAllDurations).forEach((status) => {
|
||||||
|
const value = flatGroupedAllDurations[status].reduce((acc, curr) => acc + curr.value, 0);
|
||||||
|
const humanReadable = durationToHumanReadable(moment.duration(value));
|
||||||
|
const percentage = finalTotal > 0 ? (value / finalTotal) * 100 : 0;
|
||||||
|
const color = getLifecycleStatusColor(status);
|
||||||
|
const roundedPercentage = `${Math.round(percentage)}%`;
|
||||||
|
const averageValue = _.size(jobIDs) > 0 ? value / jobIDs.length : 0;
|
||||||
|
const averageHumanReadable = durationToHumanReadable(moment.duration(averageValue));
|
||||||
|
finalSummations.push({
|
||||||
|
status,
|
||||||
|
value,
|
||||||
|
humanReadable,
|
||||||
|
percentage,
|
||||||
|
color,
|
||||||
|
roundedPercentage,
|
||||||
|
averageValue,
|
||||||
|
averageHumanReadable
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if (!transitions) {
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
jobIDs,
|
jobIDs,
|
||||||
transitions: []
|
transition: groupedTransitions,
|
||||||
});
|
durations: {
|
||||||
}
|
jobs: jobIDs.length,
|
||||||
|
summations: finalSummations,
|
||||||
const transitionsByJobId = _.groupBy(resp.transitions, "jobid");
|
totalStatuses: finalSummations.length,
|
||||||
|
total: finalTotal,
|
||||||
const groupedTransitions = {};
|
statusCounts: finalStatusCounts,
|
||||||
const allDurations = [];
|
humanReadable: durationToHumanReadable(moment.duration(finalTotal)),
|
||||||
|
averageValue: _.size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0,
|
||||||
for (let jobId in transitionsByJobId) {
|
averageHumanReadable:
|
||||||
let lifecycle = transitionsByJobId[jobId].map((transition) => {
|
_.size(jobIDs) > 0
|
||||||
transition.start_readable = transition.start ? moment(transition.start).fromNow() : "N/A";
|
? durationToHumanReadable(moment.duration(finalTotal / jobIDs.length))
|
||||||
transition.end_readable = transition.end ? moment(transition.end).fromNow() : "N/A";
|
: durationToHumanReadable(moment.duration(0))
|
||||||
|
|
||||||
if (transition.duration) {
|
|
||||||
transition.duration_seconds = Math.round(transition.duration / 1000);
|
|
||||||
transition.duration_minutes = Math.round(transition.duration_seconds / 60);
|
|
||||||
let duration = moment.duration(transition.duration);
|
|
||||||
transition.duration_readable = durationToHumanReadable(duration);
|
|
||||||
} else {
|
|
||||||
transition.duration_seconds = 0;
|
|
||||||
transition.duration_minutes = 0;
|
|
||||||
transition.duration_readable = "N/A";
|
|
||||||
}
|
}
|
||||||
return transition;
|
|
||||||
});
|
});
|
||||||
|
} catch (error) {
|
||||||
const durations = calculateStatusDuration(lifecycle, statuses);
|
logger.log("job-lifecycle-error", "ERROR", req?.user?.email, null, {
|
||||||
|
jobids: jobIDs,
|
||||||
groupedTransitions[jobId] = {
|
statuses: statuses ? JSON.stringify(statuses) : "N/A",
|
||||||
lifecycle,
|
error: error.message
|
||||||
durations
|
});
|
||||||
};
|
return res.status(500).json({
|
||||||
|
error: "Internal server error"
|
||||||
if (durations?.summations) {
|
});
|
||||||
allDurations.push(durations.summations);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const finalSummations = [];
|
|
||||||
const flatGroupedAllDurations = _.groupBy(allDurations.flat(), "status");
|
|
||||||
|
|
||||||
const finalStatusCounts = Object.keys(flatGroupedAllDurations).reduce((acc, status) => {
|
|
||||||
acc[status] = flatGroupedAllDurations[status].length;
|
|
||||||
return acc;
|
|
||||||
}, {});
|
|
||||||
// Calculate total value of all statuses
|
|
||||||
const finalTotal = Object.values(flatGroupedAllDurations).reduce((total, statusArr) => {
|
|
||||||
return total + statusArr.reduce((acc, curr) => acc + curr.value, 0);
|
|
||||||
}, 0);
|
|
||||||
|
|
||||||
Object.keys(flatGroupedAllDurations).forEach((status) => {
|
|
||||||
const value = flatGroupedAllDurations[status].reduce((acc, curr) => acc + curr.value, 0);
|
|
||||||
const humanReadable = durationToHumanReadable(moment.duration(value));
|
|
||||||
const percentage = finalTotal > 0 ? (value / finalTotal) * 100 : 0;
|
|
||||||
const color = getLifecycleStatusColor(status);
|
|
||||||
const roundedPercentage = `${Math.round(percentage)}%`;
|
|
||||||
const averageValue = _.size(jobIDs) > 0 ? value / jobIDs.length : 0;
|
|
||||||
const averageHumanReadable = durationToHumanReadable(moment.duration(averageValue));
|
|
||||||
finalSummations.push({
|
|
||||||
status,
|
|
||||||
value,
|
|
||||||
humanReadable,
|
|
||||||
percentage,
|
|
||||||
color,
|
|
||||||
roundedPercentage,
|
|
||||||
averageValue,
|
|
||||||
averageHumanReadable
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return res.status(200).json({
|
|
||||||
jobIDs,
|
|
||||||
transition: groupedTransitions,
|
|
||||||
durations: {
|
|
||||||
jobs: jobIDs.length,
|
|
||||||
summations: finalSummations,
|
|
||||||
totalStatuses: finalSummations.length,
|
|
||||||
total: finalTotal,
|
|
||||||
statusCounts: finalStatusCounts,
|
|
||||||
humanReadable: durationToHumanReadable(moment.duration(finalTotal)),
|
|
||||||
averageValue: _.size(jobIDs) > 0 ? finalTotal / jobIDs.length : 0,
|
|
||||||
averageHumanReadable:
|
|
||||||
_.size(jobIDs) > 0
|
|
||||||
? durationToHumanReadable(moment.duration(finalTotal / jobIDs.length))
|
|
||||||
: durationToHumanReadable(moment.duration(0))
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = jobLifecycle;
|
module.exports = jobLifecycle;
|
||||||
|
|||||||
@@ -50,7 +50,12 @@ const autoAddWatchers = async (req) => {
|
|||||||
try {
|
try {
|
||||||
// Fetch bodyshop data from Redis
|
// Fetch bodyshop data from Redis
|
||||||
const bodyshopData = await getBodyshopFromRedis(shopId);
|
const bodyshopData = await getBodyshopFromRedis(shopId);
|
||||||
const notificationFollowers = bodyshopData?.notification_followers || [];
|
let notificationFollowers = bodyshopData?.notification_followers;
|
||||||
|
|
||||||
|
// Bail if notification_followers is missing or not an array
|
||||||
|
if (!notificationFollowers || !Array.isArray(notificationFollowers)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Execute queries in parallel
|
// Execute queries in parallel
|
||||||
const [notificationData, existingWatchersData] = await Promise.all([
|
const [notificationData, existingWatchersData] = await Promise.all([
|
||||||
|
|||||||
Reference in New Issue
Block a user