From 06c35a4ff82d202ee13e3fdbe9d6e393ee37bd99 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 18 Sep 2023 16:08:20 -0700 Subject: [PATCH 01/38] Add additonal query limits and restrictors for performance. --- .../job-search-select/job-search-select.component.jsx | 2 +- .../owner-search-select/owner-search-select.component.jsx | 2 +- client/src/components/owners-list/owners-list.component.jsx | 6 +++++- .../vehicle-search-select.component.jsx | 2 +- client/src/graphql/jobs.queries.js | 2 +- client/src/graphql/owners.queries.js | 2 +- client/src/graphql/vehicles.queries.js | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 180fb93dc..64ca39e07 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -33,7 +33,7 @@ const JobSearchSelect = ( useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - if (v && v !== "") callSearch(v); + if (v && v !== "" && v.length >= 3) callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); diff --git a/client/src/components/owner-search-select/owner-search-select.component.jsx b/client/src/components/owner-search-select/owner-search-select.component.jsx index 85e4d9833..c243e313e 100644 --- a/client/src/components/owner-search-select/owner-search-select.component.jsx +++ b/client/src/components/owner-search-select/owner-search-select.component.jsx @@ -21,7 +21,7 @@ const OwnerSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => { useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - callSearch(v); + if (v && v !== "" && v.length >= 3) callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); diff --git a/client/src/components/owners-list/owners-list.component.jsx b/client/src/components/owners-list/owners-list.component.jsx index 78e2c3cb3..d4c5f7e5c 100644 --- a/client/src/components/owners-list/owners-list.component.jsx +++ b/client/src/components/owners-list/owners-list.component.jsx @@ -106,7 +106,11 @@ export default function OwnersListComponent({ { - search.search = value; + if (value?.length >= 3) { + search.search = value; + } else { + delete search.search; + } history.push({ search: queryString.stringify(search) }); }} enterButton diff --git a/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx b/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx index 4d8d49894..8f187b77b 100644 --- a/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx +++ b/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx @@ -22,7 +22,7 @@ const VehicleSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => { ] = useLazyQuery(SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - callSearch(v); + if (v && v !== "" && v.length >= 3) callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 60846e2fa..ad965bd74 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1242,7 +1242,7 @@ export const SEARCH_JOBS_FOR_AUTOCOMPLETE = gql` ) { search_jobs( args: { search: $search } - limit: 50 + limit: 25 where: { _and: { converted: { _eq: $isConverted } diff --git a/client/src/graphql/owners.queries.js b/client/src/graphql/owners.queries.js index a4e5d1c80..ea0062cd5 100644 --- a/client/src/graphql/owners.queries.js +++ b/client/src/graphql/owners.queries.js @@ -36,7 +36,7 @@ export const SEARCH_OWNERS_FOR_AUTOCOMPLETE = gql` query SEARCH_OWNERS_FOR_AUTOCOMPLETE($search: String) { search_owners( args: { search: $search } - limit: 50 + limit: 25 order_by: { ownr_ln: desc_nulls_last } ) { id diff --git a/client/src/graphql/vehicles.queries.js b/client/src/graphql/vehicles.queries.js index 9df3c4238..619ff8961 100644 --- a/client/src/graphql/vehicles.queries.js +++ b/client/src/graphql/vehicles.queries.js @@ -184,7 +184,7 @@ export const SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE = gql` `; export const SEARCH_VEHICLES_FOR_AUTOCOMPLETE = gql` query SEARCH_VEHICLES_FOR_AUTOCOMPLETE($search: String) { - search_vehicles(args: { search: $search }, limit: 50) { + search_vehicles(args: { search: $search }, limit: 25) { id v_vin v_model_yr From c998e4901fad5265cc5cb0ce57a7f3e02faf3914 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 18 Sep 2023 18:25:05 -0700 Subject: [PATCH 02/38] IO-2398 Hours Sold by Estimator --- client/src/translations/en_us/common.json | 4 ++ client/src/translations/es/common.json | 4 ++ client/src/translations/fr/common.json | 4 ++ client/src/utils/TemplateConstants.js | 68 +++++++++++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 43321060f..978bc7ccd 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2565,18 +2565,22 @@ "gsr_labor_only": "Gross Sales - Labor Only", "hours_sold_detail_closed": "Hours Sold Detail - Closed", "hours_sold_detail_closed_csr": "Hours Sold Detail - Closed by CSR", + "hours_sold_detail_closed_estimator": "Hours Sold Detail - Closed by Estimator", "hours_sold_detail_closed_ins_co": "Hours Sold Detail - Closed by Source", "hours_sold_detail_closed_status": "Hours Sold Detail - Closed by Status", "hours_sold_detail_open": "Hours Sold Detail - Open", "hours_sold_detail_open_csr": "Hours Sold Detail - Open by CSR", + "hours_sold_detail_open_estimator": "Hours Sold Detail - Open by Estimator", "hours_sold_detail_open_ins_co": "Hours Sold Detail - Open by Source", "hours_sold_detail_open_status": "Hours Sold Detail - Open by Status", "hours_sold_summary_closed": "Hours Sold Summary - Closed", "hours_sold_summary_closed_csr": "Hours Sold Summary - Closed by CSR", + "hours_sold_summary_closed_estimator": "Hours Sold Summary - Closed by Estimator", "hours_sold_summary_closed_ins_co": "Hours Sold Summary - Closed by Source", "hours_sold_summary_closed_status": "Hours Sold Summary - Closed by Status", "hours_sold_summary_open": "Hours Sold Summary - Open", "hours_sold_summary_open_csr": "Hours Sold Summary - Open CSR", + "hours_sold_summary_open_estimator": "Hours Sold Summary - Open Estimator", "hours_sold_summary_open_ins_co": "Hours Sold Summary - Open by Source", "hours_sold_summary_open_status": "Hours Sold Summary - Open by Status", "job_costing_ro_csr": "Job Costing by CSR", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 11e00e638..c687b79d5 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2565,18 +2565,22 @@ "gsr_labor_only": "", "hours_sold_detail_closed": "", "hours_sold_detail_closed_csr": "", + "hours_sold_detail_closed_estimator": "", "hours_sold_detail_closed_ins_co": "", "hours_sold_detail_closed_status": "", "hours_sold_detail_open": "", "hours_sold_detail_open_csr": "", + "hours_sold_detail_open_estimator": "", "hours_sold_detail_open_ins_co": "", "hours_sold_detail_open_status": "", "hours_sold_summary_closed": "", "hours_sold_summary_closed_csr": "", + "hours_sold_summary_closed_estimator": "", "hours_sold_summary_closed_ins_co": "", "hours_sold_summary_closed_status": "", "hours_sold_summary_open": "", "hours_sold_summary_open_csr": "", + "hours_sold_summary_open_estimator": "", "hours_sold_summary_open_ins_co": "", "hours_sold_summary_open_status": "", "job_costing_ro_csr": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index c386076df..d11d96044 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2565,18 +2565,22 @@ "gsr_labor_only": "", "hours_sold_detail_closed": "", "hours_sold_detail_closed_csr": "", + "hours_sold_detail_closed_estimator": "", "hours_sold_detail_closed_ins_co": "", "hours_sold_detail_closed_status": "", "hours_sold_detail_open": "", "hours_sold_detail_open_csr": "", + "hours_sold_detail_open_estimator": "", "hours_sold_detail_open_ins_co": "", "hours_sold_detail_open_status": "", "hours_sold_summary_closed": "", "hours_sold_summary_closed_csr": "", + "hours_sold_summary_closed_estimator": "", "hours_sold_summary_closed_ins_co": "", "hours_sold_summary_closed_status": "", "hours_sold_summary_open": "", "hours_sold_summary_open_csr": "", + "hours_sold_summary_open_estimator": "", "hours_sold_summary_open_ins_co": "", "hours_sold_summary_open_status": "", "job_costing_ro_csr": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 3467027c6..cc1c4011a 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -818,6 +818,74 @@ export const TemplateList = (type, context) => { }, group: "sales", }, + hours_sold_detail_closed_estimator: { + title: i18n.t( + "reportcenter.templates.hours_sold_detail_closed_estimator" + ), + description: "", + subject: i18n.t( + "reportcenter.templates.hours_sold_detail_closed_estimator" + ), + key: "hours_sold_detail_closed_estimator", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_invoiced"), + }, + group: "sales", + }, + hours_sold_detail_open_estimator: { + title: i18n.t( + "reportcenter.templates.hours_sold_detail_open_estimator" + ), + description: "", + subject: i18n.t( + "reportcenter.templates.hours_sold_detail_open_estimator" + ), + key: "hours_sold_detail_open_estimator", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_open"), + }, + group: "sales", + }, + hours_sold_summary_closed_estimator: { + title: i18n.t( + "reportcenter.templates.hours_sold_summary_closed_estimator" + ), + description: "", + subject: i18n.t( + "reportcenter.templates.hours_sold_summary_closed_estimator" + ), + key: "hours_sold_summary_closed_estimator", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_invoiced"), + }, + group: "sales", + }, + hours_sold_summary_open_estimator: { + title: i18n.t( + "reportcenter.templates.hours_sold_summary_open_estimator" + ), + description: "", + subject: i18n.t( + "reportcenter.templates.hours_sold_summary_open_estimator" + ), + key: "hours_sold_summary_open_estimator", + //idtype: "vendor", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_invoiced"), + }, + group: "sales", + }, hours_sold_summary_open_status: { title: i18n.t( "reportcenter.templates.hours_sold_summary_open_status" From 6319fd20fa6887c5e854598b3f42b81a42640f40 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 20 Sep 2023 12:16:03 -0700 Subject: [PATCH 03/38] IO-2407 In House Invoice Audit Log correction for Invoice Number --- .../bill-enter-modal/bill-enter-modal.container.jsx | 6 +++--- client/src/graphql/bills.queries.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index d2d0d928a..d50c17433 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -37,8 +37,8 @@ const mapStateToProps = createStructuredSelector({ }); const mapDispatchToProps = (dispatch) => ({ toggleModalVisible: () => dispatch(toggleModalVisible("billEnter")), - insertAuditTrail: ({ jobid, operation }) => - dispatch(insertAuditTrail({ jobid, operation })), + insertAuditTrail: ({ jobid, billid, operation }) => + dispatch(insertAuditTrail({ jobid, billid, operation })), }); const Templates = TemplateList("job_special"); @@ -316,7 +316,7 @@ function BillEnterModalContainer({ insertAuditTrail({ jobid: values.jobid, billid: billId, - operation: AuditTrailMapping.billposted(remainingValues.invoice_number), + operation: AuditTrailMapping.billposted(r1.data.insert_bills.returning[0].invoice_number), }); if (enterAgain) { diff --git a/client/src/graphql/bills.queries.js b/client/src/graphql/bills.queries.js index 6406edfe1..07e1a3cc9 100644 --- a/client/src/graphql/bills.queries.js +++ b/client/src/graphql/bills.queries.js @@ -5,6 +5,7 @@ export const INSERT_NEW_BILL = gql` insert_bills(objects: $bill) { returning { id + invoice_number } } } From fbc622fa04408cfdd55e2aca946cb7355e84ae71 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 20 Sep 2023 14:30:53 -0700 Subject: [PATCH 04/38] IO-2363 Make Summary.Difference follow Color logic --- .../labor-allocations-table.component.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx index 3c264dafc..83f99d867 100644 --- a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx +++ b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx @@ -231,7 +231,14 @@ export function LaborAllocationsTable({ {summary.adjustments.toFixed(1)} - {summary.difference.toFixed(1)} + = 0 ? "green" : "red", + }} + > + {summary.difference.toFixed(1)} + )} From 21c53473d366c37318b0998c0a16a2d21a30ade0 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 20 Sep 2023 15:58:48 -0700 Subject: [PATCH 05/38] IO-2400 Add Color column to All Courtesy Cars --- .../courtesy-cars-list.component.jsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx index e16875af3..b2e3059f6 100644 --- a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx +++ b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx @@ -9,15 +9,15 @@ import { Table, Tooltip, } from "antd"; +import moment from "moment"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { DateTimeFormatter } from "../../utils/DateFormatter"; -import { alphaSort } from "../../utils/sorters"; -import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component"; -import moment from "moment"; import { GenerateDocument } from "../../utils/RenderTemplate"; import { TemplateList } from "../../utils/TemplateConstants"; +import { alphaSort } from "../../utils/sorters"; +import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component"; export default function CourtesyCarsList({ loading, courtesycars, refetch }) { const [state, setState] = useState({ sortedInfo: {}, @@ -115,6 +115,14 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) { sortOrder: state.sortedInfo.columnKey === "model" && state.sortedInfo.order, }, + { + title: t("courtesycars.fields.color"), + dataIndex: "color", + key: "color", + sorter: (a, b) => alphaSort(a.color, b.color), + sortOrder: + state.sortedInfo.columnKey === "color" && state.sortedInfo.order, + }, { title: t("courtesycars.fields.plate"), dataIndex: "plate", From b29d8e1912aa3b8b356978999ecd5cee056e8ae3 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 22 Sep 2023 11:34:09 -0700 Subject: [PATCH 06/38] IO-2408 Use bodyshop.timezone instead of UTCOffset in Speedprint --- client/src/utils/RenderTemplate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index f103111cf..cc58e0b78 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -1,15 +1,15 @@ import { gql } from "@apollo/client"; -import { notification } from "antd"; import jsreport from "@jsreport/browser-client"; +import { notification } from "antd"; +import axios from "axios"; import _ from "lodash"; import moment from "moment"; import { auth } from "../firebase/firebase.utils"; import { setEmailOptions } from "../redux/email/email.actions"; import { store } from "../redux/store"; import client from "../utils/GraphQLClient"; -import { TemplateList } from "./TemplateConstants"; import cleanAxios from "./CleanAxios"; -import axios from "axios"; +import { TemplateList } from "./TemplateConstants"; const server = process.env.REACT_APP_REPORTS_SERVER_URL; jsreport.serverUrl = server; @@ -255,7 +255,7 @@ export async function RenderTemplates( headerpath: `/${bodyshop.imexshopid}/header.html`, footerpath: `/${bodyshop.imexshopid}/footer.html`, bodyshop: bodyshop, - offset: moment().utcOffset(), + offset: bodyshop.timezone, }, }; From c8fb1ce30216e8224983c3ac71a19b6d5374915c Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 22 Sep 2023 11:51:41 -0700 Subject: [PATCH 07/38] IO-2408 Remove unneeded library --- client/src/utils/RenderTemplate.js | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index cc58e0b78..8cb4691fe 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -3,7 +3,6 @@ import jsreport from "@jsreport/browser-client"; import { notification } from "antd"; import axios from "axios"; import _ from "lodash"; -import moment from "moment"; import { auth } from "../firebase/firebase.utils"; import { setEmailOptions } from "../redux/email/email.actions"; import { store } from "../redux/store"; From f703ba2cf92896f44111adc63e03205b4c5bab15 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 29 Sep 2023 12:36:29 -0700 Subject: [PATCH 08/38] Disable unnecessary events for Hasura. --- hasura/metadata/tables.yaml | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 9b19c1777..701637a9c 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -4076,12 +4076,7 @@ event_triggers: - name: job_status_transition definition: - enable_manual: false - insert: - columns: '*' - update: - columns: - - status + enable_manual: true retry_conf: interval_sec: 10 num_retries: 0 @@ -4097,23 +4092,7 @@ version: 2 - name: jobs_arms definition: - enable_manual: false - update: - columns: - - actual_delivery - - scheduled_delivery - - scheduled_completion - - actual_completion - - date_scheduled - - inproduction - - clm_total - - suspended - - job_totals - - converted - - employee_body - - ro_number - - actual_in - - scheduled_in + enable_manual: true retry_conf: interval_sec: 10 num_retries: 0 From 4dd21370066d27c5ee734b1a1d8939d8e14a8ff3 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 12 Oct 2023 11:24:24 -0700 Subject: [PATCH 09/38] IO-1559 Change xml label as per Claimscorp --- server/data/claimscorp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index 50e49fd91..39475f2f8 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -67,7 +67,7 @@ exports.default = async (req, res) => { ); const claimsCorpObject = { - ClaimsCorpExport: { + DataFeed: { ShopID: bodyshops_by_pk.claimscorpid, ShopName: bodyshops_by_pk.shopname, RO: jobs.map((j) => From 05f1a9b280baa6297036ec17bf508bd5fee91f84 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 12 Oct 2023 14:54:58 -0700 Subject: [PATCH 10/38] IO-1559 Adjust count object to new field tag --- server/data/claimscorp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index 39475f2f8..9ea8341dc 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -100,7 +100,7 @@ exports.default = async (req, res) => { .end({ allowEmptyTags: true }); allxmlsToUpload.push({ - count: claimsCorpObject.ClaimsCorpExport.RO.length, + count: claimsCorpObject.DataFeed.RO.length, xml: ret, filename: `${bodyshop.claimscorpid}-MIS-${moment().format( "YYYYMMDDTHHMMss" From 6efa08fee366bc362a6f71c9ba7012b3819a0084 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 16 Oct 2023 09:34:53 -0700 Subject: [PATCH 11/38] IO-2411 filter inactive employees on prod. print button --- .../production-list-print.component.jsx | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/client/src/components/production-list-table/production-list-print.component.jsx b/client/src/components/production-list-table/production-list-print.component.jsx index 4e31b33d0..547819061 100644 --- a/client/src/components/production-list-table/production-list-print.component.jsx +++ b/client/src/components/production-list-table/production-list-print.component.jsx @@ -55,25 +55,27 @@ export function ProductionListPrint({ bodyshop }) { - {bodyshop.employees.map((e) => ( - { - setLoading(true); - await GenerateDocument( - { - name: production_by_technician_one.key, - variables: { id: e.id }, - }, - {}, - "p" - ); - setLoading(false); - }} - > - {e.first_name} {e.last_name} - - ))} + {bodyshop.employees + .filter((e) => e.active) + .map((e) => ( + { + setLoading(true); + await GenerateDocument( + { + name: production_by_technician_one.key, + variables: { id: e.id }, + }, + {}, + "p" + ); + setLoading(false); + }} + > + {e.first_name} {e.last_name} + + ))} Date: Mon, 16 Oct 2023 10:24:16 -0700 Subject: [PATCH 12/38] Fix search select issues. --- .../job-search-select/job-search-select.component.jsx | 4 +++- .../owner-search-select/owner-search-select.component.jsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 64ca39e07..0ec418bca 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -33,7 +33,9 @@ const JobSearchSelect = ( useLazyQuery(SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - if (v && v !== "" && v.length >= 3) callSearch(v); + console.log(v); + if (v && v.variables?.search !== "" && v.variables.search.length >= 2) + callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); diff --git a/client/src/components/owner-search-select/owner-search-select.component.jsx b/client/src/components/owner-search-select/owner-search-select.component.jsx index c243e313e..a9b956568 100644 --- a/client/src/components/owner-search-select/owner-search-select.component.jsx +++ b/client/src/components/owner-search-select/owner-search-select.component.jsx @@ -21,7 +21,8 @@ const OwnerSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => { useLazyQuery(SEARCH_OWNERS_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - if (v && v !== "" && v.length >= 3) callSearch(v); + if (v && v.variables?.search !== "" && v.variables.search.length >= 2) + callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); From 17f86251089a140718c02ba3cf093e40fd6a3ce5 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 16 Oct 2023 11:40:23 -0700 Subject: [PATCH 13/38] IO-2414 add null handling in case employee records are null. --- .../production-list-columns.data.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/components/production-list-columns/production-list-columns.data.js b/client/src/components/production-list-columns/production-list-columns.data.js index 7d122200d..a93e0f3e6 100644 --- a/client/src/components/production-list-columns/production-list-columns.data.js +++ b/client/src/components/production-list-columns/production-list-columns.data.js @@ -455,8 +455,8 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { state.sortedInfo.order, sorter: (a, b) => alphaSort( - bodyshop.employees.find((e) => e.id === a.employee_body)?.first_name, - bodyshop.employees.find((e) => e.id === b.employee_body)?.first_name + bodyshop.employees?.find((e) => e.id === a.employee_body)?.first_name, + bodyshop.employees?.find((e) => e.id === b.employee_body)?.first_name ), render: (text, record) => ( { state.sortedInfo.order, sorter: (a, b) => alphaSort( - bodyshop.employees.find((e) => e.id === a.employee_prep)?.first_name, - bodyshop.employees.find((e) => e.id === b.employee_prep)?.first_name + bodyshop.employees?.find((e) => e.id === a.employee_prep)?.first_name, + bodyshop.employees?.find((e) => e.id === b.employee_prep)?.first_name ), render: (text, record) => ( { state.sortedInfo.columnKey === "employee_csr" && state.sortedInfo.order, sorter: (a, b) => alphaSort( - bodyshop.employees.find((e) => e.id === a.employee_csr)?.first_name, - bodyshop.employees.find((e) => e.id === b.employee_csr)?.first_name + bodyshop.employees?.find((e) => e.id === a.employee_csr)?.first_name, + bodyshop.employees?.find((e) => e.id === b.employee_csr)?.first_name ), render: (text, record) => ( @@ -508,9 +508,9 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { state.sortedInfo.order, sorter: (a, b) => alphaSort( - bodyshop.employees.find((e) => e.id === a.employee_refinish) + bodyshop.employees?.find((e) => e.id === a.employee_refinish) ?.first_name, - bodyshop.employees.find((e) => e.id === b.employee_refinish) + bodyshop.employees?.find((e) => e.id === b.employee_refinish) ?.first_name ), render: (text, record) => ( From ffebbe3b2ab8e61740dec67210ac00aa25c909a4 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 16 Oct 2023 12:00:11 -0700 Subject: [PATCH 14/38] IO-2401 Add prevention of duplicate chat creation by adding loading tracking. --- .../chat-open-button/chat-open-button.component.jsx | 12 ++++++++++-- client/src/redux/messaging/messaging.reducer.js | 7 +++++++ client/src/redux/messaging/messaging.selectors.js | 5 +++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/client/src/components/chat-open-button/chat-open-button.component.jsx b/client/src/components/chat-open-button/chat-open-button.component.jsx index ce357a962..71c037002 100644 --- a/client/src/components/chat-open-button/chat-open-button.component.jsx +++ b/client/src/components/chat-open-button/chat-open-button.component.jsx @@ -8,15 +8,23 @@ import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import { searchingForConversation } from "../../redux/messaging/messaging.selectors"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, + searchingForConversation: searchingForConversation, }); const mapDispatchToProps = (dispatch) => ({ openChatByPhone: (phone) => dispatch(openChatByPhone(phone)), }); -export function ChatOpenButton({ bodyshop, phone, jobid, openChatByPhone }) { +export function ChatOpenButton({ + bodyshop, + searchingForConversation, + phone, + jobid, + openChatByPhone, +}) { const { t } = useTranslation(); if (!phone) return <>; @@ -29,7 +37,7 @@ export function ChatOpenButton({ bodyshop, phone, jobid, openChatByPhone }) { onClick={(e) => { e.stopPropagation(); const p = parsePhoneNumber(phone, "CA"); - + if (searchingForConversation) return; //This is to prevent finding the same thing twice. if (p && p.isValid()) { openChatByPhone({ phone_num: p.formatInternational(), jobid: jobid }); } else { diff --git a/client/src/redux/messaging/messaging.reducer.js b/client/src/redux/messaging/messaging.reducer.js index e43bad872..d70048c5b 100644 --- a/client/src/redux/messaging/messaging.reducer.js +++ b/client/src/redux/messaging/messaging.reducer.js @@ -6,6 +6,7 @@ const INITIAL_STATE = { isSending: false, error: null, message: null, + searchingForConversation: false, }; const messagingReducer = (state = INITIAL_STATE, action) => { @@ -17,10 +18,16 @@ const messagingReducer = (state = INITIAL_STATE, action) => { ...state, visible: !state.visible, }; + case MessagingActionTypes.OPEN_CHAT_BY_PHONE: + return { + ...state, + searchingForConversation: true, + }; case MessagingActionTypes.SET_SELECTED_CONVERSATION: return { ...state, visible: true, + searchingForConversation: false, selectedConversationId: action.payload, }; case MessagingActionTypes.SEND_MESSAGE: diff --git a/client/src/redux/messaging/messaging.selectors.js b/client/src/redux/messaging/messaging.selectors.js index c46c20d74..84038cee7 100644 --- a/client/src/redux/messaging/messaging.selectors.js +++ b/client/src/redux/messaging/messaging.selectors.js @@ -26,3 +26,8 @@ export const selectMessage = createSelector( [selectMessaging], (messaging) => messaging.message ); + +export const searchingForConversation = createSelector( + [selectMessaging], + (messaging) => messaging.searchingForConversation +); From 9114abd3ef0bb190dadb2812e6a0d8235cca714a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 18 Oct 2023 10:48:47 -0700 Subject: [PATCH 15/38] IO-1559 Add in extra required tag --- server/data/claimscorp.js | 49 ++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index 9ea8341dc..a854ff84f 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -62,22 +62,24 @@ exports.default = async (req, res) => { start: start ? moment(start).startOf("day") : moment().subtract(5, "days").startOf("day"), - ...(end && { end: moment(end).startOf("day") }), + ...(end && { end: moment(end).endOf("day") }), } ); const claimsCorpObject = { DataFeed: { - ShopID: bodyshops_by_pk.claimscorpid, - ShopName: bodyshops_by_pk.shopname, - RO: jobs.map((j) => - CreateRepairOrderTag( - { ...j, bodyshop: bodyshops_by_pk }, - function ({ job, error }) { - erroredJobs.push({ job: job, error: error.toString() }); - } - ) - ), + ShopInfo: { + ShopID: bodyshops_by_pk.claimscorpid, + ShopName: bodyshops_by_pk.shopname, + RO: jobs.map((j) => + CreateRepairOrderTag( + { ...j, bodyshop: bodyshops_by_pk }, + function ({ job, error }) { + erroredJobs.push({ job: job, error: error.toString() }); + } + ) + ), + }, }, }; @@ -100,7 +102,7 @@ exports.default = async (req, res) => { .end({ allowEmptyTags: true }); allxmlsToUpload.push({ - count: claimsCorpObject.DataFeed.RO.length, + count: claimsCorpObject.DataFeed.ShopInfo.RO.length, xml: ret, filename: `${bodyshop.claimscorpid}-MIS-${moment().format( "YYYYMMDDTHHMMss" @@ -261,8 +263,8 @@ const CreateRepairOrderTag = (job, errorCallback) => { VIN: job.v_vin || "", }, Carrier: { - InsuranceCo: job.ins_co_nm || "", - CompanyName: job.ins_co_nm || "", + UniqueID: job.ins_co_nm || "", + InsuranceCompany: job.ins_co_nm || "", }, Claim: job.clm_no || "", Contacts: { @@ -279,7 +281,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { : "", Phone1: "", Phone2: "", - EstimatorName: `${job.est_ct_ln ? job.est_ct_ln : ""}${ + Estimator: `${job.est_ct_ln ? job.est_ct_ln : ""}${ job.est_ct_ln ? ", " : "" }${job.est_ct_fn ? job.est_ct_fn : ""}`, BodyTechnician: job.employee_body_rel @@ -337,7 +339,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { .tz(job.bodyshop.timezone) .format(AhDateFormat)) || "", - StartDate: job.date_repairstarted + DateStart: job.date_repairstarted ? (job.date_repairstarted && moment(job.date_repairstarted) .tz(job.bodyshop.timezone) @@ -392,9 +394,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { .add(Dinero(job.job_totals.rates.lad.total)) .add(Dinero(job.job_totals.rates.las.total)) .toFormat(CCDineroFormat), - Refinish: Dinero(job.job_totals.rates.lar.total).toFormat( - CCDineroFormat - ), + Paint: Dinero(job.job_totals.rates.lar.total).toFormat(CCDineroFormat), Prep: Dinero().toFormat(CCDineroFormat), Frame: Dinero(job.job_totals.rates.laf.total).toFormat(CCDineroFormat), Mechanical: Dinero(job.job_totals.rates.lam.total).toFormat( @@ -446,6 +446,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { Towing: Dinero(job.job_totals.additional.towing).toFormat( CCDineroFormat ), + Storage: "0.00", Rental: job.job_totals.additional.additionalCostItems.includes( "ATS Amount" @@ -486,11 +487,11 @@ const CreateRepairOrderTag = (job, errorCallback) => { .toFixed(2), Paint: job.job_totals.rates.lar.hours.toFixed(2), Prep: "0.00", - FrameHours: job.job_totals.rates.laf.hours.toFixed(2), - MechanicalHours: job.job_totals.rates.lam.hours.toFixed(2), - GlassHours: job.job_totals.rates.lag.hours.toFixed(2), - ElectricalHours: job.job_totals.rates.lae.hours.toFixed(2), - DetailHours: detailAdjustments.hours, + Frame: job.job_totals.rates.laf.hours.toFixed(2), + Mech: job.job_totals.rates.lam.hours.toFixed(2), + Glass: job.job_totals.rates.lag.hours.toFixed(2), + Elec: job.job_totals.rates.lae.hours.toFixed(2), + Detail: detailAdjustments.hours, Reassem: "0.00", Other: ( job.job_totals.rates.la1.hours + From 60a0222dd0851331c429b769374d723f60f98ebf Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 18 Oct 2023 10:55:08 -0700 Subject: [PATCH 16/38] IO-2416 Filter out "" from ClaimsCorp and Autohouse get shop queries --- server/data/autohouse.js | 2 +- server/graphql-client/queries.js | 269 ++++++++++++------------------- 2 files changed, 106 insertions(+), 165 deletions(-) diff --git a/server/data/autohouse.js b/server/data/autohouse.js index c0af1cef3..3ae74d6db 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -62,7 +62,7 @@ exports.default = async (req, res) => { start: start ? moment(start).startOf("day") : moment().subtract(5, "days").startOf("day"), - ...(end && { end: moment(end).startOf("day") }), + ...(end && { end: moment(end).endOf("day") }), } ); diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index eb71fae42..a27ac8bd0 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -1,16 +1,12 @@ exports.FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID = ` -query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID( - $mssid: String! - $phone: String! - ) { +query FIND_BODYSHOP_BY_MESSAGING_SERVICE_SID($mssid: String!, $phone: String!) { bodyshops(where: { messagingservicesid: { _eq: $mssid } }) { id conversations(where: { phone_num: { _eq: $phone } }) { id } } - } -`; + }`; exports.GET_JOB_BY_RO_NUMBER = ` query GET_JOB_BY_RO_NUMBER($ro_number: String!) { @@ -20,8 +16,7 @@ exports.GET_JOB_BY_RO_NUMBER = ` id } } - } -`; + }`; exports.INSERT_NEW_PAYMENT = ` mutation INSERT_NEW_PAYMENT($paymentInput: [payments_insert_input!]!) { @@ -30,28 +25,23 @@ exports.INSERT_NEW_PAYMENT = ` id } } - } -`; + }`; exports.INSERT_PAYMENT_RESPONSE = ` - mutation INSERT_PAYMENT_RESPONSE( - $paymentResponse: [payment_response_insert_input!]! - ) { + mutation INSERT_PAYMENT_RESPONSE($paymentResponse: [payment_response_insert_input!]!) { insert_payment_response(objects: $paymentResponse) { returning { id } } - } -`; + }`; exports.UNARCHIVE_CONVERSATION = ` mutation UNARCHIVE_CONVERSATION($id: uuid!) { update_conversations_by_pk(pk_columns: {id: $id}, _set: {archived: false}) { id } -} -`; +}`; exports.INSERT_NEW_JOB_LINE = ` mutation INSERT_NEW_JOB_LINE($lineInput: [joblines_insert_input!]!) { @@ -60,8 +50,7 @@ exports.INSERT_NEW_JOB_LINE = ` id } } - } -`; + }`; exports.UPDATE_JOB_LINE = ` mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) { @@ -82,8 +71,7 @@ exports.UPDATE_JOB_LINE = ` removed } } - } -`; + }`; exports.RECEIVE_MESSAGE = ` mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) { @@ -92,7 +80,7 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) { conversation { id archived - bodyshop{ + bodyshop { imexshopid } created_at @@ -114,10 +102,7 @@ mutation RECEIVE_MESSAGE($msg: [messages_insert_input!]!) { userid } } -} - - - `; +}`; exports.INSERT_MESSAGE = ` mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) { @@ -130,7 +115,7 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) conversation { id archived - bodyshop{ + bodyshop { imexshopid } created_at @@ -152,10 +137,7 @@ mutation INSERT_MESSAGE($msg: [messages_insert_input!]!, $conversationid: uuid!) userid } } -} - - - `; +}`; exports.UPDATE_MESSAGE_STATUS = ` mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) { @@ -164,8 +146,7 @@ mutation UPDATE_MESSAGE($msid: String!, $fields: messages_set_input!) { id } } - } - `; + }`; exports.QUERY_JOBS_FOR_RECEIVABLES_EXPORT = ` query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { @@ -228,7 +209,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { owner { accountingid } - joblines(where:{removed: {_eq:false}}) { + joblines(where:{removed: {_eq:false}}) { id line_desc part_type @@ -257,8 +238,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { timezone md_ro_statuses } -} - `; +}`; exports.QUERY_JOBS_FOR_CDK_EXPORT = ` query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) { @@ -318,19 +298,19 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) { v_make_desc v_color ca_customer_gst - bodyshop { - id - md_ro_statuses - md_responsibility_centers - accountingconfig - cdk_dealerid - cdk_configuration - timezone - } + bodyshop { + id + md_ro_statuses + md_responsibility_centers + accountingconfig + cdk_dealerid + cdk_configuration + timezone + } owner { accountingid } - joblines(where:{removed: {_eq:false}}) { + joblines(where:{removed: {_eq:false}}) { id line_desc part_type @@ -345,9 +325,7 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) { prt_dsmk_p } } - -} - `; +}`; exports.QUERY_JOBS_FOR_PBS_EXPORT = ` query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) { @@ -410,24 +388,24 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) { v_make_desc v_color ca_customer_gst - vehicle{ + vehicle { v_trimcode v_makecode } - bodyshop { - id - md_ro_statuses - md_responsibility_centers - accountingconfig - pbs_serialnumber - pbs_configuration - timezone - } + bodyshop { + id + md_ro_statuses + md_responsibility_centers + accountingconfig + pbs_serialnumber + pbs_configuration + timezone + } owner { id accountingid } - joblines(where:{removed: {_eq:false}}) { + joblines(where:{removed: {_eq:false}}) { id line_desc part_type @@ -444,9 +422,7 @@ query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) { line_ref } } - -} - `; +}`; exports.QUERY_BILLS_FOR_PAYABLES_EXPORT = ` query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) { @@ -490,18 +466,17 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) { due_date } } -} - `; +}`; exports.QUERY_PAYMENTS_FOR_EXPORT = ` - query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!) - { bodyshops(where: {associations: {active: {_eq: true}}}) { - id - md_responsibility_centers - accountingconfig - timezone - md_ins_cos - } + query QUERY_PAYMENTS_FOR_EXPORT($payments: [uuid!]!) { + bodyshops(where: {associations: {active: {_eq: true}}}) { + id + md_responsibility_centers + accountingconfig + timezone + md_ins_cos + } payments(where: {id: {_in: $payments}}) { id created_at @@ -509,15 +484,14 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = ` job { id ro_number - ownerid - ownr_ln - ownr_fn - ownr_addr1 - ownr_addr2 - ownr_zip - ownr_city - ownr_st - + ownerid + ownr_ln + ownr_fn + ownr_addr1 + ownr_addr2 + ownr_zip + ownr_city + ownr_st ins_co_nm owner{ accountingid @@ -525,7 +499,7 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = ` ownr_fn ownr_ln ownr_co_nm - bodyshop{ + bodyshop { accountingconfig md_responsibility_centers md_ins_cos @@ -542,8 +516,7 @@ exports.QUERY_PAYMENTS_FOR_EXPORT = ` paymentnum date } - } - `; + }`; exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: timestamptz!, $jobId: uuid!) { jobs_by_pk(id: $jobId) { @@ -643,8 +616,7 @@ exports.QUERY_UPCOMING_APPOINTMENTS = `query QUERY_UPCOMING_APPOINTMENTS($now: t } } } -} -`; +}`; exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employeeId: String!) { employees(where: {_and: {shopid: {_eq: $shopId}, employee_number: {_eq: $employeeId}}}) { @@ -835,8 +807,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop totalliquidcost } } -} -`; +}`; exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) { bodyshops_by_pk(id: $bodyshopid){ @@ -1008,8 +979,7 @@ exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodysh totalliquidcost } } -} -`; +}`; exports.ENTEGRAL_EXPORT = ` query ENTEGRAL_EXPORT($bodyshopid: uuid!) { @@ -1098,8 +1068,7 @@ query ENTEGRAL_EXPORT($bodyshopid: uuid!) { cieca_ttl adjustment_bottom_line } -} -`; +}`; exports.UPDATE_JOB = ` mutation UPDATE_JOB($jobId: uuid!, $job: jobs_set_input!) { @@ -1114,8 +1083,7 @@ exports.UPDATE_JOB = ` lbr_adjustments } } - } -`; + }`; exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) { jobs_by_pk(id: $id) { @@ -1127,7 +1095,7 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) { kmout comment referral_source - referral_source_extra + referral_source_extra unit_number po_number special_coverage_policy @@ -1163,10 +1131,10 @@ exports.GET_JOB_BY_PK = `query GET_JOB_BY_PK($id: uuid!) { est_ct_fn shopid est_ct_ln -vehicle{ - id - notes -} + vehicle { + id + notes + } est_ph1 est_ea selling_dealer @@ -1526,19 +1494,17 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT use_paint_scale_data } } -} -`; +}`; exports.INSERT_IOEVENT = ` mutation INSERT_IOEVENT($event: ioevents_insert_input!) { insert_ioevents_one(object: $event) { id } -} -`; +}`; exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS { - bodyshops(where: {autohouseid: {_is_null: false}}){ - id + bodyshops(where: {autohouseid: {_is_null: false}, _or: {autohouseid: {_neq: ""}}}){ + id shopname address1 city @@ -1554,11 +1520,10 @@ exports.GET_AUTOHOUSE_SHOPS = `query GET_AUTOHOUSE_SHOPS { imexshopid timezone } -} -`; +}`; exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS { - bodyshops(where: {claimscorpid: {_is_null: false}}){ + bodyshops(where: {claimscorpid: {_is_null: false}, _or: {claimscorpid: {_neq: ""}}}){ id shopname address1 @@ -1575,12 +1540,11 @@ exports.GET_CLAIMSCORP_SHOPS = `query GET_CLAIMSCORP_SHOPS { imexshopid timezone } -} -`; +}`; exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS { - bodyshops(where: {entegral_id: {_is_null: false}}){ - id + bodyshops(where: {entegral_id: {_is_null: false}, _or: {entegral_id: {_neq: ""}}}){ + id shopname address1 city @@ -1596,22 +1560,19 @@ exports.GET_ENTEGRAL_SHOPS = `query GET_AUTOHOUSE_SHOPS { timezone features } -} -`; +}`; exports.DELETE_ALL_DMS_VEHICLES = `mutation DELETE_ALL_DMS_VEHICLES{ delete_dms_vehicles(where: {}) { affected_rows } -} -`; +}`; + exports.INSERT_DMS_VEHICLES = `mutation INSERT_DMS_VEHICLES($vehicles: [dms_vehicles_insert_input!]!) { insert_dms_vehicles(objects: $vehicles) { affected_rows } -} - -`; +}`; exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { jobs_by_pk(id: $id) { @@ -1728,8 +1689,7 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { unq_seq } } -} -`; +}`; exports.GET_QBO_AUTH = `query GET_QBO_AUTH($email: String!) { associations(where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){ @@ -1743,15 +1703,13 @@ exports.SET_QBO_AUTH_WITH_REALM = `mutation SET_QBO_AUTH($email: String!, $qbo_a update_associations(_set: {qbo_auth: $qbo_auth, qbo_realmId: $qbo_realmId}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){ affected_rows } -} -`; +}`; exports.SET_QBO_AUTH = `mutation SET_QBO_AUTH($email: String!, $qbo_auth: jsonb!) { update_associations(_set: {qbo_auth: $qbo_auth}, where: {_and: {active: {_eq: true}, useremail: {_eq: $email}}}){ affected_rows } -} -`; +}`; exports.MARK_JOB_EXPORTED = ` mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog_insert_input!, $bill: bills_set_input!) { @@ -1770,10 +1728,9 @@ mutation MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $log: exportlog id } update_bills(where:{jobid:{_eq :$jobId}}, _set:$bill){ - affected_rows + affected_rows } -} -`; +}`; exports.MARK_BILLS_EXPORTED = ` mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) { @@ -1785,28 +1742,25 @@ mutation UPDATE_BILLS($billids: [uuid!]!, $bill: bills_set_input!, $logs: [expor } } insert_exportlog(objects: $logs) { -returning{ - id -} + returning{ + id + } } -} -`; +}`; exports.INSERT_EXPORT_LOG = ` mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) { insert_exportlog_one(object: $log) { id } -} -`; +}`; exports.QUERY_EXISTING_TRANSITION = ` mutation INSERT_EXPORT_LOG($log: exportlog_insert_input!) { insert_exportlog_one(object: $log) { id } -} -`; +}`; exports.UPDATE_OLD_TRANSITION = `mutation UPDATE_OLD_TRANSITION($jobid: uuid!, $existingTransition: transitions_set_input!){ update_transitions(where:{jobid:{_eq:$jobid}, end:{_is_null:true @@ -1830,9 +1784,7 @@ exports.INSERT_NEW_TRANSITION = `mutation INSERT_NEW_TRANSITION($newTransition: update_transitions(where: {id: {_eq: $oldTransitionId}}, _set: {duration: $duration}) { affected_rows } -} - -`; +}`; exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!]!) { jobs(where: {ro_number: {_in: $roNumbers}}) { @@ -1842,9 +1794,7 @@ exports.QUERY_JOB_ID_MIXDATA = `query QUERY_JOB_ID_MIXDATA($roNumbers: [String!] id } } -} - -`; +}`; exports.QBO_MARK_JOB_EXPORTED = ` mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exportlog_insert_input!]!) { @@ -1857,9 +1807,8 @@ mutation QBO_MARK_JOB_EXPORTED($jobId: uuid!, $job: jobs_set_input!, $logs: [exp } } -} +}`; -`; exports.QBO_MARK_BILL_EXPORTED = ` mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: [exportlog_insert_input!]!) { insert_exportlog(objects: $logs) { @@ -1870,9 +1819,7 @@ mutation QBO_MARK_BILL_EXPORTED($billId: uuid!, $bill: bills_set_input!, $logs: id } } -} - -`; +}`; exports.QBO_MARK_PAYMENT_EXPORTED = ` mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_input!, $logs: [exportlog_insert_input!]!) { @@ -1887,19 +1834,17 @@ mutation QBO_MARK_PAYMENT_EXPORTED($paymentId: uuid!, $payment: payments_set_inp }`; exports.INSERT_EXPORT_LOG = ` - mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) { - insert_exportlog(objects: $logs) { - affected_rows - } +mutation INSERT_EXPORT_LOG($logs: [exportlog_insert_input!]!) { + insert_exportlog(objects: $logs) { + affected_rows } -`; +}`; exports.INSERT_EMAIL_AUDIT = `mutation INSERT_EMAIL_AUDIT($email: email_audit_trail_insert_input!) { insert_email_audit_trail_one(object: $email) { id } -} -`; +}`; exports.DELETE_MEDIA_DOCUMENTS = ` mutation DELETE_DOCUMENTS($ids: [uuid!]!) { @@ -1908,8 +1853,7 @@ mutation DELETE_DOCUMENTS($ids: [uuid!]!) { id } } -} -`; +}`; exports.UPDATE_EMAIL_AUDIT = ` mutation ($sesid: String!, $status: String, $context: jsonb) { @@ -1961,8 +1905,7 @@ query GET_PBS_AP_ALLOCATIONS($billids: [uuid!]) { quantity } } -} -`; +}`; exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) { jobs_by_pk(id: $id) { @@ -1976,8 +1919,7 @@ exports.QUERY_PARTS_SCAN = `query QUERY_PARTS_SCAN ($id: uuid!) { critical } } -} -`; +}`; exports.UPDATE_PARTS_CRITICAL = `mutation UPDATE_PARTS_CRITICAL ($IdsToMarkCritical:[uuid!]!, $jobid: uuid!){ critical: update_joblines(where:{id:{_in:$IdsToMarkCritical}}, _set:{critical: true}){ @@ -1993,5 +1935,4 @@ exports.ACTIVE_SHOP_BY_USER = `query ACTIVE_SHOP_BY_USER($user: String) { id shopid } -} -`; +}`; From 802dd696f453118470b2945633adb53bd6e180d8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 19 Oct 2023 09:20:29 -0700 Subject: [PATCH 17/38] IO-2418 Adjust latest bill amount --- .../job-lines-bill-reference.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/job-lines-bill-reference/job-lines-bill-reference.component.jsx b/client/src/components/job-lines-bill-reference/job-lines-bill-reference.component.jsx index 7866d88fa..e3b2ea5ae 100644 --- a/client/src/components/job-lines-bill-reference/job-lines-bill-reference.component.jsx +++ b/client/src/components/job-lines-bill-reference/job-lines-bill-reference.component.jsx @@ -8,7 +8,7 @@ export default function JobLinesBillRefernece({ jobline }) { return (
{subletRequired && } - {`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${ + {`${billLine.actual_price.toFixed(2)} x ${billLine.quantity} (${ billLine.bill.vendor.name } #${billLine.bill.invoice_number})`}
From 02fd8097a853af98fc3f8c97e5f820f77d207528 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 19 Oct 2023 09:30:29 -0700 Subject: [PATCH 18/38] IO-2419 Thumbnails being emailed instead of Full Size Image --- client/src/components/email-overlay/email-overlay.container.jsx | 2 +- .../jobs-documents-local-gallery.external.component.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/email-overlay/email-overlay.container.jsx b/client/src/components/email-overlay/email-overlay.container.jsx index 6c469c2d9..706fa6211 100644 --- a/client/src/components/email-overlay/email-overlay.container.jsx +++ b/client/src/components/email-overlay/email-overlay.container.jsx @@ -109,7 +109,7 @@ export function EmailOverlayContainer({ ] : []), ], - media: selectedMedia.filter((m) => m.isSelected).map((m) => m.src), + media: selectedMedia.filter((m) => m.isSelected).map((m) => m.fullsize), //attachments, }); notification["success"]({ message: t("emails.successes.sent") }); diff --git a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.external.component.jsx b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.external.component.jsx index ce8622713..19e18be1e 100644 --- a/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.external.component.jsx +++ b/client/src/components/jobs-documents-local-gallery/jobs-documents-local-gallery.external.component.jsx @@ -52,7 +52,7 @@ function JobDocumentsLocalGalleryExternal({ val.type.mime && val.type.mime.startsWith("image") ) { - acc.push({ ...val, src: val.thumbnail }); + acc.push({ ...val, src: val.thumbnail, fullsize: val.src }); } return acc; }, []) From 2d2190e4fa91129b3d90550700c44cd31a3aad94 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 19 Oct 2023 09:34:35 -0700 Subject: [PATCH 19/38] Add refetch of job when posting bill. --- .../bill-enter-modal/bill-enter-modal.container.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx index d50c17433..617b9e603 100644 --- a/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx +++ b/client/src/components/bill-enter-modal/bill-enter-modal.container.jsx @@ -143,7 +143,7 @@ function BillEnterModalContainer({ }, ], }, - refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID"], + refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID", "GET_JOB_BY_PK"], }); const adjKeys = Object.keys(adjustmentsToInsert); @@ -316,7 +316,9 @@ function BillEnterModalContainer({ insertAuditTrail({ jobid: values.jobid, billid: billId, - operation: AuditTrailMapping.billposted(r1.data.insert_bills.returning[0].invoice_number), + operation: AuditTrailMapping.billposted( + r1.data.insert_bills.returning[0].invoice_number + ), }); if (enterAgain) { From 5b29aec14ba07e319eedb70c0c32d7384aa11f74 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 19 Oct 2023 15:17:22 -0700 Subject: [PATCH 20/38] Resolve vehicle search select issue. --- .../vehicle-search-select.component.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx b/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx index 8f187b77b..7cc506ed3 100644 --- a/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx +++ b/client/src/components/vehicle-search-select/vehicle-search-select.component.jsx @@ -16,13 +16,12 @@ const VehicleSearchSelect = ({ value, onChange, onBlur, disabled }, ref) => { SEARCH_VEHICLES_FOR_AUTOCOMPLETE ); - const [ - callIdSearch, - { loading: idLoading, error: idError, data: idData }, - ] = useLazyQuery(SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE); + const [callIdSearch, { loading: idLoading, error: idError, data: idData }] = + useLazyQuery(SEARCH_VEHICLES_BY_ID_FOR_AUTOCOMPLETE); const executeSearch = (v) => { - if (v && v !== "" && v.length >= 3) callSearch(v); + if (v && v.variables?.search !== "" && v.variables.search.length >= 2) + callSearch(v); }; const debouncedExecuteSearch = _.debounce(executeSearch, 500); From c0086600234482c409673692dc3aebebd63cb6a1 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 20 Oct 2023 08:50:31 -0700 Subject: [PATCH 21/38] Resolve error on multiple conversations found saga. --- client/src/redux/messaging/messaging.sagas.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/redux/messaging/messaging.sagas.js b/client/src/redux/messaging/messaging.sagas.js index f2684a171..9016047aa 100644 --- a/client/src/redux/messaging/messaging.sagas.js +++ b/client/src/redux/messaging/messaging.sagas.js @@ -4,7 +4,7 @@ import { all, call, put, select, takeLatest } from "redux-saga/effects"; import { logImEXEvent } from "../../firebase/firebase.utils"; import { CONVERSATION_ID_BY_PHONE, - CREATE_CONVERSATION + CREATE_CONVERSATION, } from "../../graphql/conversations.queries"; import { INSERT_CONVERSATION_TAG } from "../../graphql/job-conversations.queries"; import client from "../../utils/GraphQLClient"; @@ -12,7 +12,7 @@ import { selectBodyshop } from "../user/user.selectors"; import { sendMessageFailure, sendMessageSuccess, - setSelectedConversation + setSelectedConversation, } from "./messaging.actions"; import MessagingActionTypes from "./messaging.types"; @@ -79,6 +79,7 @@ export function* openChatByPhone({ payload }) { }); } else { console.log("ERROR: Multiple conversations found. "); + yield put(setSelectedConversation(null)); } } catch (error) { console.log("Error in sendMessage saga.", error); From 7825aa412256f84739277a6a851a80c14e3ed4bf Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 20 Oct 2023 13:55:21 -0700 Subject: [PATCH 22/38] IO-2420 Prefered Vendor for Bill Entry --- client/src/components/bill-form/bill-form.component.jsx | 2 ++ client/src/components/bill-form/bill-form.container.jsx | 9 +++++---- client/src/graphql/jobs-lines.queries.js | 1 + client/src/graphql/vendors.queries.js | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/components/bill-form/bill-form.component.jsx b/client/src/components/bill-form/bill-form.component.jsx index 0fa28359a..44b8cd815 100644 --- a/client/src/components/bill-form/bill-form.component.jsx +++ b/client/src/components/bill-form/bill-form.component.jsx @@ -50,6 +50,7 @@ export function BillFormComponent({ job, loadOutstandingReturns, loadInventory, + preferredMake, }) { const { t } = useTranslation(); const client = useApolloClient(); @@ -185,6 +186,7 @@ export function BillFormComponent({ diff --git a/client/src/components/bill-form/bill-form.container.jsx b/client/src/components/bill-form/bill-form.container.jsx index 07a70e4c5..d77e0d29c 100644 --- a/client/src/components/bill-form/bill-form.container.jsx +++ b/client/src/components/bill-form/bill-form.container.jsx @@ -1,16 +1,16 @@ import { useLazyQuery, useQuery } from "@apollo/client"; +import { useTreatments } from "@splitsoftware/splitio-react"; import React from "react"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { QUERY_OUTSTANDING_INVENTORY } from "../../graphql/inventory.queries"; import { GET_JOB_LINES_TO_ENTER_BILL } from "../../graphql/jobs-lines.queries"; +import { QUERY_UNRECEIVED_LINES } from "../../graphql/parts-orders.queries"; import { SEARCH_VENDOR_AUTOCOMPLETE } from "../../graphql/vendors.queries"; import { selectBodyshop } from "../../redux/user/user.selectors"; -import BillFormComponent from "./bill-form.component"; import BillCmdReturnsTableComponent from "../bill-cm-returns-table/bill-cm-returns-table.component"; -import { QUERY_UNRECEIVED_LINES } from "../../graphql/parts-orders.queries"; import BillInventoryTable from "../bill-inventory-table/bill-inventory-table.component"; -import { QUERY_OUTSTANDING_INVENTORY } from "../../graphql/inventory.queries"; -import { useTreatments } from "@splitsoftware/splitio-react"; +import BillFormComponent from "./bill-form.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -59,6 +59,7 @@ export function BillFormContainer({ disableInvNumber={disableInvNumber} loadOutstandingReturns={loadOutstandingReturns} loadInventory={loadInventory} + preferredMake={lineData ? lineData.jobs_by_pk.v_make_desc : null} /> {!billEdit && ( Date: Mon, 23 Oct 2023 12:32:32 -0700 Subject: [PATCH 23/38] IO-2419 Correct for Cloudinary to include fullsize on send --- .../jobs-documents-gallery.external.component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.external.component.jsx b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.external.component.jsx index 2ff912930..27774f5a8 100644 --- a/client/src/components/jobs-documents-gallery/jobs-documents-gallery.external.component.jsx +++ b/client/src/components/jobs-documents-gallery/jobs-documents-gallery.external.component.jsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import { Gallery } from "react-grid-gallery"; import { useTranslation } from "react-i18next"; -import { GenerateThumbUrl } from "./job-documents.utility"; +import { GenerateSrcUrl, GenerateThumbUrl } from "./job-documents.utility"; function JobsDocumentGalleryExternal({ data, @@ -15,7 +15,7 @@ function JobsDocumentGalleryExternal({ let documents = data.reduce((acc, value) => { if (value.type.startsWith("image")) { acc.push({ - //src: GenerateSrcUrl(value), + fullsize: GenerateSrcUrl(value), src: GenerateThumbUrl(value), thumbnailHeight: 225, thumbnailWidth: 225, From 4a62ac2a11f5f6e4fd223b0a24961853b1ebe613 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 25 Oct 2023 08:52:03 -0700 Subject: [PATCH 24/38] IO-2421 Add Production Vars to the initial values on CheckList --- .../job-checklist-form/job-checklist-form.component.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx index 956cb4761..a809100a6 100644 --- a/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx +++ b/client/src/components/job-checklist/components/job-checklist-form/job-checklist-form.component.jsx @@ -1,5 +1,6 @@ import { useMutation } from "@apollo/client"; import { Button, Card, Form, Input, notification, Switch } from "antd"; +import moment from "moment-business-days"; import queryString from "query-string"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -12,16 +13,15 @@ import { MARK_LATEST_APPOINTMENT_ARRIVED, } from "../../../../graphql/appointments.queries"; import { UPDATE_JOB } from "../../../../graphql/jobs.queries"; +import { UPDATE_OWNER } from "../../../../graphql/owners.queries"; +import { insertAuditTrail } from "../../../../redux/application/application.actions"; import { selectBodyshop, selectCurrentUser, } from "../../../../redux/user/user.selectors"; +import AuditTrailMapping from "../../../../utils/AuditTrailMappings"; import ConfigFormComponents from "../../../config-form-components/config-form-components.component"; import DateTimePicker from "../../../form-date-time-picker/form-date-time-picker.component"; -import moment from "moment-business-days"; -import { insertAuditTrail } from "../../../../redux/application/application.actions"; -import AuditTrailMapping from "../../../../utils/AuditTrailMappings"; -import { UPDATE_OWNER } from "../../../../graphql/owners.queries"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -230,6 +230,7 @@ export function JobChecklistForm({ )), scheduled_delivery: job.scheduled_delivery && moment(job.scheduled_delivery), + production_vars: job.production_vars, }), ...(type === "deliver" && { removeFromProduction: true, From eb359d83c5cc587cffa542f01cf4017191b6bf73 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 25 Oct 2023 17:01:03 -0700 Subject: [PATCH 25/38] IO-1559 Requested changes to tags from ClaimsCorp --- server/data/claimscorp.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index a854ff84f..03ca7d6c4 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -17,7 +17,7 @@ let Client = require("ssh2-sftp-client"); const client = require("../graphql-client/graphql-client").client; const { sendServerEmail } = require("../email/sendemail"); const CCDineroFormat = "0,0.00"; -const AhDateFormat = "MMDDYYYY"; +const AhDateFormat = "MM/DD/YYYY"; const repairOpCodes = ["OP4", "OP9", "OP10"]; const replaceOpCodes = ["OP2", "OP5", "OP11", "OP12"]; @@ -245,7 +245,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { try { const ret = { - RONumber: job.ro_number, + RoNumber: job.ro_number, Customer: { CustomerZip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "", CustomerState: job.ownr_st || "", @@ -312,7 +312,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { (job.date_estimated && moment(job.date_estimated).format(AhDateFormat)) || "", - DateofLoss: + DateLoss: (job.loss_date && moment(job.loss_date).format(AhDateFormat)) || "", DateFNOL: "", DateContact: "", @@ -384,7 +384,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { "", BilledDate: "", PaidInFullDate: "", - RoStatus: job.tlos_ind + ROStatus: job.tlos_ind ? "TOT" : StatusMapping(job.status, job.bodyshop.md_ro_statuses), }, From 9b7c0af025ff47992f7c95c4d11312aaf66ccfa5 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 30 Oct 2023 16:51:26 -0700 Subject: [PATCH 26/38] IO-2431 Created By for Appointments --- .../schedule-job-modal/schedule-job-modal.container.jsx | 8 +++++++- hasura/metadata/tables.yaml | 3 +++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/down.sql create mode 100644 hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/up.sql diff --git a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx index ed3eace05..c8b85be38 100644 --- a/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx +++ b/client/src/components/schedule-job-modal/schedule-job-modal.container.jsx @@ -16,13 +16,17 @@ import { QUERY_LBR_HRS_BY_PK, UPDATE_JOBS } from "../../graphql/jobs.queries"; import { setEmailOptions } from "../../redux/email/email.actions"; import { toggleModalVisible } from "../../redux/modals/modals.actions"; import { selectSchedule } from "../../redux/modals/modals.selectors"; -import { selectBodyshop } from "../../redux/user/user.selectors"; +import { + selectBodyshop, + selectCurrentUser, +} from "../../redux/user/user.selectors"; import { TemplateList } from "../../utils/TemplateConstants"; import ScheduleJobModalComponent from "./schedule-job-modal.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, scheduleModal: selectSchedule, + currentUser: selectCurrentUser, }); const mapDispatchToProps = (dispatch) => ({ toggleModalVisible: () => dispatch(toggleModalVisible("schedule")), @@ -34,6 +38,7 @@ export function ScheduleJobModalContainer({ bodyshop, toggleModalVisible, setEmailOptions, + currentUser, }) { const { visible, context, actions } = scheduleModal; const { jobId, job, previousEvent } = context; @@ -122,6 +127,7 @@ export function ScheduleJobModalContainer({ end: moment(values.start).add(bodyshop.appt_length || 60, "minutes"), color: values.color, note: values.note, + created_by: currentUser.email, }, jobId: jobId, altTransport: values.alt_transport, diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 701637a9c..69f30251b 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -110,6 +110,7 @@ - canceled - color - created_at + - created_by - end - id - isintake @@ -128,6 +129,7 @@ - canceled - color - created_at + - created_by - end - id - isintake @@ -156,6 +158,7 @@ - canceled - color - created_at + - created_by - end - id - isintake diff --git a/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/down.sql b/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/down.sql new file mode 100644 index 000000000..9562a8171 --- /dev/null +++ b/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."appointments" add column "created_by" text +-- null; diff --git a/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/up.sql b/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/up.sql new file mode 100644 index 000000000..ef7952cf3 --- /dev/null +++ b/hasura/migrations/1698709322872_alter_table_public_appointments_add_column_created_by/up.sql @@ -0,0 +1,2 @@ +alter table "public"."appointments" add column "created_by" text + null; From 2e93238b5cde66026019a10a173b3cb9c6888bd3 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 30 Oct 2023 17:08:22 -0700 Subject: [PATCH 27/38] IO-2430 Open Orders by Referral --- client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + client/src/utils/TemplateConstants.js | 23 ++++++++++++++++++----- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 978bc7ccd..4950b5944 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2597,6 +2597,7 @@ "open_orders_csr": "Open Orders by CSR", "open_orders_estimator": "Open Orders by Estimator", "open_orders_ins_co": "Open Orders by Insurance Company", + "open_orders_referral": "Open Orders by Referral Source", "open_orders_specific_csr": "Open Orders filtered by CSR", "open_orders_status": "Open Orders by Status", "parts_backorder": "IOU Parts List", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index c687b79d5..2f3fca133 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2597,6 +2597,7 @@ "open_orders_csr": "", "open_orders_estimator": "", "open_orders_ins_co": "", + "open_orders_referral": "", "open_orders_specific_csr": "", "open_orders_status": "", "parts_backorder": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index d11d96044..4dba2e141 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2597,6 +2597,7 @@ "open_orders_csr": "", "open_orders_estimator": "", "open_orders_ins_co": "", + "open_orders_referral": "", "open_orders_specific_csr": "", "open_orders_status": "", "parts_backorder": "", diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index cc1c4011a..79d9aa353 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -1502,6 +1502,19 @@ export const TemplateList = (type, context) => { }, group: "jobs", }, + open_orders_specific_csr: { + title: i18n.t("reportcenter.templates.open_orders_specific_csr"), + description: "", + subject: i18n.t("reportcenter.templates.open_orders_specific_csr"), + key: "open_orders_specific_csr", + idtype: "employee", + disabled: false, + rangeFilter: { + object: i18n.t("reportcenter.labels.objects.jobs"), + field: i18n.t("jobs.fields.date_open"), + }, + group: "jobs", + }, open_orders_estimator: { title: i18n.t("reportcenter.templates.open_orders_estimator"), description: "", @@ -1528,12 +1541,12 @@ export const TemplateList = (type, context) => { }, group: "jobs", }, - open_orders_specific_csr: { - title: i18n.t("reportcenter.templates.open_orders_specific_csr"), + open_orders_referral: { + title: i18n.t("reportcenter.templates.open_orders_referral"), description: "", - subject: i18n.t("reportcenter.templates.open_orders_specific_csr"), - key: "open_orders_specific_csr", - idtype: "employee", + subject: i18n.t("reportcenter.templates.open_orders_referral"), + key: "open_orders_referral", + //idtype: "vendor", disabled: false, rangeFilter: { object: i18n.t("reportcenter.labels.objects.jobs"), From b649ca1f004e5c3a0fdc81db2cf2b3c755bf001a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 31 Oct 2023 12:35:18 -0700 Subject: [PATCH 28/38] IO-1559 Additional XML Tag adjustments --- server/data/claimscorp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index 03ca7d6c4..eddc45a74 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -397,7 +397,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { Paint: Dinero(job.job_totals.rates.lar.total).toFormat(CCDineroFormat), Prep: Dinero().toFormat(CCDineroFormat), Frame: Dinero(job.job_totals.rates.laf.total).toFormat(CCDineroFormat), - Mechanical: Dinero(job.job_totals.rates.lam.total).toFormat( + Mech: Dinero(job.job_totals.rates.lam.total).toFormat( CCDineroFormat ), Glass: Dinero(job.job_totals.rates.lag.total).toFormat(CCDineroFormat), @@ -481,7 +481,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { .filter((line) => repairOpCodes.includes(line.lbr_op)) .reduce((acc, val) => acc + val.mod_lb_hrs, 0) .toFixed(2), - BodyReplaceHours: job.joblines + BodyReplacehours: job.joblines .filter((line) => replaceOpCodes.includes(line.lbr_op)) .reduce((acc, val) => acc + val.mod_lb_hrs, 0) .toFixed(2), @@ -523,7 +523,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { AM: repairCosts.PartsAMCost.toFormat(CCDineroFormat), MechParts: Dinero().toFormat(CCDineroFormat), OtherParts: Dinero().toFormat(CCDineroFormat), //Check Synergy - OtherCosts: repairCosts.PartsOtherCost.toFormat(CCDineroFormat), + OtherCost: repairCosts.PartsOtherCost.toFormat(CCDineroFormat), Sublet: repairCosts.SubletTotalCost.toFormat(CCDineroFormat), Towing: repairCosts.TowingTotalCost.toFormat(CCDineroFormat), Storage: repairCosts.StorageTotalCost.toFormat(CCDineroFormat), From cf8280590ce3706f08d9060c0b5564f67d8fc547 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 31 Oct 2023 12:36:39 -0700 Subject: [PATCH 29/38] IO-1559 Prettyier --- server/data/claimscorp.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index eddc45a74..3f154eef9 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -397,9 +397,7 @@ const CreateRepairOrderTag = (job, errorCallback) => { Paint: Dinero(job.job_totals.rates.lar.total).toFormat(CCDineroFormat), Prep: Dinero().toFormat(CCDineroFormat), Frame: Dinero(job.job_totals.rates.laf.total).toFormat(CCDineroFormat), - Mech: Dinero(job.job_totals.rates.lam.total).toFormat( - CCDineroFormat - ), + Mech: Dinero(job.job_totals.rates.lam.total).toFormat(CCDineroFormat), Glass: Dinero(job.job_totals.rates.lag.total).toFormat(CCDineroFormat), Elec: Dinero(job.job_totals.rates.lae.total).toFormat(CCDineroFormat), Detail: detailAdjustments.amount.toFormat(CCDineroFormat), From a27092dbcce1232218f8096d24354bed80b96400 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 1 Nov 2023 10:28:10 -0700 Subject: [PATCH 30/38] IO-1559 Change File name as per Koyel --- server/data/claimscorp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/data/claimscorp.js b/server/data/claimscorp.js index 3f154eef9..60943aed3 100644 --- a/server/data/claimscorp.js +++ b/server/data/claimscorp.js @@ -104,7 +104,7 @@ exports.default = async (req, res) => { allxmlsToUpload.push({ count: claimsCorpObject.DataFeed.ShopInfo.RO.length, xml: ret, - filename: `${bodyshop.claimscorpid}-MIS-${moment().format( + filename: `${bodyshop.claimscorpid}-${moment().format( "YYYYMMDDTHHMMss" )}.xml`, }); From f6bcc743d8d9b36d74c0485f94b0e0cf67065109 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 6 Nov 2023 15:04:01 -0800 Subject: [PATCH 31/38] IO-2330 Remove phone validation for vendor sav.e --- client/src/components/vendors-form/vendors-form.component.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/components/vendors-form/vendors-form.component.jsx b/client/src/components/vendors-form/vendors-form.component.jsx index 95693041b..38571fb92 100644 --- a/client/src/components/vendors-form/vendors-form.component.jsx +++ b/client/src/components/vendors-form/vendors-form.component.jsx @@ -154,7 +154,6 @@ export function VendorsFormComponent({ label={t("vendors.fields.phone")} name="phone" rules={[ - { required: true, message: t("general.validation.required") }, ({ getFieldValue }) => PhoneItemFormatterValidation(getFieldValue, "phone"), ]} From 4e1dd52beaf828c62e52973e91b32778fc5bc353 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 6 Nov 2023 15:07:26 -0800 Subject: [PATCH 32/38] IO-2332 filter insurance company name on convert. --- .../jobs-convert-button/jobs-convert-button.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx index b48deb3b5..543ad36ca 100644 --- a/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx +++ b/client/src/components/jobs-convert-button/jobs-convert-button.component.jsx @@ -108,7 +108,7 @@ export function JobsConvertButton({ }, ]} > - {bodyshop.md_ins_cos.map((s, i) => ( {s.name} From 3e05b21c909f3ad7fd2a8067c6b293d539834a3e Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 7 Nov 2023 08:55:59 -0800 Subject: [PATCH 33/38] IO-2426 Add FCM Cache update for conversation aggregate count. --- client/src/utils/fcm-handler.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/client/src/utils/fcm-handler.js b/client/src/utils/fcm-handler.js index 07193e8b6..9a0f4472c 100644 --- a/client/src/utils/fcm-handler.js +++ b/client/src/utils/fcm-handler.js @@ -12,6 +12,13 @@ export default async function FcmHandler({ client, payload }) { }, }, }); + client.cache.modify({ + fields: { + messages_aggregate(cached) { + return { aggregate: { count: cached.aggregate.count + 1 } }; + }, + }, + }); break; case "messaging-outbound": client.cache.modify({ @@ -30,6 +37,7 @@ export default async function FcmHandler({ client, payload }) { }); break; case "messaging-mark-conversation-read": + let previousUnreadCount = 0; client.cache.modify({ id: client.cache.identify({ __typename: "conversations", @@ -37,10 +45,22 @@ export default async function FcmHandler({ client, payload }) { }), fields: { messages_aggregate(cached) { + previousUnreadCount = cached.aggregate.count; return { aggregate: { count: 0 } }; }, }, }); + client.cache.modify({ + fields: { + messages_aggregate(cached) { + return { + aggregate: { + count: cached.aggregate.count - previousUnreadCount, + }, + }; + }, + }, + }); break; default: console.log("No payload type set."); From 99977934e7def269ef9984b9da3ab579760fe180 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 7 Nov 2023 09:24:21 -0800 Subject: [PATCH 34/38] IO-2429 Remove CIECA information on duplication. --- .../jobs-detail-header-actions.duplicate.util.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js index fc5b9c0ca..503bcc740 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js @@ -27,6 +27,8 @@ export default async function DuplicateJob( delete existingJob.id; delete existingJob.createdat; delete existingJob.updatedat; + delete existingJob.cieca_stl; + delete existingJob.cieca_ttl; const newJob = { ...existingJob, @@ -81,6 +83,8 @@ export async function CreateIouForJob( delete existingJob.id; delete existingJob.createdat; delete existingJob.updatedat; + delete existingJob.cieca_stl; + delete existingJob.cieca_ttl; const newJob = { ...existingJob, From 682ea860fbb38ad7a8f21ca56d03fb2f47849736 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 7 Nov 2023 12:36:30 -0800 Subject: [PATCH 35/38] IO-2437 override CDK make model on update. --- bodyshop_translations.babel | 191 +++++++++++++++++- .../dms-post-form/dms-post-form.component.jsx | 7 + client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + server/cdk/cdk-job-export.js | 6 + 6 files changed, 206 insertions(+), 1 deletion(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5bc83e3b8..304566b29 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +