From 7825aa412256f84739277a6a851a80c14e3ed4bf Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 20 Oct 2023 13:55:21 -0700 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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`, });