Transfered alt_transport to job from event and added to production boards. IO-462
This commit is contained in:
@@ -72,9 +72,12 @@ export default function ProductionBoardCard(card) {
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<Col span={18}>
|
||||
<DateTimeFormatter>{card.scheduled_completion}</DateTimeFormatter>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<div>{card.alt_transport || ""}</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||
<ProductionAlert record={card} key="alert" />
|
||||
|
||||
@@ -156,6 +156,13 @@ const r = [
|
||||
ellipsis: true,
|
||||
sorter: (a, b) => alphaSort(a.csr, b.csr),
|
||||
},
|
||||
{
|
||||
title: i18n.t("jobs.fields.alt_transport"),
|
||||
dataIndex: "alt_transport",
|
||||
key: "alt_transport",
|
||||
ellipsis: true,
|
||||
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||
},
|
||||
{
|
||||
title: i18n.t("jobs.fields.status"),
|
||||
dataIndex: "status",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
import { useMutation } from "react-apollo";
|
||||
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
|
||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
@@ -16,12 +16,12 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
|
||||
export function ScheduleAtChange({ bodyshop, event }) {
|
||||
const [updateAppointment] = useMutation(UPDATE_APPOINTMENT);
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const onClick = async ({ key }) => {
|
||||
const result = await updateAppointment({
|
||||
variables: { appid: event.id, app: { alt_transport: key } },
|
||||
const result = await updateJob({
|
||||
variables: { jobId: event.job.id, job: { alt_transport: key } },
|
||||
});
|
||||
|
||||
if (!!!result.errors) {
|
||||
@@ -35,7 +35,10 @@ export function ScheduleAtChange({ bodyshop, event }) {
|
||||
}
|
||||
};
|
||||
const menu = (
|
||||
<Menu selectedKeys={[event.alt_transport]} onClick={onClick}>
|
||||
<Menu
|
||||
selectedKeys={[event.job && event.job.alt_transport]}
|
||||
onClick={onClick}
|
||||
>
|
||||
{bodyshop.appt_alt_transport &&
|
||||
bodyshop.appt_alt_transport.map((alt) => (
|
||||
<Menu.Item key={alt}>{alt}</Menu.Item>
|
||||
|
||||
@@ -64,8 +64,8 @@ export function ScheduleEventComponent({
|
||||
{(event.job && event.job.ownr_ph1) || ""}
|
||||
</PhoneFormatter>
|
||||
</DataLabel>
|
||||
<DataLabel label={t("appointments.fields.alt_transport")}>
|
||||
{event.alt_transport || ""}
|
||||
<DataLabel label={t("jobs.fields.alt_transport")}>
|
||||
{(event.job && event.job.alt_transport) || ""}
|
||||
<ScheduleAtChange event={event} />
|
||||
</DataLabel>
|
||||
</div>
|
||||
@@ -134,8 +134,8 @@ export function ScheduleEventComponent({
|
||||
(event.job && event.job.larhrs.aggregate.sum.mod_lb_hrs) || "0"
|
||||
})`}
|
||||
</div>
|
||||
{event.alt_transport && (
|
||||
<div style={{ margin: ".1rem" }}>{event.alt_transport}</div>
|
||||
{event.job && event.job.alt_transport && (
|
||||
<div style={{ margin: ".1rem" }}>{event.job.alt_transport}</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
|
||||
@@ -146,7 +146,7 @@ export function ScheduleJobModalComponent({
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={"alt_transport"}
|
||||
label={t("appointments.fields.alt_transport")}
|
||||
label={t("jobs.fields.alt_transport")}
|
||||
>
|
||||
<Select>
|
||||
{bodyshop.appt_alt_transport &&
|
||||
|
||||
@@ -93,8 +93,9 @@ export function ScheduleJobModalContainer({
|
||||
start: moment(values.start),
|
||||
end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"),
|
||||
color: values.color,
|
||||
alt_transport: values.alt_transport,
|
||||
},
|
||||
jobId: jobId,
|
||||
altTransport: values.alt_transport,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
|
||||
isintake
|
||||
block
|
||||
color
|
||||
alt_transport
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
@@ -55,7 +55,11 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
|
||||
`;
|
||||
|
||||
export const INSERT_APPOINTMENT = gql`
|
||||
mutation INSERT_APPOINTMENT($app: [appointments_insert_input!]!) {
|
||||
mutation INSERT_APPOINTMENT(
|
||||
$app: [appointments_insert_input!]!
|
||||
$jobId: uuid
|
||||
$altTransport: String
|
||||
) {
|
||||
insert_appointments(objects: $app) {
|
||||
returning {
|
||||
id
|
||||
@@ -65,6 +69,14 @@ export const INSERT_APPOINTMENT = gql`
|
||||
title
|
||||
isintake
|
||||
block
|
||||
}
|
||||
}
|
||||
update_jobs(
|
||||
where: { id: { _eq: $jobId } }
|
||||
_set: { alt_transport: $altTransport }
|
||||
) {
|
||||
returning {
|
||||
id
|
||||
alt_transport
|
||||
}
|
||||
}
|
||||
@@ -81,9 +93,8 @@ export const QUERY_APPOINTMENT_BY_DATE = gql`
|
||||
end
|
||||
title
|
||||
isintake
|
||||
alt_transport
|
||||
|
||||
job {
|
||||
alt_transport
|
||||
ro_number
|
||||
ownr_ln
|
||||
ownr_fn
|
||||
@@ -129,7 +140,6 @@ export const UPDATE_APPOINTMENT = gql`
|
||||
title
|
||||
isintake
|
||||
block
|
||||
alt_transport
|
||||
color
|
||||
}
|
||||
}
|
||||
@@ -160,7 +170,6 @@ export const QUERY_APPOINTMENTS_BY_JOBID = gql`
|
||||
arrived
|
||||
canceled
|
||||
created_at
|
||||
alt_transport
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -133,6 +133,7 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
|
||||
special_coverage_policy
|
||||
production_vars
|
||||
kanbanparent
|
||||
alt_transport
|
||||
joblines_status {
|
||||
part_type
|
||||
count
|
||||
@@ -702,6 +703,8 @@ export const UPDATE_JOB = gql`
|
||||
id
|
||||
date_exported
|
||||
status
|
||||
alt_transport
|
||||
ro_number
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -778,20 +781,33 @@ export const ACTIVE_JOBS_FOR_AUTOCOMPLETE = gql`
|
||||
`;
|
||||
|
||||
export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql`
|
||||
query SEARCH_JOBS_FOR_AUTOCOMPLETE($search: String, $isConverted: Boolean, $notExported: Boolean) {
|
||||
search_jobs(args: {search: $search}, limit: 50, order_by: {ro_number: desc_nulls_last}, where: {_and: {converted: {_eq: $isConverted}, date_exported: {_is_null: $notExported}}}) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
est_number
|
||||
vehicleid
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
query SEARCH_JOBS_FOR_AUTOCOMPLETE(
|
||||
$search: String
|
||||
$isConverted: Boolean
|
||||
$notExported: Boolean
|
||||
) {
|
||||
search_jobs(
|
||||
args: { search: $search }
|
||||
limit: 50
|
||||
order_by: { ro_number: desc_nulls_last }
|
||||
where: {
|
||||
_and: {
|
||||
converted: { _eq: $isConverted }
|
||||
date_exported: { _is_null: $notExported }
|
||||
}
|
||||
}
|
||||
) {
|
||||
id
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ro_number
|
||||
est_number
|
||||
vehicleid
|
||||
v_make_desc
|
||||
v_model_desc
|
||||
v_model_yr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
`;
|
||||
export const SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE = gql`
|
||||
query SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE($id: uuid!) {
|
||||
|
||||
@@ -858,6 +858,7 @@
|
||||
"actual_delivery": "Actual Delivery",
|
||||
"actual_in": "Actual In",
|
||||
"adjustment_bottom_line": "Adjustments",
|
||||
"alt_transport": "Alt. Trans.",
|
||||
"ca_gst_registrant": "GST Registrant",
|
||||
"category": "Category",
|
||||
"ccc": "CC Cleaning",
|
||||
|
||||
@@ -858,6 +858,7 @@
|
||||
"actual_delivery": "Entrega real",
|
||||
"actual_in": "Real en",
|
||||
"adjustment_bottom_line": "Ajustes",
|
||||
"alt_transport": "",
|
||||
"ca_gst_registrant": "",
|
||||
"category": "",
|
||||
"ccc": "",
|
||||
|
||||
@@ -858,6 +858,7 @@
|
||||
"actual_delivery": "Livraison réelle",
|
||||
"actual_in": "En réel",
|
||||
"adjustment_bottom_line": "Ajustements",
|
||||
"alt_transport": "",
|
||||
"ca_gst_registrant": "",
|
||||
"category": "",
|
||||
"ccc": "",
|
||||
|
||||
Reference in New Issue
Block a user