From 17baca40d915f7a0050b1a6cdc4798bf9da70177 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 19 Jul 2022 15:57:32 -0700 Subject: [PATCH 1/5] IO-1982 add alt_partno to jobs list and order button. --- .../job-detail-lines/job-lines.component.jsx | 25 ++++++++++++++++--- client/src/graphql/jobs.queries.js | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx index a665118a9..2b1ddf2b9 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -115,7 +115,10 @@ export function JobLinesComponent({ sortOrder: state.sortedInfo.columnKey === "oem_partno" && state.sortedInfo.order, ellipsis: true, - render: (text, record) => record.oem_partno, + render: (text, record) => + `${record.oem_partno || ""} ${ + record.alt_partno ? `(${record.alt_partno})` : "" + }`.trim(), }, { title: t("joblines.fields.op_code_desc"), @@ -461,7 +464,12 @@ export function JobLinesComponent({ context: { jobId: job.id, job: job, - linesToOrder: selectedLines, + linesToOrder: selectedLines.map((l) => ({ + ...l, + oem_partno: `${l.oem_partno || ""} ${ + l.alt_partno ? `(${l.alt_partno})` : "" + }`.trim(), + })), }, }); @@ -477,7 +485,18 @@ export function JobLinesComponent({ setState({ ...state, filteredInfo: { - part_type: ["PAN","PAC","PAR","PAL","PAA","PAM","PAP","PAS","PASL","PAG"], + part_type: [ + "PAN", + "PAC", + "PAR", + "PAL", + "PAA", + "PAM", + "PAP", + "PAS", + "PASL", + "PAG", + ], }, }); }} diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 71534b18d..e5dcbda9c 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -685,6 +685,7 @@ export const GET_JOB_BY_PK = gql` line_ref part_type oem_partno + alt_partno db_price act_price part_qty From b189b045f84d0c4303d8dbea274180ac820c88ac Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 20 Jul 2022 14:16:41 -0700 Subject: [PATCH 2/5] IO-1988 Download LMS as zip. --- ...jobs-documents-local-gallery.container.jsx | 2 + .../jobs-documents-local-gallery.download.jsx | 74 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.download.jsx diff --git a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx index 92ba94f17..f58c8025c 100644 --- a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx +++ b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.container.jsx @@ -14,6 +14,7 @@ import { selectAllMedia } from "../../redux/media/media.selectors"; import { selectBodyshop } from "../../redux/user/user.selectors"; import { CreateExplorerLinkForJob } from "../../utils/localmedia"; import DocumentsLocalUploadComponent from "../documents-local-upload/documents-local-upload.component"; +import JobsLocalGalleryDownloadButton from "./jobs-documents-local-gallery.download"; import JobsDocumentsLocalGalleryReassign from "./jobs-documents-local-gallery.reassign.component"; import JobsDocumentsLocalGallerySelectAllComponent from "./jobs-documents-local-gallery.selectall.component"; @@ -78,6 +79,7 @@ export function JobsDocumentsLocalGallery({ + ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(JobsLocalGalleryDownloadButton); + +export function JobsLocalGalleryDownloadButton({ + bodyshop, + galleryImages, + allMedia, + job, +}) { + const { t } = useTranslation(); + const [download, setDownload] = useState(null); + + function downloadProgress(progressEvent) { + setDownload((currentDownloadState) => { + return { + downloaded: progressEvent.loaded || 0, + speed: + (progressEvent.loaded || 0) - + ((currentDownloadState && currentDownloadState.downloaded) || 0), + }; + }); + } + + const handleDownload = async () => { + const theDownloadedZip = await cleanAxios.post( + `${bodyshop.localmediaserverhttp}/jobs/download`, + { + jobid: job.id, + files: ((allMedia && allMedia[job.id]) || []) + .filter((i) => i.isSelected) + .map((i) => i.filename), + }, + { + headers: { ims_token: bodyshop.localmediatoken }, + responseType: "arraybuffer", + onDownloadProgress: downloadProgress, + } + ); + setDownload(null); + standardMediaDownload(theDownloadedZip.data, job.ro_number); + }; + + return ( + + ); +} + +function standardMediaDownload(bufferData, filename) { + const a = document.createElement("a"); + const url = window.URL.createObjectURL(new Blob([bufferData])); + a.href = url; + a.download = `${filename}.zip`; + a.click(); +} From cd29a0f61360b9a4f3581331dc799ffa854f2b4d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 20 Jul 2022 14:39:06 -0700 Subject: [PATCH 3/5] IO-1983 Add filter to job notes table for audit. --- bodyshop_translations.babel | 42 +++++++++++++++++++ .../jobs-notes/jobs.notes.component.jsx | 20 +++++++++ client/src/translations/en_us/common.json | 4 +- client/src/translations/es/common.json | 4 +- client/src/translations/fr/common.json | 4 +- 5 files changed, 71 insertions(+), 3 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 45256e2f5..98c5c1288 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -32606,6 +32606,48 @@ + + systemnotes + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + usernotes + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/jobs-notes/jobs.notes.component.jsx b/client/src/components/jobs-notes/jobs.notes.component.jsx index 8f60e879d..4aaf95caf 100644 --- a/client/src/components/jobs-notes/jobs.notes.component.jsx +++ b/client/src/components/jobs-notes/jobs.notes.component.jsx @@ -14,6 +14,7 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors import { setModalContext } from "../../redux/modals/modals.actions"; import { DateTimeFormatter } from "../../utils/DateFormatter"; import { TemplateList } from "../../utils/TemplateConstants"; +import useLocalStorage from "../../utils/useLocalStorage"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container"; import PrintWrapperComponent from "../print-wrapper/print-wrapper.component"; @@ -40,6 +41,8 @@ export function JobNotesComponent({ relatedRos, }) { const { t } = useTranslation(); + const [filter, setFilter] = useLocalStorage("filter_job_notes_icons", null); + const Templates = TemplateList("job_special", { ro_number, }); @@ -50,6 +53,18 @@ export function JobNotesComponent({ dataIndex: "icons", key: "icons", width: 80, + filteredValue: filter?.icons || null, + filters: [ + { + text: t("notes.labels.usernotes"), + value: false, + }, + { + text: t("notes.labels.systemnotes"), + value: true, + }, + ], + onFilter: (value, record) => record.audit === value, render: (text, record) => ( {record.critical ? ( @@ -131,6 +146,10 @@ export function JobNotesComponent({ }, ]; + const handleTableChange = (pagination, filters, sorter) => { + setFilter(filters); + }; + return (
@@ -166,6 +185,7 @@ export function JobNotesComponent({ columns={columns} rowKey="id" dataSource={data} + onChange={handleTableChange} />
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index e639faaff..e0406f16c 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1919,7 +1919,9 @@ "labels": { "addtorelatedro": "Add to Related ROs", "newnoteplaceholder": "Add a note...", - "notetoadd": "Note to Add" + "notetoadd": "Note to Add", + "systemnotes": "System Notes", + "usernotes": "User Notes" }, "successes": { "create": "Note created successfully.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index d0de45bf3..1d2a79972 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1919,7 +1919,9 @@ "labels": { "addtorelatedro": "", "newnoteplaceholder": "Agrega una nota...", - "notetoadd": "" + "notetoadd": "", + "systemnotes": "", + "usernotes": "" }, "successes": { "create": "Nota creada con éxito.", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index b1dfc0c2d..39b59c5ba 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1919,7 +1919,9 @@ "labels": { "addtorelatedro": "", "newnoteplaceholder": "Ajouter une note...", - "notetoadd": "" + "notetoadd": "", + "systemnotes": "", + "usernotes": "" }, "successes": { "create": "Remarque créée avec succès.", From 9ddcb1f27db478f378b056bdb0030462efdf2e63 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 20 Jul 2022 15:07:37 -0700 Subject: [PATCH 4/5] IO-1985 add Est to actie and ready jobs screens. --- bodyshop_translations.babel | 21 +++++++++++++++ .../jobs-list/jobs-list.component.jsx | 26 +++++++++++++++++++ .../jobs-ready-list.component.jsx | 26 +++++++++++++++++++ client/src/graphql/jobs.queries.js | 2 ++ client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + 7 files changed, 78 insertions(+) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 98c5c1288..0ab4e1f61 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -27406,6 +27406,27 @@ + + estimator + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + existing_jobs false diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index 3c2553462..82620dd63 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -264,6 +264,32 @@ export function JobsList({ bodyshop }) { {record.clm_total} ), }, + { + title: t("jobs.labels.estimator"), + dataIndex: "jobs.labels.estimator", + key: "jobs.labels.estimator", + ellipsis: true, + responsive: ["xl"], + filterSearch: true, + filters: + (jobs && + jobs + .map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim()) + .filter(onlyUnique) + .map((s) => { + return { + text: s || "N/A", + value: [s], + }; + })) || + [], + onFilter: (value, record) => + value.includes( + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim() + ), + render: (text, record) => + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(), + }, { title: t("jobs.fields.comment"), dataIndex: "comment", diff --git a/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx b/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx index e1a598562..47fd2fc15 100644 --- a/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx +++ b/client/src/components/jobs-ready-list/jobs-ready-list.component.jsx @@ -276,6 +276,32 @@ export function JobsReadyList({ bodyshop }) { {record.clm_total} ), }, + { + title: t("jobs.labels.estimator"), + dataIndex: "jobs.labels.estimator", + key: "jobs.labels.estimator", + ellipsis: true, + responsive: ["xl"], + filterSearch: true, + filters: + (jobs && + jobs + .map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim()) + .filter(onlyUnique) + .map((s) => { + return { + text: s || "N/A", + value: [s], + }; + })) || + [], + onFilter: (value, record) => + value.includes( + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim() + ), + render: (text, record) => + `${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(), + }, { title: t("jobs.fields.comment"), dataIndex: "comment", diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index e5dcbda9c..f902c19a0 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -40,6 +40,8 @@ export const QUERY_ALL_ACTIVE_JOBS = gql` updated_at ded_amt suspended + est_ct_fn + est_ct_ln } } `; diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index e0406f16c..b4748b540 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1616,6 +1616,7 @@ "duplicateconfirm": "Are you sure you want to duplicate this job? Some elements of this job will not be duplicated.", "employeeassignments": "Employee Assignments", "estimatelines": "Estimate Lines", + "estimator": "Estimator", "existing_jobs": "Existing Jobs", "federal_tax_amt": "Federal Taxes", "gpdollars": "$ G.P.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 1d2a79972..63d161450 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1616,6 +1616,7 @@ "duplicateconfirm": "", "employeeassignments": "", "estimatelines": "", + "estimator": "", "existing_jobs": "Empleos existentes", "federal_tax_amt": "", "gpdollars": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 39b59c5ba..eeef96c19 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1616,6 +1616,7 @@ "duplicateconfirm": "", "employeeassignments": "", "estimatelines": "", + "estimator": "", "existing_jobs": "Emplois existants", "federal_tax_amt": "", "gpdollars": "", From b30192c6d5cc1e472131ce1b72ecb2798146e336 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 20 Jul 2022 15:18:13 -0700 Subject: [PATCH 5/5] IO-1978 Updated parts return logic and removed extra button. --- .../bill-detail-edit-return.component.jsx | 15 +++++++- .../bills-list-table.component.jsx | 34 +------------------ 2 files changed, 15 insertions(+), 34 deletions(-) diff --git a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx index 99f4cb53b..81571f8b0 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx @@ -94,7 +94,20 @@ export function BillDetailEditReturn({ - + diff --git a/client/src/components/bills-list-table/bills-list-table.component.jsx b/client/src/components/bills-list-table/bills-list-table.component.jsx index 8257c0b39..9dea48f71 100644 --- a/client/src/components/bills-list-table/bills-list-table.component.jsx +++ b/client/src/components/bills-list-table/bills-list-table.component.jsx @@ -67,39 +67,7 @@ export function BillsListTableComponent({ jobRO } /> - + {record.isinhouse && (
+ { + form.setFieldsValue({ + billlines: form + .getFieldsValue() + .billlines.map((b) => ({ + ...b, + selected: e.target.checked, + })), + }); + }} + /> + {t("billlines.fields.line_desc")} {t("billlines.fields.quantity")} {t("billlines.fields.actual_price")}