diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 2456b19d5..1db938a77 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -34961,6 +34961,27 @@ + + ats + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + bodyhours false @@ -35024,6 +35045,27 @@ + + clm_no + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + compact false @@ -35108,6 +35150,27 @@ + + ins_co_nm + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + jobdetail false @@ -35171,6 +35234,27 @@ + + ownr_nm + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + paintpriority false @@ -35192,6 +35276,27 @@ + + production_note + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + refinishhours false @@ -35213,6 +35318,27 @@ + + scheduled_completion + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + selectview false diff --git a/client/src/components/contract-form/contract-form.component.jsx b/client/src/components/contract-form/contract-form.component.jsx index acf1b53fd..803fd59d0 100644 --- a/client/src/components/contract-form/contract-form.component.jsx +++ b/client/src/components/contract-form/contract-form.component.jsx @@ -1,5 +1,5 @@ import { WarningFilled } from "@ant-design/icons"; -import { Form, Input, InputNumber, Space } from "antd"; +import { Form, Input, InputNumber, Space, Switch } from "antd"; import moment from "moment"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -42,7 +42,6 @@ export default function ContractFormComponent({ )} - e.id === card.employee_body); } @@ -29,125 +29,36 @@ export default function ProductionBoardCard( (e) => e.id === card.employee_refinish ); } - if (card.employee_csr) { - employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr); - } + // if (card.employee_csr) { + // employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr); + // } return ( setFlipped(!flipped)} - > -
- - {card.ro_number || t("general.labels.na")} - - - {cardSettings && cardSettings.alert && ( - - )} - {technician ? ( - - - - ) : ( - - - - )} + className="react-kanban-card imex-kanban-card" + size="small" + title={ + + + + {card.ro_number || t("general.labels.na")} + -
- {flipped ? ( - - {cardSettings && cardSettings.clm_no === "back" && ( - -
{card.clm_no || ""}
- - )} - {cardSettings && cardSettings.ins_co_nm === "back" && ( - -
{card.ins_co_nm || ""}
- - )} - {cardSettings && cardSettings.laborhrs === "back" && ( - - -
{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}
-
{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}
-
- - )} - {cardSettings && cardSettings.employeeassignments === "back" && ( - - -
{`B: ${ - employee_body - ? `${employee_body.first_name} ${employee_body.last_name}` - : "" - }`}
-
{`P: ${ - employee_prep - ? `${employee_prep.first_name} ${employee_prep.last_name}` - : "" - }`}
-
{`R: ${ - employee_refinish - ? `${employee_refinish.first_name} ${employee_refinish.last_name}` - : "" - }`}
-
{`CSR: ${ - employee_csr - ? `${employee_csr.first_name} ${employee_csr.last_name}` - : "" - }`}
-
- - )} - {cardSettings && cardSettings.scheduled_completion === "back" && ( - - - - - {card.scheduled_completion} - - - - )} - {cardSettings && cardSettings.ats === "back" && ( - - -
{card.alt_transport || ""}
- - - )} - - {cardSettings && cardSettings.sublets === "back" && ( - - - - )} - {cardSettings && cardSettings.production_note === "back" && ( - - {cardSettings && cardSettings.production_note === "back" && ( - - )} - - )} -
- ) : ( - + } + extra={ + technician ? ( + + + + ) : ( + + + + ) + } + > + + {cardSettings && cardSettings.ownr_nm && ( {cardSettings && cardSettings.compact ? (
{`${card.ownr_ln || ""} ${ @@ -159,68 +70,74 @@ export default function ProductionBoardCard( } ${card.ownr_co_nm || ""}`}
)} - -
{`${card.v_model_yr || ""} ${ - card.v_make_desc || "" - } ${card.v_model_desc || ""}`}
+ )} + +
{`${card.v_model_yr || ""} ${ + card.v_make_desc || "" + } ${card.v_model_desc || ""}`}
+ + {cardSettings && cardSettings.ins_co_nm && card.ins_co_nm && ( + +
{card.ins_co_nm || ""}
+ )} + {cardSettings && cardSettings.clm_no && card.clm_no && ( + +
{card.clm_no || ""}
+ + )} - {cardSettings && cardSettings.clm_no === "front" && ( + {cardSettings && cardSettings.employeeassignments && ( + + + {`B: ${ + employee_body + ? `${employee_body.first_name.substr( + 0, + 3 + )} ${employee_body.last_name.charAt(0)}` + : "" + } ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`} + {`P: ${ + employee_prep + ? `${employee_prep.first_name.substr( + 0, + 3 + )} ${employee_prep.last_name.charAt(0)}` + : "" + }`} + {`R: ${ + employee_refinish + ? `${employee_refinish.first_name.substr( + 0, + 3 + )} ${employee_refinish.last_name.charAt(0)}` + : "" + } ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`} + {/* {`C: ${ + employee_csr + ? `${employee_csr.first_name} ${employee_csr.last_name}` + : "" + }`} */} + + + )} + {/* {cardSettings && cardSettings.laborhrs && ( + + + {`B: ${ + card.labhrs.aggregate.sum.mod_lb_hrs || "?" + } hrs`} + {`R: ${ + card.larhrs.aggregate.sum.mod_lb_hrs || "?" + } hrs`} + + + )} */} + {cardSettings && + cardSettings.scheduled_completion && + card.scheduled_completion && ( -
{card.clm_no || ""}
- - )} - {cardSettings && cardSettings.ins_co_nm === "front" && ( - -
{card.ins_co_nm || ""}
- - )} - {cardSettings && cardSettings.laborhrs === "front" && ( - - -
{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}
-
{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}
-
- - )} - {cardSettings && cardSettings.employeeassignments === "front" && ( - - -
{`B: ${ - employee_body - ? `${employee_body.first_name} ${employee_body.last_name}` - : "" - }`}
-
{`P: ${ - employee_prep - ? `${employee_prep.first_name} ${employee_prep.last_name}` - : "" - }`}
-
{`R: ${ - employee_refinish - ? `${employee_refinish.first_name} ${employee_refinish.last_name}` - : "" - }`}
-
{`CSR: ${ - employee_csr - ? `${employee_csr.first_name} ${employee_csr.last_name}` - : "" - }`}
-
- - )} - {cardSettings && cardSettings.scheduled_completion === "front" && ( - @@ -229,27 +146,26 @@ export default function ProductionBoardCard( )} - {cardSettings && cardSettings.ats === "front" && ( - -
{card.alt_transport || ""}
- - )} - {cardSettings && cardSettings.sublets === "front" && ( - - - - )} - {cardSettings && cardSettings.production_note === "front" && ( - - {cardSettings && cardSettings.production_note === "front" && ( - - )} - - )} -
- )} + {cardSettings && cardSettings.ats && card.alt_transport && ( + +
{card.alt_transport || ""}
+ + )} + {cardSettings && cardSettings.sublets && ( + + + + )} + {cardSettings && cardSettings.production_note && ( + + {cardSettings && cardSettings.production_note && ( + + )} + + )} +
); } diff --git a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx index 9ae6666a1..cfecf04fa 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx +++ b/client/src/components/production-board-kanban/production-board-kanban.card-settings.component.jsx @@ -63,85 +63,74 @@ export default function ProductionBoardKanbanCardSettings({ >
- - - Front - Back - Off - + + + + + - - Front - Back - Off - + - - - Front - Back - Off - - + + */} - - Front - Back - Off - + + + - - Front - Back - Off - - {" "} - - - - - Front - Back - Off - + + + + - - Front - Back - Off - + - - - Front - Back - Off - - - - - Front - Back - Off - + {/* + + */} + + diff --git a/client/src/components/production-board-kanban/production-board-kanban.component.jsx b/client/src/components/production-board-kanban/production-board-kanban.component.jsx index 4423a23fe..1f3129eeb 100644 --- a/client/src/components/production-board-kanban/production-board-kanban.component.jsx +++ b/client/src/components/production-board-kanban/production-board-kanban.component.jsx @@ -2,7 +2,7 @@ import { useApolloClient } from "@apollo/client"; import Board, { moveCard } from "@asseinfo/react-kanban"; //import "@asseinfo/react-kanban/dist/styles.css"; import "./production-board-kanban.styles.scss"; -import { notification, PageHeader, Space, Statistic } from "antd"; +import { Grid, notification, PageHeader, Space, Statistic } from "antd"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -145,22 +145,42 @@ export function ProductionBoardKanbanComponent({ 0 ) .toFixed(1); + const selectedBreakpoint = Object.entries(Grid.useBreakpoint()) + .filter((screen) => !!screen[1]) + .slice(-1)[0]; + + const standardSizes = { + xs: "250", + sm: "250", + md: "250", + lg: "250", + xl: "250", + xxl: "250", + }; + const compactSizes = { + xs: "150", + sm: "150", + md: "150", + lg: "150", + xl: "155", + xxl: "155", + }; + + const width = selectedBreakpoint + ? associationSettings && + associationSettings.kanban_settings && + associationSettings.kanban_settings.compact + ? compactSizes[selectedBreakpoint[0]] + : standardSizes[selectedBreakpoint[0]] + : "250"; const Container = styled.div` .react-kanban-card-skeleton, .react-kanban-card, .react-kanban-card-adder-form { box-sizing: border-box; - max-width: ${associationSettings && - associationSettings.kanban_settings && - associationSettings.kanban_settings.compact - ? "145" - : "250"}px; - min-width: ${associationSettings && - associationSettings.kanban_settings && - associationSettings.kanban_settings.compact - ? "145" - : "250"}px; + max-width: ${width}px; + min-width: ${width}px; } `; diff --git a/client/src/components/production-sublets-manage/production-sublets-manage.component.jsx b/client/src/components/production-sublets-manage/production-sublets-manage.component.jsx index e930ed9c4..2fdc2619b 100644 --- a/client/src/components/production-sublets-manage/production-sublets-manage.component.jsx +++ b/client/src/components/production-sublets-manage/production-sublets-manage.component.jsx @@ -56,7 +56,10 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) { + + {selectedJobState[0] && selectedCarState[0] && ( + + + + )} + + ); return ( diff --git a/client/src/pages/contract-create/contract-create.page.container.jsx b/client/src/pages/contract-create/contract-create.page.container.jsx index 95d31e486..7ab35f1c5 100644 --- a/client/src/pages/contract-create/contract-create.page.container.jsx +++ b/client/src/pages/contract-create/contract-create.page.container.jsx @@ -7,6 +7,7 @@ import { useHistory, useLocation } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import RbacWrapper from "../../components/rbac-wrapper/rbac-wrapper.component"; import { INSERT_NEW_CONTRACT } from "../../graphql/cccontracts.queries"; +import { UPDATE_JOB } from "../../graphql/jobs.queries"; import { setBreadcrumbs, setSelectedHeader, @@ -37,8 +38,9 @@ export function ContractCreatePageContainer({ (location.state && location.state.jobId) || null ); const [insertContract] = useMutation(INSERT_NEW_CONTRACT); + const [intakeJob] = useMutation(UPDATE_JOB); - const handleFinish = async (values) => { + const handleFinish = async ({ addtoproduction, ...values }) => { if (!!selectedCarState[0] && !!selectedJobState[0]) { setLoading(true); const result = await insertContract({ @@ -54,12 +56,35 @@ export function ContractCreatePageContainer({ }, }, }); + if (!result.errors) { //Update the courtesy car to have the damage. notification["success"]({ message: t("contracts.successes.saved"), }); + //Intake the job if required + if (addtoproduction) { + const result2 = await intakeJob({ + variables: { + jobId: selectedJobState[0], + job: { + actual_in: new Date(), + inproduction: true, + status: bodyshop.md_ro_statuses.default_arrived, + }, + }, + }); + if (result2.errors) { + notification["error"]({ + message: t("jobs.errors.saving", { + error: JSON.stringify(!result2.errors), + }), + }); + return; + } + } + form.resetFields(); form.resetFields(); history.push( diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 7b7f6ea0a..250e82b24 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2085,18 +2085,24 @@ "alert": "Alert", "alertoff": "Remove alert from job", "alerton": "Add alert to job", + "ats": "Alternative Transportation", "bodyhours": "B", "bodypriority": "B/P", "cardsettings": "Card Settings", + "clm_no": "Claim Number", "compact": "Compact Cards", "detailpriority": "D/P", "employeeassignments": "Employee Assignments", "employeesearch": "Employee Search", + "ins_co_nm": "Insurance Company Name", "jobdetail": "Job Details", "laborhrs": "Labor Hours", "note": "Production Note", + "ownr_nm": "Owner Name", "paintpriority": "P/P", + "production_note": "Production Note", "refinishhours": "R", + "scheduled_completion": "Scheduled Completion", "selectview": "Select a View", "sublets": "Sublets", "totalhours": "Total Hrs ", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 574d37980..1516b6697 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2085,18 +2085,24 @@ "alert": "", "alertoff": "", "alerton": "", + "ats": "", "bodyhours": "", "bodypriority": "", "cardsettings": "", + "clm_no": "", "compact": "", "detailpriority": "", "employeeassignments": "", "employeesearch": "", + "ins_co_nm": "", "jobdetail": "", "laborhrs": "", "note": "", + "ownr_nm": "", "paintpriority": "", + "production_note": "", "refinishhours": "", + "scheduled_completion": "", "selectview": "", "sublets": "", "totalhours": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 1adff188e..570e5d46c 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2085,18 +2085,24 @@ "alert": "", "alertoff": "", "alerton": "", + "ats": "", "bodyhours": "", "bodypriority": "", "cardsettings": "", + "clm_no": "", "compact": "", "detailpriority": "", "employeeassignments": "", "employeesearch": "", + "ins_co_nm": "", "jobdetail": "", "laborhrs": "", "note": "", + "ownr_nm": "", "paintpriority": "", + "production_note": "", "refinishhours": "", + "scheduled_completion": "", "selectview": "", "sublets": "", "totalhours": "",