@@ -1,4 +1,4 @@
|
|||||||
<babeledit_project version="1.2" be_version="2.7.1">
|
<babeledit_project be_version="2.7.1" version="1.2">
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
BabelEdit project file
|
BabelEdit project file
|
||||||
@@ -500,6 +500,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>end</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>note</name>
|
<name>note</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -521,6 +542,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>start</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>time</name>
|
<name>time</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -673,6 +715,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>dataconsistency</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>history</name>
|
<name>history</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -715,6 +778,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>manualevent</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>noarrivingjobs</name>
|
<name>noarrivingjobs</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -13183,6 +13267,27 @@
|
|||||||
<folder_node>
|
<folder_node>
|
||||||
<name>actions</name>
|
<name>actions</name>
|
||||||
<children>
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>addvacation</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>new</name>
|
<name>new</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -13571,6 +13676,74 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>vacation</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>end</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>length</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>start</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
@@ -13597,6 +13770,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>endmustbeafterstart</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>flat_rate</name>
|
<name>flat_rate</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -21431,6 +21625,27 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>invoice_final_note</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>kmin</name>
|
<name>kmin</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -26883,6 +27098,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>suspended</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>suspense</name>
|
<name>suspense</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -33986,6 +34222,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>folder_label_multiple</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>glass_express_checklist</name>
|
<name>glass_express_checklist</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -35522,6 +35779,48 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>suspend</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>unsuspend</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ export function BillEnterModalLinesComponent({
|
|||||||
actual_price: opt.cost,
|
actual_price: opt.cost,
|
||||||
cost_center: opt.part_type
|
cost_center: opt.part_type
|
||||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||||
? opt.part_type
|
? opt.part_type !== "PAE"
|
||||||
|
? opt.part_type
|
||||||
|
: null
|
||||||
: responsibilityCenters.defaults &&
|
: responsibilityCenters.defaults &&
|
||||||
(responsibilityCenters.defaults.costs[
|
(responsibilityCenters.defaults.costs[
|
||||||
opt.part_type
|
opt.part_type
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import { GenerateDocument } from "../../utils/RenderTemplate";
|
|||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
|
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||||
import ScheduleAtChange from "./job-at-change.component";
|
import ScheduleAtChange from "./job-at-change.component";
|
||||||
import ScheduleEventColor from "./schedule-event.color.component";
|
import ScheduleEventColor from "./schedule-event.color.component";
|
||||||
import ScheduleEventNote from "./schedule-event.note.component";
|
import ScheduleEventNote from "./schedule-event.note.component";
|
||||||
@@ -66,7 +67,10 @@ export function ScheduleEventComponent({
|
|||||||
const popoverContent = (
|
const popoverContent = (
|
||||||
<div style={{ maxWidth: "40vw" }}>
|
<div style={{ maxWidth: "40vw" }}>
|
||||||
{!event.isintake ? (
|
{!event.isintake ? (
|
||||||
<strong>{event.title}</strong>
|
<Space>
|
||||||
|
<strong>{event.title}</strong>
|
||||||
|
<ScheduleEventColor event={event} />
|
||||||
|
</Space>
|
||||||
) : (
|
) : (
|
||||||
<Space>
|
<Space>
|
||||||
<strong>{`${(event.job && event.job.ownr_fn) || ""} ${
|
<strong>{`${(event.job && event.job.ownr_fn) || ""} ${
|
||||||
@@ -118,7 +122,9 @@ export function ScheduleEventComponent({
|
|||||||
</DataLabel>
|
</DataLabel>
|
||||||
<ScheduleEventNote event={event} />
|
<ScheduleEventNote event={event} />
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : (
|
||||||
|
<div>{event.note || ""}</div>
|
||||||
|
)}
|
||||||
<Divider />
|
<Divider />
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{event.job ? (
|
{event.job ? (
|
||||||
@@ -140,84 +146,89 @@ export function ScheduleEventComponent({
|
|||||||
{t("appointments.actions.preview")}
|
{t("appointments.actions.preview")}
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
|
{event.job ? (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
overlay={
|
overlay={
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const Template = TemplateList("job").appointment_reminder;
|
const Template = TemplateList("job").appointment_reminder;
|
||||||
GenerateDocument(
|
GenerateDocument(
|
||||||
{
|
{
|
||||||
name: Template.key,
|
name: Template.key,
|
||||||
variables: { id: event.job.id },
|
variables: { id: event.job.id },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
to: event.job && event.job.ownr_ea,
|
to: event.job && event.job.ownr_ea,
|
||||||
subject: Template.subject,
|
subject: Template.subject,
|
||||||
},
|
},
|
||||||
"e",
|
"e",
|
||||||
event.job && event.job.id
|
event.job && event.job.id
|
||||||
);
|
|
||||||
}}
|
|
||||||
disabled={event.arrived}
|
|
||||||
>
|
|
||||||
{t("general.labels.email")}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item
|
|
||||||
onClick={() => {
|
|
||||||
const p = parsePhoneNumber(event.job.ownr_ph1, "CA");
|
|
||||||
if (p && p.isValid()) {
|
|
||||||
openChatByPhone({
|
|
||||||
phone_num: p.formatInternational(),
|
|
||||||
jobid: event.job.id,
|
|
||||||
});
|
|
||||||
setMessage(
|
|
||||||
t("appointments.labels.reminder", {
|
|
||||||
shopname: bodyshop.shopname,
|
|
||||||
date: moment(event.start).format("MM/DD/YYYY"),
|
|
||||||
time: moment(event.start).format("HH:mm a"),
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
setVisible(false);
|
}}
|
||||||
} else {
|
disabled={event.arrived}
|
||||||
notification["error"]({
|
>
|
||||||
message: t("messaging.error.invalidphone"),
|
{t("general.labels.email")}
|
||||||
});
|
</Menu.Item>
|
||||||
}
|
<Menu.Item
|
||||||
}}
|
onClick={() => {
|
||||||
disabled={event.arrived || !bodyshop.messagingservicesid}
|
const p = parsePhoneNumber(event.job.ownr_ph1, "CA");
|
||||||
>
|
if (p && p.isValid()) {
|
||||||
{t("general.labels.sms")}
|
openChatByPhone({
|
||||||
</Menu.Item>
|
phone_num: p.formatInternational(),
|
||||||
</Menu>
|
jobid: event.job.id,
|
||||||
}
|
});
|
||||||
>
|
setMessage(
|
||||||
<Button>{t("appointments.actions.sendreminder")}</Button>
|
t("appointments.labels.reminder", {
|
||||||
</Dropdown>
|
shopname: bodyshop.shopname,
|
||||||
|
date: moment(event.start).format("MM/DD/YYYY"),
|
||||||
|
time: moment(event.start).format("HH:mm a"),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
setVisible(false);
|
||||||
|
} else {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("messaging.error.invalidphone"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={event.arrived || !bodyshop.messagingservicesid}
|
||||||
|
>
|
||||||
|
{t("general.labels.sms")}
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Button>{t("appointments.actions.sendreminder")}</Button>
|
||||||
|
</Dropdown>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<Button onClick={() => handleCancel(event.id)} disabled={event.arrived}>
|
<Button onClick={() => handleCancel(event.id)} disabled={event.arrived}>
|
||||||
{t("appointments.actions.cancel")}
|
{t("appointments.actions.cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
{event.isintake ? (
|
||||||
disabled={event.arrived}
|
<Button
|
||||||
onClick={() => {
|
disabled={event.arrived}
|
||||||
setVisible(false);
|
onClick={() => {
|
||||||
setScheduleContext({
|
setVisible(false);
|
||||||
actions: { refetch: refetch },
|
setScheduleContext({
|
||||||
context: {
|
actions: { refetch: refetch },
|
||||||
jobId: event.job.id,
|
context: {
|
||||||
job: event.job,
|
jobId: event.job.id,
|
||||||
previousEvent: event.id,
|
job: event.job,
|
||||||
color: event.color,
|
previousEvent: event.id,
|
||||||
alt_transport: event.job && event.job.alt_transport,
|
color: event.color,
|
||||||
note: event.note,
|
alt_transport: event.job && event.job.alt_transport,
|
||||||
},
|
note: event.note,
|
||||||
});
|
},
|
||||||
}}
|
});
|
||||||
>
|
}}
|
||||||
{t("appointments.actions.reschedule")}
|
>
|
||||||
</Button>
|
{t("appointments.actions.reschedule")}
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<ScheduleManualEvent event={event} />
|
||||||
|
)}
|
||||||
{event.isintake ? (
|
{event.isintake ? (
|
||||||
<Link
|
<Link
|
||||||
to={{
|
to={{
|
||||||
@@ -235,7 +246,13 @@ export function ScheduleEventComponent({
|
|||||||
);
|
);
|
||||||
|
|
||||||
const RegularEvent = event.isintake ? (
|
const RegularEvent = event.isintake ? (
|
||||||
<div style={{ display: "flex", flexWrap: "wrap" }}>
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexWrap: "wrap",
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Space>
|
<Space>
|
||||||
{event.note && <AlertFilled className="production-alert" />}
|
{event.note && <AlertFilled className="production-alert" />}
|
||||||
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
<strong>{`${event.job.ro_number || t("general.labels.na")}`}</strong>
|
||||||
@@ -262,7 +279,7 @@ export function ScheduleEventComponent({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div>
|
<div style={{ height: "100%", width: "100%" }}>
|
||||||
<strong>{`${event.title || ""}`}</strong>
|
<strong>{`${event.title || ""}`}</strong>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -270,7 +287,7 @@ export function ScheduleEventComponent({
|
|||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
visible={visible}
|
visible={visible}
|
||||||
onVisibleChange={(vis) => setVisible(vis)}
|
onVisibleChange={(vis) => !event.vacation && setVisible(vis)}
|
||||||
trigger="click"
|
trigger="click"
|
||||||
content={event.block ? blockContent : popoverContent}
|
content={event.block ? blockContent : popoverContent}
|
||||||
style={{ height: "100%", width: "100%" }}
|
style={{ height: "100%", width: "100%" }}
|
||||||
|
|||||||
@@ -89,6 +89,19 @@ export function JobsDetailHeaderActions({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleSuspend = (e) => {
|
||||||
|
logImEXEvent("production_toggle_alert");
|
||||||
|
//e.stopPropagation();
|
||||||
|
updateJob({
|
||||||
|
variables: {
|
||||||
|
jobId: job.id,
|
||||||
|
job: {
|
||||||
|
suspended: !job.suspended,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const statusmenu = (
|
const statusmenu = (
|
||||||
<Menu key="popovermenu">
|
<Menu key="popovermenu">
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
@@ -199,7 +212,11 @@ export function JobsDetailHeaderActions({
|
|||||||
{t("jobs.actions.addtoproduction")}
|
{t("jobs.actions.addtoproduction")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
)}
|
)}
|
||||||
|
<Menu.Item key="togglesuspend" onClick={handleSuspend}>
|
||||||
|
{job.suspended
|
||||||
|
? t("production.actions.unsuspend")
|
||||||
|
: t("production.actions.suspend")}
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
|
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
|
||||||
{job.production_vars && job.production_vars.alert
|
{job.production_vars && job.production_vars.alert
|
||||||
? t("production.labels.alertoff")
|
? t("production.labels.alertoff")
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { Card, Col, Row, Space, Tag } from "antd";
|
import { Card, Col, Row, Space, Tag } from "antd";
|
||||||
import { WarningFilled, ExclamationCircleFilled } from "@ant-design/icons";
|
import {
|
||||||
|
WarningFilled,
|
||||||
|
ExclamationCircleFilled,
|
||||||
|
PauseCircleOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
import React, { useMemo } from "react";
|
import React, { useMemo } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -68,6 +72,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
{t("jobs.labels.inproduction")}
|
{t("jobs.labels.inproduction")}
|
||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
|
{job.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
{job.production_vars && job.production_vars.alert ? (
|
{job.production_vars && job.production_vars.alert ? (
|
||||||
<ExclamationCircleFilled className="production-alert" />
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { SyncOutlined, ExclamationCircleFilled } from "@ant-design/icons";
|
import {
|
||||||
|
SyncOutlined,
|
||||||
|
ExclamationCircleFilled,
|
||||||
|
PauseCircleOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Grid, Input, Space, Table } from "antd";
|
import { Button, Card, Grid, Input, Space, Table } from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
@@ -111,6 +115,9 @@ export function JobsList({ bodyshop }) {
|
|||||||
{record.production_vars && record.production_vars.alert ? (
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
<ExclamationCircleFilled className="production-alert" />
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
) : null}
|
) : null}
|
||||||
|
{record.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
EyeInvisibleFilled,
|
EyeInvisibleFilled,
|
||||||
WarningFilled,
|
WarningFilled,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Button, Card, Space, Table } from "antd";
|
import { Button, Card, Form, Input, Space, Table } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -14,6 +14,7 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors
|
|||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
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";
|
||||||
|
|
||||||
@@ -131,32 +132,42 @@ export function JobNotesComponent({
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<div>
|
||||||
title={t("jobs.labels.notes")}
|
<LayoutFormRow>
|
||||||
extra={
|
<Form.Item
|
||||||
<Button
|
label={t("jobs.fields.invoice_final_note")}
|
||||||
onClick={() => {
|
name="invoice_final_note"
|
||||||
setNoteUpsertContext({
|
|
||||||
actions: { refetch: refetch },
|
|
||||||
context: {
|
|
||||||
jobId: jobId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{t("notes.actions.new")}
|
<Input.TextArea disabled={jobRO} />
|
||||||
</Button>
|
</Form.Item>
|
||||||
}
|
</LayoutFormRow>
|
||||||
>
|
<Card
|
||||||
<NoteUpsertModal />
|
title={t("jobs.labels.notes")}
|
||||||
|
extra={
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setNoteUpsertContext({
|
||||||
|
actions: { refetch: refetch },
|
||||||
|
context: {
|
||||||
|
jobId: jobId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("notes.actions.new")}
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<NoteUpsertModal />
|
||||||
|
|
||||||
<Table
|
<Table
|
||||||
loading={loading}
|
loading={loading}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
dataSource={data}
|
dataSource={data}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobNotesComponent);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobNotesComponent);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
PageHeader,
|
PageHeader,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Space,
|
Space,
|
||||||
Table
|
Table,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
@@ -168,7 +168,9 @@ export function PartsOrderListTableComponent({
|
|||||||
|
|
||||||
cost_center: pol.jobline?.part_type
|
cost_center: pol.jobline?.part_type
|
||||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||||
? pol.jobline.part_type
|
? pol.jobline.part_type !== "PAE"
|
||||||
|
? pol.jobline.part_type
|
||||||
|
: null
|
||||||
: responsibilityCenters.defaults &&
|
: responsibilityCenters.defaults &&
|
||||||
(responsibilityCenters.defaults.costs[
|
(responsibilityCenters.defaults.costs[
|
||||||
pol.jobline.part_type
|
pol.jobline.part_type
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) {
|
|||||||
context: restVals,
|
context: restVals,
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
"p"
|
"p",
|
||||||
|
jobId
|
||||||
);
|
);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setIsModalVisible(false);
|
setIsModalVisible(false);
|
||||||
@@ -61,10 +62,10 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) {
|
|||||||
label={t("printcenter.jobs.labels.position")}
|
label={t("printcenter.jobs.labels.position")}
|
||||||
name="position"
|
name="position"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} precision={0} />
|
<InputNumber min={1} precision={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("printcenter.jobs.labels.count")} name="count">
|
<Form.Item label={t("printcenter.jobs.labels.count")} name="count">
|
||||||
<InputNumber min={0} precision={0} />
|
<InputNumber min={1} precision={0} max={99} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button type="primary" loading={loading} onClick={handleOk}>
|
<Button type="primary" loading={loading} onClick={handleOk}>
|
||||||
{t("general.actions.print")}
|
{t("general.actions.print")}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { CalendarOutlined, EyeFilled } from "@ant-design/icons";
|
import {
|
||||||
|
CalendarOutlined,
|
||||||
|
EyeFilled,
|
||||||
|
PauseCircleOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
import { Card, Col, Row, Space } from "antd";
|
import { Card, Col, Row, Space } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -40,6 +44,9 @@ export default function ProductionBoardCard(
|
|||||||
title={
|
title={
|
||||||
<Space>
|
<Space>
|
||||||
<ProductionAlert record={card} key="alert" />
|
<ProductionAlert record={card} key="alert" />
|
||||||
|
{card.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
<span style={{ fontWeight: "bolder" }}>
|
<span style={{ fontWeight: "bolder" }}>
|
||||||
{card.ro_number || t("general.labels.na")}
|
{card.ro_number || t("general.labels.na")}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ export default function ProductionListColumnBodyPriority({ record }) {
|
|||||||
title={t("production.actions.bodypriority-set")}
|
title={t("production.actions.bodypriority-set")}
|
||||||
>
|
>
|
||||||
{new Array(15).fill().map((value, index) => (
|
{new Array(15).fill().map((value, index) => (
|
||||||
<Menu.Item key={index + 1}>{index + 1}</Menu.Item>
|
<Menu.Item key={index + 1}>
|
||||||
|
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||||
|
{index + 1}
|
||||||
|
</div>
|
||||||
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { PauseCircleOutlined } from "@ant-design/icons";
|
||||||
|
import { Space } from "antd";
|
||||||
import i18n from "i18next";
|
import i18n from "i18next";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -43,9 +45,19 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => {
|
|||||||
technician ? (
|
technician ? (
|
||||||
<Link to={`/tech/joblookup?selected=${record.id}`}>
|
<Link to={`/tech/joblookup?selected=${record.id}`}>
|
||||||
{record.ro_number}
|
{record.ro_number}
|
||||||
|
{record.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<Link to={`/manage/jobs/${record.id}`}>{record.ro_number}</Link>
|
<Link to={`/manage/jobs/${record.id}`}>
|
||||||
|
<Space>
|
||||||
|
{record.ro_number}
|
||||||
|
{record.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
</Link>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ export default function ProductionListColumnDetailPriority({ record }) {
|
|||||||
title={t("production.actions.detailpriority-set")}
|
title={t("production.actions.detailpriority-set")}
|
||||||
>
|
>
|
||||||
{new Array(15).fill().map((value, index) => (
|
{new Array(15).fill().map((value, index) => (
|
||||||
<Menu.Item key={index + 1}>{index + 1}</Menu.Item>
|
<Menu.Item key={index + 1}>
|
||||||
|
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||||
|
{index + 1}
|
||||||
|
</div>
|
||||||
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ export default function ProductionListColumnPaintPriority({ record }) {
|
|||||||
title={t("production.actions.paintpriority-set")}
|
title={t("production.actions.paintpriority-set")}
|
||||||
>
|
>
|
||||||
{new Array(15).fill().map((value, index) => (
|
{new Array(15).fill().map((value, index) => (
|
||||||
<Menu.Item key={index + 1}>{index + 1}</Menu.Item>
|
<Menu.Item key={index + 1}>
|
||||||
|
<div style={{ marginLeft: "2rem", marginRight: "2rem" }}>
|
||||||
|
{index + 1}
|
||||||
|
</div>
|
||||||
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
@@ -38,13 +38,11 @@ export default function ProductionListTableContainer() {
|
|||||||
updatedJobs.jobs,
|
updatedJobs.jobs,
|
||||||
(a, b) => a.id === b.id && a.updated_at === b.updated_at
|
(a, b) => a.id === b.id && a.updated_at === b.updated_at
|
||||||
);
|
);
|
||||||
console.log(jobDiff);
|
|
||||||
if (jobDiff.length > 1) {
|
if (jobDiff.length > 1) {
|
||||||
getUpdatedJobsData(jobDiff.map((j) => j.id));
|
getUpdatedJobsData(jobDiff.map((j) => j.id));
|
||||||
} else if (jobDiff.length === 1) {
|
} else if (jobDiff.length === 1) {
|
||||||
console.log("length was 1");
|
|
||||||
jobDiff.forEach((job) => {
|
jobDiff.forEach((job) => {
|
||||||
console.log("Job ", job);
|
|
||||||
getUpdatedJobData(job.id);
|
getUpdatedJobData(job.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import "./schedule-calendar.styles.scss";
|
|||||||
import JobDetailCards from "../job-detail-cards/job-detail-cards.component";
|
import JobDetailCards from "../job-detail-cards/job-detail-cards.component";
|
||||||
import { selectProblemJobs } from "../../redux/application/application.selectors";
|
import { selectProblemJobs } from "../../redux/application/application.selectors";
|
||||||
import { Alert } from "antd";
|
import { Alert } from "antd";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -30,7 +31,7 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
}) {
|
}) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const { t } = useTranslation();
|
||||||
const handleEventPropStyles = (event, start, end, isSelected) => {
|
const handleEventPropStyles = (event, start, end, isSelected) => {
|
||||||
return {
|
return {
|
||||||
...(event.color
|
...(event.color
|
||||||
@@ -57,7 +58,10 @@ export function ScheduleCalendarWrapperComponent({
|
|||||||
<Alert
|
<Alert
|
||||||
key={problem.id}
|
key={problem.id}
|
||||||
type="error"
|
type="error"
|
||||||
message={`${problem.ro_number} has a data consistency issue. It has been exlcuded for scheduling purposes. CODE: ${problem.code}`}
|
message={t("appointments.labels.dataconsistency", {
|
||||||
|
ro_number: problem.ro_number,
|
||||||
|
code: problem.code,
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { Button, Card, Col, PageHeader, Row, Space } from "antd";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
||||||
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
||||||
//import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||||
import ScheduleProductionList from "../schedule-production-list/schedule-production-list.component";
|
import ScheduleProductionList from "../schedule-production-list/schedule-production-list.component";
|
||||||
import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verify-integrity.component";
|
import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verify-integrity.component";
|
||||||
|
|
||||||
@@ -25,9 +25,8 @@ export default function ScheduleCalendarComponent({ data, refetch }) {
|
|||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
<ScheduleProductionList />
|
<ScheduleProductionList />
|
||||||
{
|
|
||||||
// <ScheduleManualEvent />
|
<ScheduleManualEvent />
|
||||||
}
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import ScheduleCalendarComponent from "./schedule-calendar.component";
|
|||||||
import { calculateScheduleLoad } from "../../redux/application/application.actions";
|
import { calculateScheduleLoad } from "../../redux/application/application.actions";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import moment from "moment";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
});
|
});
|
||||||
@@ -26,7 +27,12 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
|
|||||||
const { loading, error, data, refetch } = useQuery(
|
const { loading, error, data, refetch } = useQuery(
|
||||||
QUERY_ALL_ACTIVE_APPOINTMENTS,
|
QUERY_ALL_ACTIVE_APPOINTMENTS,
|
||||||
{
|
{
|
||||||
variables: { start: range.start.toDate(), end: range.end.toDate() },
|
variables: {
|
||||||
|
start: range.start.toDate(),
|
||||||
|
end: range.end.toDate(),
|
||||||
|
startd: range.start,
|
||||||
|
endd: range.end,
|
||||||
|
},
|
||||||
skip: !!!range.start || !!!range.end,
|
skip: !!!range.start || !!!range.end,
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
@@ -39,15 +45,30 @@ export function ScheduleCalendarContainer({ calculateScheduleLoad }) {
|
|||||||
|
|
||||||
if (loading) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
let normalizedData = data.appointments.map((e) => {
|
let normalizedData = [
|
||||||
//Required becuase Hasura returns a string instead of a date object.
|
...data.appointments.map((e) => {
|
||||||
return Object.assign(
|
//Required becuase Hasura returns a string instead of a date object.
|
||||||
{},
|
return Object.assign(
|
||||||
e,
|
{},
|
||||||
{ start: new Date(e.start) },
|
e,
|
||||||
{ end: new Date(e.end) }
|
{ start: new Date(e.start) },
|
||||||
);
|
{ end: new Date(e.end) }
|
||||||
});
|
);
|
||||||
|
}),
|
||||||
|
...data.employee_vacation.map((e) => {
|
||||||
|
//Required becuase Hasura returns a string instead of a date object.
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
title: `${
|
||||||
|
(e.employee.first_name && e.employee.first_name.substr(0, 1)) || ""
|
||||||
|
} ${e.employee.last_name || ""} OUT`,
|
||||||
|
color: "red",
|
||||||
|
start: moment(e.start).startOf("day").toDate(),
|
||||||
|
end: moment(e.end).startOf("day").toDate(),
|
||||||
|
vacation: true,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScheduleCalendarComponent
|
<ScheduleCalendarComponent
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import { QUERY_APPOINTMENT_BY_DATE } from "../../graphql/appointments.queries";
|
|||||||
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export default function ScheduleDayViewContainer({ day }) {
|
export default function ScheduleDayViewContainer({ day }) {
|
||||||
const { loading, error, data } = useQuery(QUERY_APPOINTMENT_BY_DATE, {
|
const { loading, error, data } = useQuery(QUERY_APPOINTMENT_BY_DATE, {
|
||||||
variables: {
|
variables: {
|
||||||
start: moment(day).startOf("day"),
|
start: moment(day).startOf("day"),
|
||||||
end: moment(day).endOf("day"),
|
end: moment(day).endOf("day"),
|
||||||
|
startd: moment(day).startOf("day").format("YYYY-MM-DD"),
|
||||||
|
endd: moment(day).add(1, "day").format("YYYY-MM-DD"),
|
||||||
},
|
},
|
||||||
skip: !moment(day).isValid(),
|
skip: !moment(day).isValid(),
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
@@ -22,15 +25,30 @@ export default function ScheduleDayViewContainer({ day }) {
|
|||||||
let normalizedData;
|
let normalizedData;
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
normalizedData = data.appointments.map((e) => {
|
normalizedData = [
|
||||||
//Required becuase Hasura returns a string instead of a date object.
|
...data.appointments.map((e) => {
|
||||||
return Object.assign(
|
//Required becuase Hasura returns a string instead of a date object.
|
||||||
{},
|
return Object.assign(
|
||||||
e,
|
{},
|
||||||
{ start: new Date(e.start) },
|
e,
|
||||||
{ end: new Date(e.end) }
|
{ start: new Date(e.start) },
|
||||||
);
|
{ end: new Date(e.end) }
|
||||||
});
|
);
|
||||||
|
}),
|
||||||
|
...data.employee_vacation.map((e) => {
|
||||||
|
//Required becuase Hasura returns a string instead of a date object.
|
||||||
|
return {
|
||||||
|
...e,
|
||||||
|
title: `${
|
||||||
|
(e.employee.first_name && e.employee.first_name.substr(0, 1)) || ""
|
||||||
|
} ${e.employee.last_name || ""} OUT`,
|
||||||
|
color: "red",
|
||||||
|
start: moment(e.start).startOf("day").toDate(),
|
||||||
|
end: moment(e.end).startOf("day").toDate(),
|
||||||
|
vacation: true,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
Row,
|
Row,
|
||||||
Select,
|
Select,
|
||||||
Space, Switch,
|
Space,
|
||||||
Typography
|
Switch,
|
||||||
|
Typography,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -75,10 +76,14 @@ export function ScheduleJobModalComponent({
|
|||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Space>
|
<Space>
|
||||||
<Typography.Title level={3}>{lbrHrsData?.jobs_by_pk?.ro_number}</Typography.Title>
|
<Typography.Title level={3}>
|
||||||
<Typography.Title
|
{lbrHrsData?.jobs_by_pk?.ro_number}
|
||||||
level={4}
|
</Typography.Title>
|
||||||
>{`B/R Hrs:${lbrHrsData?.jobs_by_pk.labhrs?.aggregate.sum.mod_lb_hrs}/${lbrHrsData?.jobs_by_pk.larhrs?.aggregate.sum.mod_lb_hrs}`}</Typography.Title>
|
<Typography.Title level={4}>{`B/R Hrs:${
|
||||||
|
lbrHrsData?.jobs_by_pk.labhrs?.aggregate?.sum?.mod_lb_hrs || 0
|
||||||
|
}/${
|
||||||
|
lbrHrsData?.jobs_by_pk.larhrs?.aggregate?.sum?.mod_lb_hrs || 0
|
||||||
|
}`}</Typography.Title>
|
||||||
</Space>
|
</Space>
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -183,10 +188,9 @@ export function ScheduleJobModalComponent({
|
|||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item shouldUpdate>
|
<Form.Item shouldUpdate={(prev, cur) => prev.start !== cur.start}>
|
||||||
{() => {
|
{() => {
|
||||||
const values = form.getFieldsValue();
|
const values = form.getFieldsValue();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="schedule-job-modal">
|
<div className="schedule-job-modal">
|
||||||
<ScheduleDayViewContainer day={values.start} />
|
<ScheduleDayViewContainer day={values.start} />
|
||||||
|
|||||||
@@ -1,17 +1,32 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Card, Form, Input, Popover, Space } from "antd";
|
import { Button, Card, Form, Input, Popover, Select, Space } from "antd";
|
||||||
|
import moment from "moment";
|
||||||
import React, { 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 { createStructuredSelector } from "reselect";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
INSERT_APPOINTMENT,
|
INSERT_MANUAL_APPT,
|
||||||
UPDATE_APPOINTMENT,
|
UPDATE_APPOINTMENT,
|
||||||
} from "../../graphql/appointments.queries";
|
} from "../../graphql/appointments.queries";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
|
|
||||||
export default function ScheduleManualEvent({ event }) {
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(ScheduleManualEvent);
|
||||||
|
|
||||||
|
export function ScheduleManualEvent({ bodyshop, event }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [insertAppointment] = useMutation(INSERT_APPOINTMENT);
|
const [insertAppointment] = useMutation(INSERT_MANUAL_APPT);
|
||||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -22,26 +37,27 @@ export default function ScheduleManualEvent({ event }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (visibility && event) {
|
if (visibility && event) {
|
||||||
form.setFieldsValue({ event });
|
form.setFieldsValue(event);
|
||||||
}
|
}
|
||||||
}, [visibility, form, event]);
|
}, [visibility, form, event]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// if (entryData && entryData.scoreboard && entryData.scoreboard[0]) {
|
|
||||||
// console.log("Setting FOrm");
|
|
||||||
// // form.setFieldsValue(entryData.scoreboard[0]);
|
|
||||||
// }
|
|
||||||
}, [form]);
|
|
||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
logImEXEvent("job_close_add_to_scoreboard");
|
logImEXEvent("schedule_manual_event");
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
if (event && event.id) {
|
if (event && event.id) {
|
||||||
updateAppointment();
|
updateAppointment({
|
||||||
|
variables: { appid: event.id, app: values },
|
||||||
|
refetchQueries: ["QUERY_ALL_ACTIVE_APPOINTMENTS"],
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
insertAppointment();
|
insertAppointment({
|
||||||
|
variables: {
|
||||||
|
apt: { ...values, isintake: false, bodyshopid: bodyshop.id },
|
||||||
|
},
|
||||||
|
refetchQueries: ["QUERY_ALL_ACTIVE_APPOINTMENTS"],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@@ -56,8 +72,8 @@ export default function ScheduleManualEvent({ event }) {
|
|||||||
<div>
|
<div>
|
||||||
<Form form={form} layout="vertical" onFinish={handleFinish}>
|
<Form form={form} layout="vertical" onFinish={handleFinish}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("schedule.fields.note")}
|
label={t("appointments.fields.title")}
|
||||||
name="note"
|
name="title"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -67,8 +83,11 @@ export default function ScheduleManualEvent({ event }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("appointments.fields.note")} name="note">
|
||||||
|
<Input />
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("schedule.fields.start")}
|
label={t("appointments.fields.start")}
|
||||||
name="start"
|
name="start"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
@@ -80,17 +99,42 @@ export default function ScheduleManualEvent({ event }) {
|
|||||||
<FormDateTimePickerComponent />
|
<FormDateTimePickerComponent />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("schedule.fields.end")}
|
label={t("appointments.fields.end")}
|
||||||
name="end"
|
name="end"
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
},
|
||||||
|
({ getFieldValue }) => ({
|
||||||
|
async validator(rule, value) {
|
||||||
|
if (value) {
|
||||||
|
const { start } = form.getFieldsValue();
|
||||||
|
if (moment(start).isAfter(moment(value))) {
|
||||||
|
return Promise.reject(
|
||||||
|
t("employees.labels.endmustbeafterstart")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}),
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<FormDateTimePickerComponent />
|
<FormDateTimePickerComponent />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item label={t("appointments.fields.color")} name="color">
|
||||||
|
<Select>
|
||||||
|
{bodyshop.appt_colors.map((col, idx) => (
|
||||||
|
<Select.Option key={idx} value={col.color.hex}>
|
||||||
|
{col.label}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Button type="primary" htmlType="submit">
|
<Button type="primary" htmlType="submit">
|
||||||
@@ -112,7 +156,9 @@ export default function ScheduleManualEvent({ event }) {
|
|||||||
return (
|
return (
|
||||||
<Popover content={overlay} visible={visibility}>
|
<Popover content={overlay} visible={visibility}>
|
||||||
<Button loading={loading} onClick={handleClick}>
|
<Button loading={loading} onClick={handleClick}>
|
||||||
{t("schedule.labels.manualevent")}
|
{event
|
||||||
|
? t("appointments.actions.reschedule")
|
||||||
|
: t("appointments.labels.manualevent")}
|
||||||
</Button>
|
</Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Card, Form, notification, Popover, Space } from "antd";
|
||||||
|
import moment from "moment";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import { INSERT_VACATION } from "../../graphql/employees.queries";
|
||||||
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
|
|
||||||
|
export default function ShopEmployeeAddVacation({ employee }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [insertVacation] = useMutation(INSERT_VACATION);
|
||||||
|
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const [visibility, setVisibility] = useState(false);
|
||||||
|
|
||||||
|
const handleFinish = async (values) => {
|
||||||
|
logImEXEvent("employee_add_vacation");
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
let result;
|
||||||
|
|
||||||
|
result = await insertVacation({
|
||||||
|
variables: { vacation: { ...values, employeeid: employee.id } },
|
||||||
|
update(cache, { data }) {
|
||||||
|
cache.modify({
|
||||||
|
id: cache.identify({ id: employee.id, __typename: "employees" }),
|
||||||
|
fields: {
|
||||||
|
employee_vacations(ex) {
|
||||||
|
return [data.insert_employee_vacation_one, ...ex];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!result.errors) {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("employees.errors.adding", {
|
||||||
|
message: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
notification["success"]({
|
||||||
|
message: t("employees.successes.added"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
setVisibility(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const overlay = (
|
||||||
|
<Card>
|
||||||
|
<Form form={form} layout="vertical" onFinish={handleFinish}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("employees.fields.vacation.start")}
|
||||||
|
name="start"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<FormDatePicker />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("employees.fields.vacation.end")}
|
||||||
|
name="end"
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
({ getFieldValue }) => ({
|
||||||
|
async validator(rule, value) {
|
||||||
|
if (value) {
|
||||||
|
const { start } = form.getFieldsValue();
|
||||||
|
if (moment(start).isAfter(moment(value))) {
|
||||||
|
return Promise.reject(
|
||||||
|
t("employees.labels.endmustbeafterstart")
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Promise.resolve();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<FormDatePicker />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Space wrap>
|
||||||
|
<Button type="primary" htmlType="submit">
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={() => setVisibility(false)}>
|
||||||
|
{t("general.actions.cancel")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</Form>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleClick = (e) => {
|
||||||
|
setVisibility(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Popover content={overlay} visible={visibility}>
|
||||||
|
<Button
|
||||||
|
loading={loading}
|
||||||
|
disabled={!employee?.active}
|
||||||
|
onClick={handleClick}
|
||||||
|
>
|
||||||
|
{t("employees.actions.addvacation")}
|
||||||
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,20 +1,41 @@
|
|||||||
import { DeleteFilled } from "@ant-design/icons";
|
import { DeleteFilled } from "@ant-design/icons";
|
||||||
import { Button, Card, Form, Input, InputNumber, Select, Switch } from "antd";
|
import { useApolloClient, useMutation, useQuery } from "@apollo/client";
|
||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Card,
|
||||||
|
Form,
|
||||||
|
Input,
|
||||||
|
InputNumber,
|
||||||
|
notification,
|
||||||
|
Select,
|
||||||
|
Switch,
|
||||||
|
Table,
|
||||||
|
} from "antd";
|
||||||
|
import { useForm } from "antd/es/form/Form";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import querystring from "query-string";
|
||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { useApolloClient } from "@apollo/client";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
CHECK_EMPLOYEE_NUMBER,
|
CHECK_EMPLOYEE_NUMBER,
|
||||||
|
DELETE_VACATION,
|
||||||
|
INSERT_EMPLOYEES,
|
||||||
|
QUERY_EMPLOYEE_BY_ID,
|
||||||
QUERY_USERS_BY_EMAIL,
|
QUERY_USERS_BY_EMAIL,
|
||||||
|
UPDATE_EMPLOYEE,
|
||||||
} from "../../graphql/employees.queries";
|
} from "../../graphql/employees.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import CiecaSelect from "../../utils/Ciecaselect";
|
||||||
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
import CiecaSelect from "../../utils/Ciecaselect";
|
import ShopEmployeeAddVacation from "./shop-employees-add-vacation.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -23,20 +44,129 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
|
|
||||||
export function ShopEmployeesFormComponent({
|
export function ShopEmployeesFormComponent({ bodyshop }) {
|
||||||
bodyshop,
|
|
||||||
form,
|
|
||||||
selectedEmployee,
|
|
||||||
handleFinish,
|
|
||||||
}) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const [form] = useForm();
|
||||||
|
const history = useHistory();
|
||||||
|
const search = querystring.parse(useLocation().search);
|
||||||
|
const [deleteVacation] = useMutation(DELETE_VACATION);
|
||||||
|
const { error, data } = useQuery(QUERY_EMPLOYEE_BY_ID, {
|
||||||
|
variables: { id: search.employeeId },
|
||||||
|
skip: !search.employeeId || search.employeeId === "new",
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
nextFetchPolicy: "network-only",
|
||||||
|
});
|
||||||
|
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selectedEmployee) form.resetFields();
|
if (data && data.employees_by_pk) form.setFieldsValue(data.employees_by_pk);
|
||||||
}, [selectedEmployee, form]);
|
else {
|
||||||
|
form.resetFields();
|
||||||
|
}
|
||||||
|
}, [form, data, search.employeeId]);
|
||||||
|
|
||||||
if (!selectedEmployee) return null;
|
const [updateEmployee] = useMutation(UPDATE_EMPLOYEE);
|
||||||
|
const [insertEmployees] = useMutation(INSERT_EMPLOYEES);
|
||||||
|
|
||||||
|
const handleFinish = (values) => {
|
||||||
|
if (search.employeeId && search.employeeId !== "new") {
|
||||||
|
//Update a record.
|
||||||
|
logImEXEvent("shop_employee_update");
|
||||||
|
|
||||||
|
updateEmployee({
|
||||||
|
variables: {
|
||||||
|
id: search.employeeId,
|
||||||
|
employee: {
|
||||||
|
...values,
|
||||||
|
user_email: values.user_email === "" ? null : values.user_email,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((r) => {
|
||||||
|
notification["success"]({
|
||||||
|
message: t("employees.successes.save"),
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("employees.errors.save", {
|
||||||
|
message: JSON.stringify(error),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//New record, insert it.
|
||||||
|
logImEXEvent("shop_employee_insert");
|
||||||
|
|
||||||
|
insertEmployees({
|
||||||
|
variables: { employees: [{ ...values, shopid: bodyshop.id }] },
|
||||||
|
refetchQueries: ["QUERY_EMPLOYEES"],
|
||||||
|
}).then((r) => {
|
||||||
|
search.employeeId = r.data.insert_employees.returning[0].id;
|
||||||
|
history.push({ search: querystring.stringify(search) });
|
||||||
|
notification["success"]({
|
||||||
|
message: t("employees.successes.save"),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!search.employeeId) return null;
|
||||||
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("employees.fields.vacation.start"),
|
||||||
|
dataIndex: "start",
|
||||||
|
key: "start",
|
||||||
|
render: (text, record) => <DateFormatter>{text}</DateFormatter>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("employees.fields.vacation.end"),
|
||||||
|
dataIndex: "end",
|
||||||
|
key: "end",
|
||||||
|
render: (text, record) => <DateFormatter>{text}</DateFormatter>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("employees.fields.vacation.length"),
|
||||||
|
dataIndex: "length",
|
||||||
|
key: "length",
|
||||||
|
render: (text, record) =>
|
||||||
|
moment(record.end).diff(moment(record.start), "days", true).toFixed(1),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("general.labels.actions"),
|
||||||
|
dataIndex: "actions",
|
||||||
|
key: "actions",
|
||||||
|
render: (text, record) => (
|
||||||
|
<Button
|
||||||
|
onClick={async () => {
|
||||||
|
await deleteVacation({
|
||||||
|
variables: { id: record.id },
|
||||||
|
update(cache) {
|
||||||
|
cache.modify({
|
||||||
|
id: cache.identify({
|
||||||
|
id: data.employees_by_pk.id,
|
||||||
|
__typename: "employees",
|
||||||
|
}),
|
||||||
|
|
||||||
|
fields: {
|
||||||
|
employee_vacations(ex, { readField }) {
|
||||||
|
return ex.filter(
|
||||||
|
(vacaref) => record.id !== readField("id", vacaref)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DeleteFilled />
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
@@ -51,15 +181,6 @@ export function ShopEmployeesFormComponent({
|
|||||||
autoComplete={"off"}
|
autoComplete={"off"}
|
||||||
layout="vertical"
|
layout="vertical"
|
||||||
form={form}
|
form={form}
|
||||||
initialValues={{
|
|
||||||
...selectedEmployee,
|
|
||||||
hire_date: selectedEmployee.hire_date
|
|
||||||
? moment(selectedEmployee.hire_date)
|
|
||||||
: null,
|
|
||||||
termination_date: selectedEmployee.termination_date
|
|
||||||
? moment(selectedEmployee.termination_date)
|
|
||||||
: null,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -288,6 +409,15 @@ export function ShopEmployeesFormComponent({
|
|||||||
}}
|
}}
|
||||||
</Form.List>
|
</Form.List>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
|
<Table
|
||||||
|
title={() => (
|
||||||
|
<ShopEmployeeAddVacation employee={data && data.employees_by_pk} />
|
||||||
|
)}
|
||||||
|
columns={columns}
|
||||||
|
rowKey={"id"}
|
||||||
|
dataSource={data ? data.employees_by_pk.employee_vacations : []}
|
||||||
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
import { Button, Table } from "antd";
|
import { Button, Table } from "antd";
|
||||||
|
import queryString from "query-string";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
export default function ShopEmployeesListComponent({
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
loading,
|
|
||||||
employees,
|
export default function ShopEmployeesListComponent({ loading, employees }) {
|
||||||
selectedEmployee,
|
|
||||||
setSelectedEmployee,
|
|
||||||
handleDelete,
|
|
||||||
}) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const history = useHistory();
|
||||||
|
const search = queryString.parse(useLocation().search);
|
||||||
|
|
||||||
const handleOnRowClick = (record) => {
|
const handleOnRowClick = (record) => {
|
||||||
if (record) {
|
if (record) {
|
||||||
setSelectedEmployee(record);
|
search.employeeId = record.id;
|
||||||
} else setSelectedEmployee({});
|
history.push({ search: queryString.stringify(search) });
|
||||||
|
} else {
|
||||||
|
delete search.employeeId;
|
||||||
|
history.push({ search: queryString.stringify(search) });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
@@ -41,18 +44,6 @@ export default function ShopEmployeesListComponent({
|
|||||||
? t("employees.labels.flat_rate")
|
? t("employees.labels.flat_rate")
|
||||||
: t("employees.labels.straight_time"),
|
: t("employees.labels.straight_time"),
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: t("employees.labels.actions"),
|
|
||||||
// dataIndex: "actions",
|
|
||||||
// key: "actions",
|
|
||||||
// render: (text, record) => (
|
|
||||||
// <div>
|
|
||||||
// <Button key="delete" onClick={() => handleDelete(record.id)}>
|
|
||||||
// {t("general.actions.delete")}
|
|
||||||
// </Button>
|
|
||||||
// </div>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -62,7 +53,8 @@ export default function ShopEmployeesListComponent({
|
|||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSelectedEmployee({});
|
search.employeeId = "new";
|
||||||
|
history.push({ search: queryString.stringify(search) });
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("employees.actions.new")}
|
{t("employees.actions.new")}
|
||||||
@@ -76,10 +68,11 @@ export default function ShopEmployeesListComponent({
|
|||||||
dataSource={employees}
|
dataSource={employees}
|
||||||
rowSelection={{
|
rowSelection={{
|
||||||
onSelect: (props) => {
|
onSelect: (props) => {
|
||||||
setSelectedEmployee(props);
|
search.employeeId = props.id;
|
||||||
|
history.push({ search: queryString.stringify(search) });
|
||||||
},
|
},
|
||||||
type: "radio",
|
type: "radio",
|
||||||
selectedRowKeys: [(selectedEmployee && selectedEmployee.id) || null],
|
selectedRowKeys: [search.employeeId],
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
onRow={(record, rowIndex) => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
import ShopEmployeesFormComponent from "./shop-employees-form.component";
|
|
||||||
import ShopEmployeesListComponent from "./shop-employees-list.component";
|
|
||||||
export default function ShopEmployeeComponent({
|
|
||||||
form,
|
|
||||||
loading,
|
|
||||||
employees,
|
|
||||||
employeeState,
|
|
||||||
handleFinish,
|
|
||||||
handleDelete
|
|
||||||
}) {
|
|
||||||
const [selectedEmployee, setSelectedEmployee] = employeeState;
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<ShopEmployeesListComponent
|
|
||||||
employees={employees}
|
|
||||||
loading={loading}
|
|
||||||
selectedEmployee={selectedEmployee}
|
|
||||||
setSelectedEmployee={setSelectedEmployee}
|
|
||||||
handleDelete={handleDelete}
|
|
||||||
/>
|
|
||||||
<ShopEmployeesFormComponent
|
|
||||||
handleFinish={handleFinish}
|
|
||||||
form={form}
|
|
||||||
selectedEmployee={selectedEmployee}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,120 +1,32 @@
|
|||||||
import { useMutation, useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Form, notification } from "antd";
|
import React from "react";
|
||||||
import React, { useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { QUERY_EMPLOYEES } from "../../graphql/employees.queries";
|
||||||
import {
|
|
||||||
DELETE_EMPLOYEE,
|
|
||||||
INSERT_EMPLOYEES,
|
|
||||||
QUERY_EMPLOYEES,
|
|
||||||
UPDATE_EMPLOYEE,
|
|
||||||
} from "../../graphql/employees.queries";
|
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ShopEmployeeComponent from "./shop-employees.component";
|
import ShopEmployeesFormComponent from "./shop-employees-form.component";
|
||||||
|
import ShopEmployeesListComponent from "./shop-employees-list.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
function ShopEmployeesContainer({ bodyshop }) {
|
function ShopEmployeesContainer({ bodyshop }) {
|
||||||
const [form] = Form.useForm();
|
const { loading, error, data } = useQuery(QUERY_EMPLOYEES, {
|
||||||
const { t } = useTranslation();
|
|
||||||
const employeeState = useState(null);
|
|
||||||
const { loading, error, data, refetch } = useQuery(QUERY_EMPLOYEES, {
|
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
|
|
||||||
const [updateEmployee] = useMutation(UPDATE_EMPLOYEE);
|
|
||||||
const [insertEmployees] = useMutation(INSERT_EMPLOYEES);
|
|
||||||
const [deleteEmployee] = useMutation(DELETE_EMPLOYEE);
|
|
||||||
|
|
||||||
const handleDelete = (id) => {
|
|
||||||
logImEXEvent("shop_employee_delete");
|
|
||||||
|
|
||||||
deleteEmployee({ variables: { id: id } })
|
|
||||||
.then((r) => {
|
|
||||||
notification["success"]({
|
|
||||||
message: t("employees.successes.delete"),
|
|
||||||
});
|
|
||||||
|
|
||||||
employeeState[1](null);
|
|
||||||
refetch().then((r) => form.resetFields());
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
notification["error"]({
|
|
||||||
message: t("employees.errors.delete", {
|
|
||||||
message: JSON.stringify(error),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleFinish = (values) => {
|
|
||||||
if (employeeState[0].id) {
|
|
||||||
//Update a record.
|
|
||||||
logImEXEvent("shop_employee_update");
|
|
||||||
|
|
||||||
updateEmployee({
|
|
||||||
variables: {
|
|
||||||
id: employeeState[0].id,
|
|
||||||
employee: {
|
|
||||||
...values,
|
|
||||||
user_email: values.user_email === "" ? null : values.user_email,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.then((r) => {
|
|
||||||
notification["success"]({
|
|
||||||
message: t("employees.successes.save"),
|
|
||||||
});
|
|
||||||
|
|
||||||
employeeState[1](null);
|
|
||||||
refetch().then((r) => form.resetFields());
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
notification["error"]({
|
|
||||||
message: t("employees.errors.save", {
|
|
||||||
message: JSON.stringify(error),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
//New record, insert it.
|
|
||||||
logImEXEvent("shop_employee_insert");
|
|
||||||
|
|
||||||
insertEmployees({
|
|
||||||
variables: { employees: [{ ...values, shopid: bodyshop.id }] },
|
|
||||||
}).then((r) => {
|
|
||||||
notification["success"]({
|
|
||||||
message: t("employees.successes.save"),
|
|
||||||
});
|
|
||||||
employeeState[1](null);
|
|
||||||
refetch().catch((error) => {
|
|
||||||
notification["error"]({
|
|
||||||
message: t("employees.errors.save", {
|
|
||||||
message: JSON.stringify(error),
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ShopEmployeeComponent
|
<div>
|
||||||
handleFinish={handleFinish}
|
<ShopEmployeesListComponent
|
||||||
handleDelete={handleDelete}
|
employees={data ? data.employees : []}
|
||||||
form={form}
|
loading={loading}
|
||||||
loading={loading}
|
/>
|
||||||
employeeState={employeeState}
|
<ShopEmployeesFormComponent />
|
||||||
employees={data ? data.employees : []}
|
</div>
|
||||||
/>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
export default connect(mapStateToProps, null)(ShopEmployeesContainer);
|
export default connect(mapStateToProps, null)(ShopEmployeesContainer);
|
||||||
|
|||||||
@@ -4,7 +4,21 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
|
|||||||
query QUERY_ALL_ACTIVE_APPOINTMENTS(
|
query QUERY_ALL_ACTIVE_APPOINTMENTS(
|
||||||
$start: timestamptz!
|
$start: timestamptz!
|
||||||
$end: timestamptz!
|
$end: timestamptz!
|
||||||
|
$startd: date!
|
||||||
|
$endd: date!
|
||||||
) {
|
) {
|
||||||
|
employee_vacation(
|
||||||
|
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
|
||||||
|
) {
|
||||||
|
id
|
||||||
|
start
|
||||||
|
end
|
||||||
|
employee {
|
||||||
|
id
|
||||||
|
last_name
|
||||||
|
first_name
|
||||||
|
}
|
||||||
|
}
|
||||||
appointments(
|
appointments(
|
||||||
where: {
|
where: {
|
||||||
canceled: { _eq: false }
|
canceled: { _eq: false }
|
||||||
@@ -77,6 +91,26 @@ export const INSERT_APPOINTMENT_BLOCK = gql`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const INSERT_MANUAL_APPT = gql`
|
||||||
|
mutation INSERT_MANUAL_APPT($apt: appointments_insert_input!) {
|
||||||
|
insert_appointments_one(object: $apt) {
|
||||||
|
start
|
||||||
|
id
|
||||||
|
end
|
||||||
|
arrived
|
||||||
|
title
|
||||||
|
isintake
|
||||||
|
block
|
||||||
|
color
|
||||||
|
note
|
||||||
|
canceled
|
||||||
|
job {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
export const INSERT_APPOINTMENT = gql`
|
export const INSERT_APPOINTMENT = gql`
|
||||||
mutation INSERT_APPOINTMENT(
|
mutation INSERT_APPOINTMENT(
|
||||||
$app: [appointments_insert_input!]!
|
$app: [appointments_insert_input!]!
|
||||||
@@ -109,7 +143,24 @@ export const INSERT_APPOINTMENT = gql`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const QUERY_APPOINTMENT_BY_DATE = gql`
|
export const QUERY_APPOINTMENT_BY_DATE = gql`
|
||||||
query QUERY_APPOINTMENT_BY_DATE($start: timestamptz, $end: timestamptz) {
|
query QUERY_APPOINTMENT_BY_DATE(
|
||||||
|
$start: timestamptz
|
||||||
|
$end: timestamptz
|
||||||
|
$startd: date!
|
||||||
|
$endd: date!
|
||||||
|
) {
|
||||||
|
employee_vacation(
|
||||||
|
where: { _or: [{ start: { _gte: $startd } }, { end: { _lte: $endd } }] }
|
||||||
|
) {
|
||||||
|
id
|
||||||
|
start
|
||||||
|
end
|
||||||
|
employee {
|
||||||
|
id
|
||||||
|
last_name
|
||||||
|
first_name
|
||||||
|
}
|
||||||
|
}
|
||||||
appointments(
|
appointments(
|
||||||
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
|
where: { start: { _lte: $end, _gte: $start }, canceled: { _eq: false } }
|
||||||
) {
|
) {
|
||||||
@@ -212,7 +263,9 @@ export const QUERY_APPOINTMENTS_BY_JOBID = gql`
|
|||||||
`;
|
`;
|
||||||
export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
||||||
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
|
query QUERY_SCHEDULE_LOAD_DATA($start: timestamptz!, $end: timestamptz!) {
|
||||||
prodJobs: jobs(where: { inproduction: { _eq: true } }) {
|
prodJobs: jobs(
|
||||||
|
where: { inproduction: { _eq: true }, suspended: { _eq: false } }
|
||||||
|
) {
|
||||||
id
|
id
|
||||||
labhrs: joblines_aggregate(
|
labhrs: joblines_aggregate(
|
||||||
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }
|
||||||
@@ -235,9 +288,14 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
|||||||
}
|
}
|
||||||
compJobs: jobs(
|
compJobs: jobs(
|
||||||
where: {
|
where: {
|
||||||
_or: [
|
_and: [
|
||||||
{ scheduled_completion: { _gte: $start, _lte: $end } }
|
{ suspended: { _eq: false } }
|
||||||
{ actual_completion: { _gte: $start, _lte: $end } }
|
{
|
||||||
|
_or: [
|
||||||
|
{ scheduled_completion: { _gte: $start, _lte: $end } }
|
||||||
|
{ actual_completion: { _gte: $start, _lte: $end } }
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
@@ -264,7 +322,12 @@ export const QUERY_SCHEDULE_LOAD_DATA = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
arrJobs: jobs(where: { scheduled_in: { _gte: $start, _lte: $end } }) {
|
arrJobs: jobs(
|
||||||
|
where: {
|
||||||
|
scheduled_in: { _gte: $start, _lte: $end }
|
||||||
|
suspended: { _eq: false }
|
||||||
|
}
|
||||||
|
) {
|
||||||
id
|
id
|
||||||
scheduled_in
|
scheduled_in
|
||||||
ro_number
|
ro_number
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { gql } from "@apollo/client";
|
|||||||
|
|
||||||
export const QUERY_ALL_ASSOCIATIONS = gql`
|
export const QUERY_ALL_ASSOCIATIONS = gql`
|
||||||
query QUERY_ALL_ASSOCIATIONS {
|
query QUERY_ALL_ASSOCIATIONS {
|
||||||
associations {
|
associations(order_by: { bodyshop: { shopname: asc } }) {
|
||||||
id
|
id
|
||||||
active
|
active
|
||||||
bodyshop {
|
bodyshop {
|
||||||
|
|||||||
@@ -3,6 +3,17 @@ import { gql } from "@apollo/client";
|
|||||||
export const QUERY_EMPLOYEES = gql`
|
export const QUERY_EMPLOYEES = gql`
|
||||||
query QUERY_EMPLOYEES {
|
query QUERY_EMPLOYEES {
|
||||||
employees(order_by: { employee_number: asc }) {
|
employees(order_by: { employee_number: asc }) {
|
||||||
|
last_name
|
||||||
|
id
|
||||||
|
first_name
|
||||||
|
flat_rate
|
||||||
|
employee_number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
export const QUERY_EMPLOYEE_BY_ID = gql`
|
||||||
|
query QUERY_EMPLOYEE_BY_ID($id: uuid!) {
|
||||||
|
employees_by_pk(id: $id) {
|
||||||
last_name
|
last_name
|
||||||
id
|
id
|
||||||
first_name
|
first_name
|
||||||
@@ -14,6 +25,11 @@ export const QUERY_EMPLOYEES = gql`
|
|||||||
rates
|
rates
|
||||||
pin
|
pin
|
||||||
user_email
|
user_email
|
||||||
|
employee_vacations(order_by: { start: desc }) {
|
||||||
|
id
|
||||||
|
start
|
||||||
|
end
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -55,7 +71,17 @@ export const INSERT_EMPLOYEES = gql`
|
|||||||
mutation INSERT_EMPLOYEES($employees: [employees_insert_input!]!) {
|
mutation INSERT_EMPLOYEES($employees: [employees_insert_input!]!) {
|
||||||
insert_employees(objects: $employees) {
|
insert_employees(objects: $employees) {
|
||||||
returning {
|
returning {
|
||||||
|
last_name
|
||||||
id
|
id
|
||||||
|
first_name
|
||||||
|
employee_number
|
||||||
|
active
|
||||||
|
termination_date
|
||||||
|
hire_date
|
||||||
|
flat_rate
|
||||||
|
rates
|
||||||
|
pin
|
||||||
|
user_email
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,3 +124,21 @@ export const QUERY_USERS_BY_EMAIL = gql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
export const INSERT_VACATION = gql`
|
||||||
|
mutation INSERT_VACATION($vacation: employee_vacation_insert_input!) {
|
||||||
|
insert_employee_vacation_one(object: $vacation) {
|
||||||
|
id
|
||||||
|
start
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
export const DELETE_VACATION = gql`
|
||||||
|
mutation DELETE_VACATION($id: uuid!) {
|
||||||
|
delete_employee_vacation_by_pk(id: $id) {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export const QUERY_ALL_ACTIVE_JOBS = gql`
|
|||||||
status
|
status
|
||||||
updated_at
|
updated_at
|
||||||
ded_amt
|
ded_amt
|
||||||
|
suspended
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -290,6 +291,7 @@ export const QUERY_JOBS_IN_PRODUCTION = gql`
|
|||||||
employee_refinish
|
employee_refinish
|
||||||
employee_prep
|
employee_prep
|
||||||
employee_csr
|
employee_csr
|
||||||
|
suspended
|
||||||
labhrs: joblines_aggregate(
|
labhrs: joblines_aggregate(
|
||||||
where: {
|
where: {
|
||||||
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
|
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
|
||||||
@@ -483,7 +485,7 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
}
|
}
|
||||||
alt_transport
|
alt_transport
|
||||||
intakechecklist
|
intakechecklist
|
||||||
|
invoice_final_note
|
||||||
loss_desc
|
loss_desc
|
||||||
kmin
|
kmin
|
||||||
kmout
|
kmout
|
||||||
@@ -654,6 +656,7 @@ export const GET_JOB_BY_PK = gql`
|
|||||||
voided
|
voided
|
||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
|
suspended
|
||||||
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
|
joblines(where: { removed: { _eq: false } }, order_by: { line_no: asc }) {
|
||||||
id
|
id
|
||||||
alt_partm
|
alt_partm
|
||||||
@@ -828,6 +831,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
|
|||||||
ca_gst_registrant
|
ca_gst_registrant
|
||||||
owner_owing
|
owner_owing
|
||||||
special_coverage_policy
|
special_coverage_policy
|
||||||
|
suspended
|
||||||
available_jobs {
|
available_jobs {
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
@@ -1034,6 +1038,7 @@ export const UPDATE_JOB = gql`
|
|||||||
ro_number
|
ro_number
|
||||||
production_vars
|
production_vars
|
||||||
lbr_adjustments
|
lbr_adjustments
|
||||||
|
suspended
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1816,6 +1821,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
|
|||||||
jobs_by_pk(id: $id) {
|
jobs_by_pk(id: $id) {
|
||||||
ro_number
|
ro_number
|
||||||
invoice_allocation
|
invoice_allocation
|
||||||
|
invoice_final_note
|
||||||
ins_co_id
|
ins_co_id
|
||||||
dms_allocation
|
dms_allocation
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -76,17 +76,35 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
|
|
||||||
let problemJobs = [];
|
let problemJobs = [];
|
||||||
compJobs.forEach((item) => {
|
compJobs.forEach((item) => {
|
||||||
if (!item.scheduled_completion)
|
if (!(item.actual_completion || item.scheduled_completion))
|
||||||
console.log("JOB HAS NO SCHEDULED COMPLETION DATE.", item);
|
console.log("JOB HAS NO COMPLETION DATE.", item);
|
||||||
|
|
||||||
const inProdJobs = prodJobs.find((p) => p.id === item.id);
|
const inProdJobs = prodJobs.find((p) => p.id === item.id);
|
||||||
const inArrJobs = arrJobs.find((p) => p.id === item.id);
|
const inArrJobs = arrJobs.find((p) => p.id === item.id);
|
||||||
|
|
||||||
if (
|
if (!(inProdJobs || inArrJobs)) {
|
||||||
!(inProdJobs || inArrJobs) &&
|
//Job isn't found in production or coming in.
|
||||||
!moment(item.scheduled_completion).isSame(moment(), "day")
|
//is it going today or scheduled to go today?
|
||||||
) {
|
if (
|
||||||
// NOT FOUND!
|
moment(item.actual_completion || item.scheduled_completion).isSame(
|
||||||
|
moment(),
|
||||||
|
"day"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
console.log("Job is going today anyways, ignore it.", item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
moment(item.actual_completion || item.scheduled_completion).isBefore(
|
||||||
|
moment(),
|
||||||
|
"day"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
console.log("Job should have already gone. Ignoring it.", item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
problemJobs.push({
|
problemJobs.push({
|
||||||
...item,
|
...item,
|
||||||
code: "Job is scheduled for completion, but it is not marked in production nor is it an arriving job in this period. Check the scheduled in and completion dates",
|
code: "Job is scheduled for completion, but it is not marked in production nor is it an arriving job in this period. Check the scheduled in and completion dates",
|
||||||
@@ -94,7 +112,9 @@ export function* calculateScheduleLoad({ payload: end }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const itemDate = moment(item.scheduled_completion).format("yyyy-MM-DD");
|
const itemDate = moment(
|
||||||
|
item.actual_completion || item.scheduled_completion
|
||||||
|
).format("yyyy-MM-DD");
|
||||||
if (!!load[itemDate]) {
|
if (!!load[itemDate]) {
|
||||||
load[itemDate].hoursOut =
|
load[itemDate].hoursOut =
|
||||||
(load[itemDate].hoursOut || 0) +
|
(load[itemDate].hoursOut || 0) +
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"alt_transport": "Alt. Trans.",
|
"alt_transport": "Alt. Trans.",
|
||||||
"color": "Appointment Color",
|
"color": "Appointment Color",
|
||||||
"note": "Appt. Note",
|
"end": "End",
|
||||||
|
"note": "Note",
|
||||||
|
"start": "Start",
|
||||||
"time": "Appointment Time",
|
"time": "Appointment Time",
|
||||||
"title": "Title"
|
"title": "Title"
|
||||||
},
|
},
|
||||||
@@ -47,8 +49,10 @@
|
|||||||
"blocked": "Blocked",
|
"blocked": "Blocked",
|
||||||
"cancelledappointment": "Canceled appointment for: ",
|
"cancelledappointment": "Canceled appointment for: ",
|
||||||
"completingjobs": "Completing Jobs",
|
"completingjobs": "Completing Jobs",
|
||||||
|
"dataconsistency": "{{ro_number}} has a data consistency issue. It has been excluded for scheduling purposes. CODE: {{code}}.",
|
||||||
"history": "History",
|
"history": "History",
|
||||||
"inproduction": "Jobs In Production",
|
"inproduction": "Jobs In Production",
|
||||||
|
"manualevent": "Add Manual Appointment",
|
||||||
"noarrivingjobs": "No jobs are arriving.",
|
"noarrivingjobs": "No jobs are arriving.",
|
||||||
"nocompletingjobs": "No jobs scheduled for completion.",
|
"nocompletingjobs": "No jobs scheduled for completion.",
|
||||||
"nodateselected": "No date has been selected.",
|
"nodateselected": "No date has been selected.",
|
||||||
@@ -833,6 +837,7 @@
|
|||||||
},
|
},
|
||||||
"employees": {
|
"employees": {
|
||||||
"actions": {
|
"actions": {
|
||||||
|
"addvacation": "Add Vacation",
|
||||||
"new": "New Employee",
|
"new": "New Employee",
|
||||||
"newrate": "New Rate"
|
"newrate": "New Rate"
|
||||||
},
|
},
|
||||||
@@ -854,10 +859,16 @@
|
|||||||
"pin": "Tech Console PIN",
|
"pin": "Tech Console PIN",
|
||||||
"rate": "Rate",
|
"rate": "Rate",
|
||||||
"termination_date": "Termination Date",
|
"termination_date": "Termination Date",
|
||||||
"user_email": "User Email"
|
"user_email": "User Email",
|
||||||
|
"vacation": {
|
||||||
|
"end": "Vacation End",
|
||||||
|
"length": "Vacation Length",
|
||||||
|
"start": "Vacation Start"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": "Actions",
|
"actions": "Actions",
|
||||||
|
"endmustbeafterstart": "End date must be after start date.",
|
||||||
"flat_rate": "Flat Rate",
|
"flat_rate": "Flat Rate",
|
||||||
"name": "Name",
|
"name": "Name",
|
||||||
"rate_type": "Rate Type",
|
"rate_type": "Rate Type",
|
||||||
@@ -1298,6 +1309,7 @@
|
|||||||
"required": "Required?",
|
"required": "Required?",
|
||||||
"type": "Type"
|
"type": "Type"
|
||||||
},
|
},
|
||||||
|
"invoice_final_note": "Note to Display on Final Invoice",
|
||||||
"kmin": "Mileage In",
|
"kmin": "Mileage In",
|
||||||
"kmout": "Mileage Out",
|
"kmout": "Mileage Out",
|
||||||
"la1": "LA1",
|
"la1": "LA1",
|
||||||
@@ -1577,6 +1589,7 @@
|
|||||||
"subletstotal": "Sublets Total",
|
"subletstotal": "Sublets Total",
|
||||||
"subtotal": "Subtotal",
|
"subtotal": "Subtotal",
|
||||||
"supplementnote": "The job had a supplement imported.",
|
"supplementnote": "The job had a supplement imported.",
|
||||||
|
"suspended": "SUSPENDED",
|
||||||
"suspense": "Suspense",
|
"suspense": "Suspense",
|
||||||
"total_cost": "Total Cost",
|
"total_cost": "Total Cost",
|
||||||
"total_cust_payable": "Total Customer Amount Payable",
|
"total_cust_payable": "Total Customer Amount Payable",
|
||||||
@@ -2028,6 +2041,7 @@
|
|||||||
"filing_coversheet_portrait": "Filing Coversheet (Portrait)",
|
"filing_coversheet_portrait": "Filing Coversheet (Portrait)",
|
||||||
"final_invoice": "Final Invoice",
|
"final_invoice": "Final Invoice",
|
||||||
"fippa_authorization": "FIPPA Authorization",
|
"fippa_authorization": "FIPPA Authorization",
|
||||||
|
"folder_label_multiple": "Folder Label Multiple",
|
||||||
"glass_express_checklist": "Glass Express Checklist",
|
"glass_express_checklist": "Glass Express Checklist",
|
||||||
"guarantee": "Repair Guarantee",
|
"guarantee": "Repair Guarantee",
|
||||||
"individual_job_note": "Job Note RO # {{ro_number}}",
|
"individual_job_note": "Job Note RO # {{ro_number}}",
|
||||||
@@ -2097,7 +2111,7 @@
|
|||||||
},
|
},
|
||||||
"subjects": {
|
"subjects": {
|
||||||
"jobs": {
|
"jobs": {
|
||||||
"parts_order": "Parts Order PO: {{ro_number}}"
|
"parts_order": "Parts Order PO: {{ro_number}} - {{name}}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vendors": {
|
"vendors": {
|
||||||
@@ -2116,7 +2130,9 @@
|
|||||||
"paintpriority-set": "Set Paint Priority",
|
"paintpriority-set": "Set Paint Priority",
|
||||||
"remove": "Remove from Production",
|
"remove": "Remove from Production",
|
||||||
"removecolumn": "Remove Column",
|
"removecolumn": "Remove Column",
|
||||||
"saveconfig": "Save Configuration"
|
"saveconfig": "Save Configuration",
|
||||||
|
"suspend": "Suspend",
|
||||||
|
"unsuspend": "Unsuspend"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"boardupdate": "Error encountered updating job. {{message}}",
|
"boardupdate": "Error encountered updating job. {{message}}",
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"alt_transport": "",
|
"alt_transport": "",
|
||||||
"color": "",
|
"color": "",
|
||||||
|
"end": "",
|
||||||
"note": "",
|
"note": "",
|
||||||
|
"start": "",
|
||||||
"time": "",
|
"time": "",
|
||||||
"title": "Título"
|
"title": "Título"
|
||||||
},
|
},
|
||||||
@@ -47,8 +49,10 @@
|
|||||||
"blocked": "",
|
"blocked": "",
|
||||||
"cancelledappointment": "Cita cancelada para:",
|
"cancelledappointment": "Cita cancelada para:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
|
"dataconsistency": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
|
"manualevent": "",
|
||||||
"noarrivingjobs": "",
|
"noarrivingjobs": "",
|
||||||
"nocompletingjobs": "",
|
"nocompletingjobs": "",
|
||||||
"nodateselected": "No se ha seleccionado ninguna fecha.",
|
"nodateselected": "No se ha seleccionado ninguna fecha.",
|
||||||
@@ -833,6 +837,7 @@
|
|||||||
},
|
},
|
||||||
"employees": {
|
"employees": {
|
||||||
"actions": {
|
"actions": {
|
||||||
|
"addvacation": "",
|
||||||
"new": "Nuevo empleado",
|
"new": "Nuevo empleado",
|
||||||
"newrate": ""
|
"newrate": ""
|
||||||
},
|
},
|
||||||
@@ -854,10 +859,16 @@
|
|||||||
"pin": "",
|
"pin": "",
|
||||||
"rate": "",
|
"rate": "",
|
||||||
"termination_date": "Fecha de conclusión",
|
"termination_date": "Fecha de conclusión",
|
||||||
"user_email": ""
|
"user_email": "",
|
||||||
|
"vacation": {
|
||||||
|
"end": "",
|
||||||
|
"length": "",
|
||||||
|
"start": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": "",
|
"actions": "",
|
||||||
|
"endmustbeafterstart": "",
|
||||||
"flat_rate": "",
|
"flat_rate": "",
|
||||||
"name": "",
|
"name": "",
|
||||||
"rate_type": "",
|
"rate_type": "",
|
||||||
@@ -1298,6 +1309,7 @@
|
|||||||
"required": "",
|
"required": "",
|
||||||
"type": ""
|
"type": ""
|
||||||
},
|
},
|
||||||
|
"invoice_final_note": "",
|
||||||
"kmin": "Kilometraje en",
|
"kmin": "Kilometraje en",
|
||||||
"kmout": "Kilometraje",
|
"kmout": "Kilometraje",
|
||||||
"la1": "",
|
"la1": "",
|
||||||
@@ -1577,6 +1589,7 @@
|
|||||||
"subletstotal": "",
|
"subletstotal": "",
|
||||||
"subtotal": "",
|
"subtotal": "",
|
||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
|
"suspended": "",
|
||||||
"suspense": "",
|
"suspense": "",
|
||||||
"total_cost": "",
|
"total_cost": "",
|
||||||
"total_cust_payable": "",
|
"total_cust_payable": "",
|
||||||
@@ -2028,6 +2041,7 @@
|
|||||||
"filing_coversheet_portrait": "",
|
"filing_coversheet_portrait": "",
|
||||||
"final_invoice": "",
|
"final_invoice": "",
|
||||||
"fippa_authorization": "",
|
"fippa_authorization": "",
|
||||||
|
"folder_label_multiple": "",
|
||||||
"glass_express_checklist": "",
|
"glass_express_checklist": "",
|
||||||
"guarantee": "",
|
"guarantee": "",
|
||||||
"individual_job_note": "",
|
"individual_job_note": "",
|
||||||
@@ -2116,7 +2130,9 @@
|
|||||||
"paintpriority-set": "",
|
"paintpriority-set": "",
|
||||||
"remove": "",
|
"remove": "",
|
||||||
"removecolumn": "",
|
"removecolumn": "",
|
||||||
"saveconfig": ""
|
"saveconfig": "",
|
||||||
|
"suspend": "",
|
||||||
|
"unsuspend": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"boardupdate": "",
|
"boardupdate": "",
|
||||||
|
|||||||
@@ -37,7 +37,9 @@
|
|||||||
"fields": {
|
"fields": {
|
||||||
"alt_transport": "",
|
"alt_transport": "",
|
||||||
"color": "",
|
"color": "",
|
||||||
|
"end": "",
|
||||||
"note": "",
|
"note": "",
|
||||||
|
"start": "",
|
||||||
"time": "",
|
"time": "",
|
||||||
"title": "Titre"
|
"title": "Titre"
|
||||||
},
|
},
|
||||||
@@ -47,8 +49,10 @@
|
|||||||
"blocked": "",
|
"blocked": "",
|
||||||
"cancelledappointment": "Rendez-vous annulé pour:",
|
"cancelledappointment": "Rendez-vous annulé pour:",
|
||||||
"completingjobs": "",
|
"completingjobs": "",
|
||||||
|
"dataconsistency": "",
|
||||||
"history": "",
|
"history": "",
|
||||||
"inproduction": "",
|
"inproduction": "",
|
||||||
|
"manualevent": "",
|
||||||
"noarrivingjobs": "",
|
"noarrivingjobs": "",
|
||||||
"nocompletingjobs": "",
|
"nocompletingjobs": "",
|
||||||
"nodateselected": "Aucune date n'a été sélectionnée.",
|
"nodateselected": "Aucune date n'a été sélectionnée.",
|
||||||
@@ -833,6 +837,7 @@
|
|||||||
},
|
},
|
||||||
"employees": {
|
"employees": {
|
||||||
"actions": {
|
"actions": {
|
||||||
|
"addvacation": "",
|
||||||
"new": "Nouvel employé",
|
"new": "Nouvel employé",
|
||||||
"newrate": ""
|
"newrate": ""
|
||||||
},
|
},
|
||||||
@@ -854,10 +859,16 @@
|
|||||||
"pin": "",
|
"pin": "",
|
||||||
"rate": "",
|
"rate": "",
|
||||||
"termination_date": "Date de résiliation",
|
"termination_date": "Date de résiliation",
|
||||||
"user_email": ""
|
"user_email": "",
|
||||||
|
"vacation": {
|
||||||
|
"end": "",
|
||||||
|
"length": "",
|
||||||
|
"start": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": "",
|
"actions": "",
|
||||||
|
"endmustbeafterstart": "",
|
||||||
"flat_rate": "",
|
"flat_rate": "",
|
||||||
"name": "",
|
"name": "",
|
||||||
"rate_type": "",
|
"rate_type": "",
|
||||||
@@ -1298,6 +1309,7 @@
|
|||||||
"required": "",
|
"required": "",
|
||||||
"type": ""
|
"type": ""
|
||||||
},
|
},
|
||||||
|
"invoice_final_note": "",
|
||||||
"kmin": "Kilométrage en",
|
"kmin": "Kilométrage en",
|
||||||
"kmout": "Kilométrage hors",
|
"kmout": "Kilométrage hors",
|
||||||
"la1": "",
|
"la1": "",
|
||||||
@@ -1577,6 +1589,7 @@
|
|||||||
"subletstotal": "",
|
"subletstotal": "",
|
||||||
"subtotal": "",
|
"subtotal": "",
|
||||||
"supplementnote": "",
|
"supplementnote": "",
|
||||||
|
"suspended": "",
|
||||||
"suspense": "",
|
"suspense": "",
|
||||||
"total_cost": "",
|
"total_cost": "",
|
||||||
"total_cust_payable": "",
|
"total_cust_payable": "",
|
||||||
@@ -2028,6 +2041,7 @@
|
|||||||
"filing_coversheet_portrait": "",
|
"filing_coversheet_portrait": "",
|
||||||
"final_invoice": "",
|
"final_invoice": "",
|
||||||
"fippa_authorization": "",
|
"fippa_authorization": "",
|
||||||
|
"folder_label_multiple": "",
|
||||||
"glass_express_checklist": "",
|
"glass_express_checklist": "",
|
||||||
"guarantee": "",
|
"guarantee": "",
|
||||||
"individual_job_note": "",
|
"individual_job_note": "",
|
||||||
@@ -2116,7 +2130,9 @@
|
|||||||
"paintpriority-set": "",
|
"paintpriority-set": "",
|
||||||
"remove": "",
|
"remove": "",
|
||||||
"removecolumn": "",
|
"removecolumn": "",
|
||||||
"saveconfig": ""
|
"saveconfig": "",
|
||||||
|
"suspend": "",
|
||||||
|
"unsuspend": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"boardupdate": "",
|
"boardupdate": "",
|
||||||
|
|||||||
@@ -509,6 +509,11 @@ export const TemplateList = (type, context) => {
|
|||||||
key: "parts_order",
|
key: "parts_order",
|
||||||
subject: i18n.t("printcenter.subjects.jobs.parts_order", {
|
subject: i18n.t("printcenter.subjects.jobs.parts_order", {
|
||||||
ro_number: context && context.job && context.job.ro_number,
|
ro_number: context && context.job && context.job.ro_number,
|
||||||
|
name: (
|
||||||
|
(context && context.job && context.job.ownr_ln) ||
|
||||||
|
(context && context.job && context.job.ownr_co_nm) ||
|
||||||
|
""
|
||||||
|
).trim(),
|
||||||
}),
|
}),
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1773,6 +1773,88 @@
|
|||||||
_eq: X-Hasura-User-Id
|
_eq: X-Hasura-User-Id
|
||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
|
- table:
|
||||||
|
schema: public
|
||||||
|
name: employee_vacation
|
||||||
|
object_relationships:
|
||||||
|
- name: employee
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on: employeeid
|
||||||
|
insert_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
check:
|
||||||
|
employee:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
columns:
|
||||||
|
- id
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- employeeid
|
||||||
|
- start
|
||||||
|
- end
|
||||||
|
backend_only: false
|
||||||
|
select_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- end
|
||||||
|
- start
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- employeeid
|
||||||
|
- id
|
||||||
|
filter:
|
||||||
|
employee:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
update_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
columns:
|
||||||
|
- end
|
||||||
|
- start
|
||||||
|
- created_at
|
||||||
|
- updated_at
|
||||||
|
- employeeid
|
||||||
|
- id
|
||||||
|
filter:
|
||||||
|
employee:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
|
check: null
|
||||||
|
delete_permissions:
|
||||||
|
- role: user
|
||||||
|
permission:
|
||||||
|
filter:
|
||||||
|
employee:
|
||||||
|
bodyshop:
|
||||||
|
associations:
|
||||||
|
_and:
|
||||||
|
- user:
|
||||||
|
authid:
|
||||||
|
_eq: X-Hasura-User-Id
|
||||||
|
- active:
|
||||||
|
_eq: true
|
||||||
- table:
|
- table:
|
||||||
schema: public
|
schema: public
|
||||||
name: employees
|
name: employees
|
||||||
@@ -1791,6 +1873,13 @@
|
|||||||
table:
|
table:
|
||||||
schema: public
|
schema: public
|
||||||
name: allocations
|
name: allocations
|
||||||
|
- name: employee_vacations
|
||||||
|
using:
|
||||||
|
foreign_key_constraint_on:
|
||||||
|
column: employeeid
|
||||||
|
table:
|
||||||
|
schema: public
|
||||||
|
name: employee_vacation
|
||||||
- name: jobsByEmployeeBody
|
- name: jobsByEmployeeBody
|
||||||
using:
|
using:
|
||||||
foreign_key_constraint_on:
|
foreign_key_constraint_on:
|
||||||
@@ -2694,6 +2783,7 @@
|
|||||||
- intakechecklist
|
- intakechecklist
|
||||||
- invoice_allocation
|
- invoice_allocation
|
||||||
- invoice_date
|
- invoice_date
|
||||||
|
- invoice_final_note
|
||||||
- iouparent
|
- iouparent
|
||||||
- job_totals
|
- job_totals
|
||||||
- kanbanparent
|
- kanbanparent
|
||||||
@@ -2779,6 +2869,7 @@
|
|||||||
- state_tax_rate
|
- state_tax_rate
|
||||||
- status
|
- status
|
||||||
- storage_payable
|
- storage_payable
|
||||||
|
- suspended
|
||||||
- tax_lbr_rt
|
- tax_lbr_rt
|
||||||
- tax_levies_rt
|
- tax_levies_rt
|
||||||
- tax_paint_mat_rt
|
- tax_paint_mat_rt
|
||||||
@@ -2948,6 +3039,7 @@
|
|||||||
- intakechecklist
|
- intakechecklist
|
||||||
- invoice_allocation
|
- invoice_allocation
|
||||||
- invoice_date
|
- invoice_date
|
||||||
|
- invoice_final_note
|
||||||
- iouparent
|
- iouparent
|
||||||
- job_totals
|
- job_totals
|
||||||
- kanbanparent
|
- kanbanparent
|
||||||
@@ -3033,6 +3125,7 @@
|
|||||||
- state_tax_rate
|
- state_tax_rate
|
||||||
- status
|
- status
|
||||||
- storage_payable
|
- storage_payable
|
||||||
|
- suspended
|
||||||
- tax_lbr_rt
|
- tax_lbr_rt
|
||||||
- tax_levies_rt
|
- tax_levies_rt
|
||||||
- tax_paint_mat_rt
|
- tax_paint_mat_rt
|
||||||
@@ -3212,6 +3305,7 @@
|
|||||||
- intakechecklist
|
- intakechecklist
|
||||||
- invoice_allocation
|
- invoice_allocation
|
||||||
- invoice_date
|
- invoice_date
|
||||||
|
- invoice_final_note
|
||||||
- iouparent
|
- iouparent
|
||||||
- job_totals
|
- job_totals
|
||||||
- kanbanparent
|
- kanbanparent
|
||||||
@@ -3297,6 +3391,7 @@
|
|||||||
- state_tax_rate
|
- state_tax_rate
|
||||||
- status
|
- status
|
||||||
- storage_payable
|
- storage_payable
|
||||||
|
- suspended
|
||||||
- tax_lbr_rt
|
- tax_lbr_rt
|
||||||
- tax_levies_rt
|
- tax_levies_rt
|
||||||
- tax_paint_mat_rt
|
- tax_paint_mat_rt
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "invoice_final_note" Text
|
||||||
|
-- null;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "invoice_final_note" Text
|
||||||
|
null;
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."jobs" add column "suspended" boolean
|
||||||
|
-- not null default 'false';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."jobs" add column "suspended" boolean
|
||||||
|
not null default 'false';
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
DROP TABLE "public"."employee_vacation";
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
CREATE TABLE "public"."employee_vacation" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "employeeid" uuid NOT NULL, "start" date NOT NULL, "end" date NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("employeeid") REFERENCES "public"."employees"("id") ON UPDATE cascade ON DELETE cascade);
|
||||||
|
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||||
|
RETURNS TRIGGER AS $$
|
||||||
|
DECLARE
|
||||||
|
_new record;
|
||||||
|
BEGIN
|
||||||
|
_new := NEW;
|
||||||
|
_new."updated_at" = NOW();
|
||||||
|
RETURN _new;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
CREATE TRIGGER "set_public_employee_vacation_updated_at"
|
||||||
|
BEFORE UPDATE ON "public"."employee_vacation"
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||||
|
COMMENT ON TRIGGER "set_public_employee_vacation_updated_at" ON "public"."employee_vacation"
|
||||||
|
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||||
|
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||||
@@ -89,7 +89,7 @@ exports.default = async function (socket, jobid) {
|
|||||||
acc[val.profitcenter_part] =
|
acc[val.profitcenter_part] =
|
||||||
acc[val.profitcenter_part].add(DineroAmount);
|
acc[val.profitcenter_part].add(DineroAmount);
|
||||||
}
|
}
|
||||||
if (val.profitcenter_labor) {
|
if (val.profitcenter_labor && val.mod_lbr_ty) {
|
||||||
//Check the Labor Assignment.
|
//Check the Labor Assignment.
|
||||||
|
|
||||||
if (!acc[val.profitcenter_labor])
|
if (!acc[val.profitcenter_labor])
|
||||||
|
|||||||
@@ -473,7 +473,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|||||||
start
|
start
|
||||||
block
|
block
|
||||||
}
|
}
|
||||||
arrJobs: jobs(where: {scheduled_in: {_gte: $now}}) {
|
arrJobs: jobs(where: {scheduled_in: {_gte: $now}, suspended: {_eq: false}}) {
|
||||||
id
|
id
|
||||||
scheduled_in
|
scheduled_in
|
||||||
ro_number
|
ro_number
|
||||||
@@ -492,7 +492,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compJobs: jobs(where: {_or: [{scheduled_completion: {_gte: $now}}, {actual_completion: {_gte: $now}}]}) {
|
compJobs: jobs(where: {_and: [{suspended: {_eq: false}}, {_or: [{scheduled_completion: {_gte: $now}}, {actual_completion: {_gte: $now}}]}]}) {
|
||||||
id
|
id
|
||||||
ro_number
|
ro_number
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
@@ -512,7 +512,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prodJobs: jobs(where: {inproduction: {_eq: true}}) {
|
prodJobs: jobs(where: {inproduction: {_eq: true}, suspended: {_eq: false}}) {
|
||||||
id
|
id
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
labhrs: joblines_aggregate(where: {_and: [{mod_lbr_ty: {_neq: "LAR"}}, {removed: {_eq: false}}]}) {
|
labhrs: joblines_aggregate(where: {_and: [{mod_lbr_ty: {_neq: "LAR"}}, {removed: {_eq: false}}]}) {
|
||||||
@@ -530,11 +530,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}`;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
`;
|
|
||||||
|
|
||||||
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
|
exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) {
|
||||||
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
|
employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) {
|
||||||
|
|||||||
@@ -96,14 +96,28 @@ exports.job = async (req, res) => {
|
|||||||
const inProdJobs = filteredProdJobsList.find((p) => p.id === item.id);
|
const inProdJobs = filteredProdJobsList.find((p) => p.id === item.id);
|
||||||
const inArrJobs = filteredArrJobs.find((p) => p.id === item.id);
|
const inArrJobs = filteredArrJobs.find((p) => p.id === item.id);
|
||||||
|
|
||||||
if (
|
if (!(inProdJobs || inArrJobs)) {
|
||||||
!(inProdJobs || inArrJobs) &&
|
//Job isn't found in production or coming in.
|
||||||
!moment(item.actual_completion || item.scheduled_completion).isSame(
|
//is it going today or scheduled to go today?
|
||||||
moment(),
|
if (
|
||||||
"day"
|
moment(item.actual_completion || item.scheduled_completion).isSame(
|
||||||
)
|
moment(),
|
||||||
) {
|
"day"
|
||||||
// NOT FOUND!
|
)
|
||||||
|
) {
|
||||||
|
console.log("Job is going today anyways, ignore it.", item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
moment(item.actual_completion || item.scheduled_completion).isBefore(
|
||||||
|
moment(),
|
||||||
|
"day"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
console.log("Job should have already gone. Ignoring it.", item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
console.log("PROBLEM JOB", item);
|
console.log("PROBLEM JOB", item);
|
||||||
problemJobs.push({
|
problemJobs.push({
|
||||||
...item,
|
...item,
|
||||||
@@ -140,6 +154,7 @@ exports.job = async (req, res) => {
|
|||||||
...filteredCompJobs
|
...filteredCompJobs
|
||||||
.map((p) => moment(p.actual_completion || p.scheduled_completion))
|
.map((p) => moment(p.actual_completion || p.scheduled_completion))
|
||||||
.filter((p) => p.isValid() && p.isAfter(yesterday)),
|
.filter((p) => p.isValid() && p.isAfter(yesterday)),
|
||||||
|
moment().add(5, "days"),
|
||||||
]);
|
]);
|
||||||
const range = Math.round(moment.duration(end.diff(today)).asDays());
|
const range = Math.round(moment.duration(end.diff(today)).asDays());
|
||||||
for (var day = 0; day < range; day++) {
|
for (var day = 0; day < range; day++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user