diff --git a/client/src/components/job-detail-lines/job-lines-expander.component.jsx b/client/src/components/job-detail-lines/job-lines-expander.component.jsx index f90850222..9551db7a0 100644 --- a/client/src/components/job-detail-lines/job-lines-expander.component.jsx +++ b/client/src/components/job-detail-lines/job-lines-expander.component.jsx @@ -1,5 +1,5 @@ import { useQuery } from "@apollo/client"; -import { Col, Divider, Row, Skeleton, Space, Timeline, Typography } from "antd"; +import { Col, Row, Skeleton, Timeline, Typography } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; @@ -43,13 +43,25 @@ export function JobLinesExpander({ jobline, jobid, bodyshop }) { ? data.parts_order_lines.map((line) => ({ key: line.id, children: ( - } wrap> - - {line.parts_order.order_number} - - {line.parts_order.order_date} - {line.parts_order.vendor.name} - + + + + {line.parts_order.order_number} + + + + {line.parts_order.order_date} + + {line.parts_order.vendor.name} + {line.backordered_eta ? ( + + + {`${t("parts_orders.fields.backordered_eta")}: `} + {line.backordered_eta} + + + ) : null} + ) })) : [ @@ -61,6 +73,31 @@ export function JobLinesExpander({ jobline, jobid, bodyshop }) { } />{" "} + + {t("parts_dispatch.labels.parts_dispatch")} + 0 + ? data.parts_dispatch_lines.map((line) => ({ + key: line.id, + children: ( + } wrap> + {line.parts_dispatch.number} + {bodyshop.employees.find((e) => e.id === line.parts_dispatch.employeeid)?.first_name} + + {t("parts_dispatch_lines.fields.accepted_at")} + {line.accepted_at} + + + ) + })) + : { + key: "dispatch-lines", + children: t("parts_orders.labels.notyetordered") + } + } + /> + {t("bills.labels.bills")} - - {t("parts_dispatch.labels.parts_dispatch")} - 0 - ? data.parts_dispatch_lines.map((line) => ({ - key: line.id, - children: ( - } wrap> - {line.parts_dispatch.number} - {bodyshop.employees.find((e) => e.id === line.parts_dispatch.employeeid)?.first_name} - - {t("parts_dispatch_lines.fields.accepted_at")} - {line.accepted_at} - - - ) - })) - : { - key: "dispatch-lines", - children: t("parts_orders.labels.notyetordered") - } - } - /> - ); } diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx index 946b29bad..86ab18aac 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx @@ -182,7 +182,7 @@ export function PartsOrderModalComponent({ bodyshop, vendorList, sendTypeState, } ]} > - + ( - - {j.ro_number} + + {j.ro_number} ( + {j.status}) - + - - {`(${(j.labhrs.aggregate.sum.mod_lb_hrs + j.larhrs.aggregate.sum.mod_lb_hrs).toFixed( + + {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed( 1 - )} ${t("general.labels.hours")})`} + )}/${j.larhrs.aggregate.sum.mod_lb_hrs.toFixed(1)}/${( + j.labhrs.aggregate.sum.mod_lb_hrs + + j.larhrs.aggregate.sum.mod_lb_hrs + ).toFixed(1)} ${t("general.labels.hours")})`} - - {j.scheduled_completion} + + + {j.scheduled_completion} + )) ) : ( - {t("appointments.labels.nocompletingjobs")} + + {t("appointments.labels.nocompletingjobs")} + )} @@ -92,26 +100,30 @@ export function ScheduleCalendarHeaderComponent({ {loadData && loadData.allJobsIn ? ( loadData.allJobsIn.map((j) => ( - + {j.ro_number} - {j.status} - + - - {`(${(j.labhrs.aggregate.sum.mod_lb_hrs + j.larhrs.aggregate.sum.mod_lb_hrs).toFixed( + + {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed( 1 - )} ${t("general.labels.hours")})`} + )}/${j.larhrs.aggregate.sum.mod_lb_hrs.toFixed(1)}/${( + j.labhrs.aggregate.sum.mod_lb_hrs + + j.larhrs.aggregate.sum.mod_lb_hrs + ).toFixed(1)} ${t("general.labels.hours")})`} - + {j.scheduled_in} )) ) : ( - {t("appointments.labels.noarrivingjobs")} + + {t("appointments.labels.noarrivingjobs")} + )} @@ -121,27 +133,33 @@ export function ScheduleCalendarHeaderComponent({ const LoadComponent = loadData ? (
- - - - {(loadData.allHoursIn || 0) && loadData.allHoursIn.toFixed(2)} - - - - {(loadData.allHoursOut || 0) && loadData.allHoursOut.toFixed(2)} - - - + + + + {(loadData.allHoursInBody || 0) && + loadData.allHoursInBody.toFixed(1)} + / + {(loadData.allHoursInRefinish || 0) && + loadData.allHoursInRefinish.toFixed(1)} + /{(loadData.allHoursIn || 0) && loadData.allHoursIn.toFixed(1)} + + + + {(loadData.allHoursOut || 0) && loadData.allHoursOut.toFixed(1)} + + + +
    {Object.keys(ATSToday).map((key, idx) => ( diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 52a14bb61..ed0415b0a 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -2238,6 +2238,8 @@ export const GET_JOB_LINE_ORDERS = gql` parts_order_lines(where: { job_line_id: { _eq: $joblineid } }) { id act_price + backordered_eta + backordered_on parts_order { id order_date diff --git a/client/src/redux/application/application.sagas.js b/client/src/redux/application/application.sagas.js index 3aca6fa5d..a07c5a244 100644 --- a/client/src/redux/application/application.sagas.js +++ b/client/src/redux/application/application.sagas.js @@ -111,7 +111,12 @@ export function* calculateScheduleLoad({ payload: end }) { (load[itemDate].allHoursIn || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; - + load[itemDate].allHoursInBody = + (load[itemDate].allHoursInBody || 0) + + item.labhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].allHoursInRefinish = + (load[itemDate].allHoursInRefinish || 0) + + item.larhrs.aggregate.sum.mod_lb_hrs; //If the job hasn't already arrived, add it to the jobs in list. // Make sure it also hasn't already been completed, or isn't an in and out job. //This prevents the duplicate counting. @@ -119,7 +124,15 @@ export function* calculateScheduleLoad({ payload: end }) { if (AddJobForSchedulingCalc) { load[itemDate].jobsIn.push(item); load[itemDate].hoursIn = - (load[itemDate].hoursIn || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; + (load[itemDate].hoursIn || 0) + + item.labhrs.aggregate.sum.mod_lb_hrs + + item.larhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].hoursInBody = + (load[itemDate].hoursInBody || 0) + + item.labhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].hoursInRefinish = + (load[itemDate].hoursInRefinish || 0) + + item.larhrs.aggregate.sum.mod_lb_hrs; } } else { load[itemDate] = { @@ -127,10 +140,21 @@ export function* calculateScheduleLoad({ payload: end }) { jobsIn: AddJobForSchedulingCalc ? [item] : [], //Same as above, only add it if it isn't already in production. jobsOut: [], allJobsOut: [], - allHoursIn: item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs, + allHoursIn: + item.labhrs.aggregate.sum.mod_lb_hrs + + item.larhrs.aggregate.sum.mod_lb_hrs, + allHoursInBody: item.labhrs.aggregate.sum.mod_lb_hrs, + allHoursInRefinish: item.larhrs.aggregate.sum.mod_lb_hrs, hoursIn: AddJobForSchedulingCalc - ? item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs - : 0 + ? item.labhrs.aggregate.sum.mod_lb_hrs + + item.larhrs.aggregate.sum.mod_lb_hrs + : 0, + hoursInBody: AddJobForSchedulingCalc + ? item.labhrs.aggregate.sum.mod_lb_hrs + : 0, + hoursInRefinish: AddJobForSchedulingCalc + ? item.larhrs.aggregate.sum.mod_lb_hrs + : 0, }; } }); @@ -151,6 +175,12 @@ export function* calculateScheduleLoad({ payload: end }) { (load[itemDate].allHoursOut || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].allHoursOutBody = + (load[itemDate].allHoursOutBody || 0) + + item.labhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].allHoursOutRefinish = + (load[itemDate].allHoursOutRefinish || 0) + + item.larhrs.aggregate.sum.mod_lb_hrs; //Add only the jobs that are still in production to get rid of. //If it's not in production, we'd subtract unnecessarily. load[itemDate].allJobsOut.push(item); @@ -161,6 +191,12 @@ export function* calculateScheduleLoad({ payload: end }) { (load[itemDate].hoursOut || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].hoursOutBody = + (load[itemDate].hoursOutBody || 0) + + item.labhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].hoursOutRefinish = + (load[itemDate].hoursOutRefinish || 0) + + item.larhrs.aggregate.sum.mod_lb_hrs; } } else { load[itemDate] = { @@ -169,7 +205,11 @@ export function* calculateScheduleLoad({ payload: end }) { hoursOut: AddJobForSchedulingCalc ? item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs : 0, - allHoursOut: item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs + allHoursOut: + item.labhrs.aggregate.sum.mod_lb_hrs + + item.larhrs.aggregate.sum.mod_lb_hrs, + allHoursOutBody: item.labhrs.aggregate.sum.mod_lb_hrs, + allHoursOutRefinish: item.larhrs.aggregate.sum.mod_lb_hrs, }; } });