From 07bf84ed6948a20843d98cd76ee2d8cb8fc770bb Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 9 Apr 2024 11:55:20 -0700 Subject: [PATCH 1/4] IO-2609 Body & Refinish Times included in Calendar View Signed-off-by: Allan Carr --- .../schedule-calendar-header.component.js | 83 +++++++++++-------- .../redux/application/application.sagas.js | 35 +++++++- 2 files changed, 83 insertions(+), 35 deletions(-) diff --git a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js index 732bcc2c2..96ef73a56 100644 --- a/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js +++ b/client/src/components/schedule-calendar-wrapper/schedule-calendar-header.component.js @@ -1,5 +1,5 @@ import Icon from "@ant-design/icons"; -import { Popover } from "antd"; +import { Popover, Space } from "antd"; import _ from "lodash"; import moment from "moment"; import React, { useMemo } from "react"; @@ -69,19 +69,22 @@ export function ScheduleCalendarHeaderComponent({ {loadData && loadData.allJobsOut ? ( loadData.allJobsOut.map((j) => ( - - {j.ro_number} + + {j.ro_number} ( + {j.status}) - + - - {`(${( + + {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed( + 1 + )}/${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} @@ -90,7 +93,9 @@ export function ScheduleCalendarHeaderComponent({ )) ) : ( - {t("appointments.labels.nocompletingjobs")} + + {t("appointments.labels.nocompletingjobs")} + )} @@ -105,27 +110,30 @@ export function ScheduleCalendarHeaderComponent({ {loadData && loadData.allJobsIn ? ( loadData.allJobsIn.map((j) => ( - + {j.ro_number} - {j.status} - + - - {`(${( + + {`(${j.labhrs.aggregate.sum.mod_lb_hrs.toFixed( + 1 + )}/${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")} + )} @@ -136,25 +144,32 @@ 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)} + + +
    diff --git a/client/src/redux/application/application.sagas.js b/client/src/redux/application/application.sagas.js index dc907da74..ff6cb91b0 100644 --- a/client/src/redux/application/application.sagas.js +++ b/client/src/redux/application/application.sagas.js @@ -131,7 +131,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. @@ -142,6 +147,12 @@ export function* calculateScheduleLoad({ payload: end }) { (load[itemDate].hoursIn || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; + load[itemDate].hoursInBoyd = + (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] = { @@ -152,10 +163,18 @@ export function* calculateScheduleLoad({ payload: end }) { 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, + hoursInBody: AddJobForSchedulingCalc + ? item.labhrs.aggregate.sum.mod_lb_hrs + : 0, + hoursInRefinish: AddJobForSchedulingCalc + ? item.larhrs.aggregate.sum.mod_lb_hrs + : 0, }; } }); @@ -179,6 +198,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); @@ -189,6 +214,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] = { @@ -201,6 +232,8 @@ export function* calculateScheduleLoad({ payload: end }) { 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, }; } }); From 63f7106d2bc63b5f24e1a6f3829dbd8a2e7536aa Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 Apr 2024 11:55:55 -0700 Subject: [PATCH 2/4] IO-2752 BO ETA Jobline Expander Signed-off-by: Allan Carr --- .../job-lines-expander.component.jsx | 34 +++++++++++++------ client/src/graphql/jobs.queries.js | 2 ++ 2 files changed, 25 insertions(+), 11 deletions(-) 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 06e00c729..6dab1eb8c 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"; @@ -31,15 +31,27 @@ export default function JobLinesExpander({ jobline, jobid }) { {data.parts_order_lines.length > 0 ? ( data.parts_order_lines.map((line) => ( - } 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} + )) ) : ( @@ -71,7 +83,7 @@ export default function JobLinesExpander({ jobline, jobid }) { - {`${t("billlines.fields.actual_cost")}: `} + {`${t("billlines.fields.actual_cost")}: `} {line.actual_cost} diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 31f9be07c..0cd49d52b 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -2205,6 +2205,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 From ce2086a480f45849065bf620ee5aeda7baa3667d Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 Apr 2024 12:43:14 -0700 Subject: [PATCH 3/4] IO-2753 Parts Order/Return Quantity restrict to above 0 Signed-off-by: Allan Carr --- .../parts-order-modal.component.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 7ce456280..8fcbe4007 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 @@ -1,17 +1,17 @@ -import { DeleteFilled, WarningFilled, DownOutlined } from "@ant-design/icons"; +import { DeleteFilled, DownOutlined, WarningFilled } from "@ant-design/icons"; import { useTreatments } from "@splitsoftware/splitio-react"; import { + Checkbox, Divider, + Dropdown, Form, Input, InputNumber, + Menu, Radio, + Select, Space, Tag, - Select, - Menu, - Dropdown, - Checkbox, } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -255,7 +255,7 @@ export function PartsOrderModalComponent({ }, ]} > - + Date: Thu, 11 Apr 2024 14:38:08 -0700 Subject: [PATCH 4/4] IO-2609 Fix Spelling Mistake in object name Signed-off-by: Allan Carr --- client/src/redux/application/application.sagas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/redux/application/application.sagas.js b/client/src/redux/application/application.sagas.js index ff6cb91b0..ab6f589d9 100644 --- a/client/src/redux/application/application.sagas.js +++ b/client/src/redux/application/application.sagas.js @@ -147,7 +147,7 @@ export function* calculateScheduleLoad({ payload: end }) { (load[itemDate].hoursIn || 0) + item.labhrs.aggregate.sum.mod_lb_hrs + item.larhrs.aggregate.sum.mod_lb_hrs; - load[itemDate].hoursInBoyd = + load[itemDate].hoursInBody = (load[itemDate].hoursInBody || 0) + item.labhrs.aggregate.sum.mod_lb_hrs; load[itemDate].hoursInRefinish =