From 584322819f9cee6a3f11ec3942da0de9216c2eca Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 9 May 2023 16:51:55 -0700 Subject: [PATCH 01/11] IO-2265 Autohouse Extract Remove Customer Info --- server/data/autohouse.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/data/autohouse.js b/server/data/autohouse.js index dab3581cb..ca6fae6d9 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -265,20 +265,20 @@ const CreateRepairOrderTag = (job, errorCallback) => { }${job.est_ct_fn ? job.est_ct_fn : ""}`, }, CustomerInformation: { - FirstName: job.ownr_fn || "", - LastName: job.ownr_ln || "", - Street: job.ownr_addr1 || "", - City: job.ownr_city || "", - State: job.ownr_st || "", + FirstName: "", + LastName: "", + Street: "", + City: "", + State: "", Zip: (job.ownr_zip && job.ownr_zip.substring(0, 3)) || "", - Phone1: job.ownr_ph1 || "", + Phone1: "", Phone2: null, Phone2Extension: null, Phone3: null, Phone3Extension: null, FileComments: null, Source: null, - Email: job.ownr_ea || "", + Email: "", RetWhsl: null, Cat: null, InsuredorClaimantFlag: null, From 39a464633961fb6dfca335a930cdcabcb934c96a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 9 May 2023 18:11:06 -0700 Subject: [PATCH 02/11] IO-2271 Country Region for Print Center Hide reports based on Country Code for Region --- .../print-center-jobs/print-center-jobs.component.jsx | 7 +++++-- client/src/utils/TemplateConstants.js | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/src/components/print-center-jobs/print-center-jobs.component.jsx b/client/src/components/print-center-jobs/print-center-jobs.component.jsx index 6af0bb7ac..b65f4916e 100644 --- a/client/src/components/print-center-jobs/print-center-jobs.component.jsx +++ b/client/src/components/print-center-jobs/print-center-jobs.component.jsx @@ -29,9 +29,12 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) { }) .filter( (temp) => - !temp.regions || (temp.regions && temp.regions[bodyshop.region_config]) + !temp.regions || + (temp.regions && temp.regions[bodyshop.region_config]) || + (temp.regions && + bodyshop.region_config.includes(Object.keys(temp.regions)) === true) ); - + const filteredJobsReportsList = search !== "" ? JobsReportsList.filter((r) => diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 3a3c9f278..20006bda9 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -19,6 +19,9 @@ export const TemplateList = (type, context) => { key: "casl_authorization", disabled: false, group: "authorization", + regions: { + CA: true, + }, }, fippa_authorization: { title: i18n.t("printcenter.jobs.fippa_authorization"), From 60867ae4dccdb9a1e148966fa11881fbc96e42f8 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 10 May 2023 18:03:42 -0700 Subject: [PATCH 03/11] IO-2271 Country Region Print Center Modification Allow items to be hidden by Country Code only from region --- .../print-center-jobs.component.jsx | 2 +- client/src/utils/TemplateConstants.js | 159 +++++++++--------- 2 files changed, 80 insertions(+), 81 deletions(-) diff --git a/client/src/components/print-center-jobs/print-center-jobs.component.jsx b/client/src/components/print-center-jobs/print-center-jobs.component.jsx index b65f4916e..c96e3d3a5 100644 --- a/client/src/components/print-center-jobs/print-center-jobs.component.jsx +++ b/client/src/components/print-center-jobs/print-center-jobs.component.jsx @@ -34,7 +34,7 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) { (temp.regions && bodyshop.region_config.includes(Object.keys(temp.regions)) === true) ); - + const filteredJobsReportsList = search !== "" ? JobsReportsList.filter((r) => diff --git a/client/src/utils/TemplateConstants.js b/client/src/utils/TemplateConstants.js index 20006bda9..715d511fe 100644 --- a/client/src/utils/TemplateConstants.js +++ b/client/src/utils/TemplateConstants.js @@ -7,14 +7,13 @@ export const EmailSettings = { export const TemplateList = (type, context) => { //const { bodyshop } = store.getState().user; - return { //If there's no type or the type is job, send it back. ...(!type || type === "job" ? { casl_authorization: { title: i18n.t("printcenter.jobs.casl_authorization"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.casl_authorization"), key: "casl_authorization", disabled: false, @@ -25,7 +24,7 @@ export const TemplateList = (type, context) => { }, fippa_authorization: { title: i18n.t("printcenter.jobs.fippa_authorization"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.fippa_authorization"), key: "fippa_authorization", disabled: false, @@ -33,7 +32,7 @@ export const TemplateList = (type, context) => { }, diagnostic_authorization: { title: i18n.t("printcenter.jobs.diagnostic_authorization"), - description: "Diagnostic Authorization", + description: "", subject: i18n.t("printcenter.jobs.diagnostic_authorization"), key: "diagnostic_authorization", disabled: false, @@ -41,7 +40,7 @@ export const TemplateList = (type, context) => { }, mechanical_authorization: { title: i18n.t("printcenter.jobs.mechanical_authorization"), - description: "Diagnostic Authorization", + description: "", subject: i18n.t("printcenter.jobs.mechanical_authorization"), key: "mechanical_authorization", disabled: false, @@ -49,7 +48,7 @@ export const TemplateList = (type, context) => { }, appointment_reminder: { title: i18n.t("printcenter.jobs.appointment_reminder"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.appointment_reminder"), key: "appointment_reminder", disabled: false, @@ -57,7 +56,7 @@ export const TemplateList = (type, context) => { }, estimate_followup: { title: i18n.t("printcenter.jobs.estimate_followup"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.estimate_followup"), key: "estimate_followup", disabled: false, @@ -65,7 +64,7 @@ export const TemplateList = (type, context) => { }, express_repair_checklist: { title: i18n.t("printcenter.jobs.express_repair_checklist"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.express_repair_checklist"), key: "express_repair_checklist", disabled: false, @@ -73,7 +72,7 @@ export const TemplateList = (type, context) => { }, glass_express_checklist: { title: i18n.t("printcenter.jobs.glass_express_checklist"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.glass_express_checklist"), key: "glass_express_checklist", disabled: false, @@ -81,7 +80,7 @@ export const TemplateList = (type, context) => { }, stolen_recovery_checklist: { title: i18n.t("printcenter.jobs.stolen_recovery_checklist"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.stolen_recovery_checklist"), key: "stolen_recovery_checklist", disabled: false, @@ -89,7 +88,7 @@ export const TemplateList = (type, context) => { }, vehicle_check_in: { title: i18n.t("printcenter.jobs.vehicle_check_in"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.vehicle_check_in"), key: "vehicle_check_in", disabled: false, @@ -97,7 +96,7 @@ export const TemplateList = (type, context) => { }, parts_order_history: { title: i18n.t("printcenter.jobs.parts_order_history"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.parts_order_history"), key: "parts_order_history", disabled: false, @@ -105,7 +104,7 @@ export const TemplateList = (type, context) => { }, job_notes: { title: i18n.t("printcenter.jobs.job_notes"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.job_notes"), key: "job_notes", disabled: false, @@ -113,7 +112,7 @@ export const TemplateList = (type, context) => { }, ro_with_description: { title: i18n.t("printcenter.jobs.ro_with_description"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.ro_with_description"), key: "ro_with_description", disabled: false, @@ -121,7 +120,7 @@ export const TemplateList = (type, context) => { }, window_tag: { title: i18n.t("printcenter.jobs.window_tag"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.window_tag"), key: "window_tag", disabled: false, @@ -129,7 +128,7 @@ export const TemplateList = (type, context) => { }, supplement_request: { title: i18n.t("printcenter.jobs.supplement_request"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.supplement_request"), key: "supplement_request", disabled: false, @@ -137,7 +136,7 @@ export const TemplateList = (type, context) => { }, estimate: { title: i18n.t("printcenter.jobs.estimate"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.estimate"), key: "estimate", disabled: false, @@ -145,7 +144,7 @@ export const TemplateList = (type, context) => { }, parts_list: { title: i18n.t("printcenter.jobs.parts_list"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.parts_list"), key: "parts_list", disabled: false, @@ -153,7 +152,7 @@ export const TemplateList = (type, context) => { }, coversheet_portrait: { title: i18n.t("printcenter.jobs.coversheet_portrait"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.coversheet_portrait"), key: "coversheet_portrait", disabled: false, @@ -161,7 +160,7 @@ export const TemplateList = (type, context) => { }, coversheet_landscape: { title: i18n.t("printcenter.jobs.coversheet_landscape"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.coversheet_landscape"), key: "coversheet_landscape", disabled: false, @@ -169,7 +168,7 @@ export const TemplateList = (type, context) => { }, key_tag: { title: i18n.t("printcenter.jobs.key_tag"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.key_tag"), key: "key_tag", disabled: false, @@ -177,7 +176,7 @@ export const TemplateList = (type, context) => { }, paint_grid: { title: i18n.t("printcenter.jobs.paint_grid"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.paint_grid"), key: "paint_grid", disabled: false, @@ -185,7 +184,7 @@ export const TemplateList = (type, context) => { }, worksheet_by_line_number: { title: i18n.t("printcenter.jobs.worksheet_by_line_number"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.worksheet_by_line_number"), key: "worksheet_by_line_number", disabled: false, @@ -195,7 +194,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_type" ), - description: "All Jobs Notes", + description: "", subject: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_type" ), @@ -205,7 +204,7 @@ export const TemplateList = (type, context) => { }, worksheet_sorted_by_operation: { title: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.worksheet_sorted_by_operation"), key: "worksheet_sorted_by_operation", disabled: false, @@ -215,7 +214,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_no_hours" ), - description: "All Jobs Notes", + description: "", subject: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_no_hours" ), @@ -227,7 +226,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_part_type" ), - description: "All Jobs Notes", + description: "", subject: i18n.t( "printcenter.jobs.worksheet_sorted_by_operation_part_type" ), @@ -237,7 +236,7 @@ export const TemplateList = (type, context) => { }, payments_by_job: { title: i18n.t("printcenter.jobs.payments_by_job"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.payments_by_job"), key: "payments_by_job", disabled: false, @@ -245,7 +244,7 @@ export const TemplateList = (type, context) => { }, final_invoice: { title: i18n.t("printcenter.jobs.final_invoice"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.final_invoice"), key: "final_invoice", disabled: false, @@ -253,7 +252,7 @@ export const TemplateList = (type, context) => { }, payment_request: { title: i18n.t("printcenter.jobs.payment_request"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.payment_request"), key: "payment_request", disabled: false, @@ -261,7 +260,7 @@ export const TemplateList = (type, context) => { }, invoice_total_payable: { title: i18n.t("printcenter.jobs.invoice_total_payable"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.invoice_total_payable"), key: "invoice_total_payable", disabled: false, @@ -269,7 +268,7 @@ export const TemplateList = (type, context) => { }, invoice_customer_payable: { title: i18n.t("printcenter.jobs.invoice_customer_payable"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.invoice_customer_payable"), key: "invoice_customer_payable", disabled: false, @@ -277,7 +276,7 @@ export const TemplateList = (type, context) => { }, ro_totals: { title: i18n.t("printcenter.jobs.ro_totals"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.ro_totals"), key: "ro_totals", disabled: false, @@ -285,7 +284,7 @@ export const TemplateList = (type, context) => { }, job_costing_ro: { title: i18n.t("printcenter.jobs.job_costing_ro"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.job_costing_ro"), key: "job_costing_ro", disabled: false, @@ -293,7 +292,7 @@ export const TemplateList = (type, context) => { }, purchases_by_ro_detail: { title: i18n.t("printcenter.jobs.purchases_by_ro_detail"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.purchases_by_ro_detail"), key: "purchases_by_ro_detail", disabled: false, @@ -301,7 +300,7 @@ export const TemplateList = (type, context) => { }, purchases_by_ro_summary: { title: i18n.t("printcenter.jobs.purchases_by_ro_summary"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.purchases_by_ro_summary"), key: "purchases_by_ro_summary", disabled: false, @@ -309,7 +308,7 @@ export const TemplateList = (type, context) => { }, filing_coversheet_portrait: { title: i18n.t("printcenter.jobs.filing_coversheet_portrait"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.filing_coversheet_portrait"), key: "filing_coversheet_portrait", disabled: false, @@ -317,7 +316,7 @@ export const TemplateList = (type, context) => { }, filing_coversheet_landscape: { title: i18n.t("printcenter.jobs.filing_coversheet_landscape"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.filing_coversheet_landscape"), key: "filing_coversheet_landscape", disabled: false, @@ -325,7 +324,7 @@ export const TemplateList = (type, context) => { }, qc_sheet: { title: i18n.t("printcenter.jobs.qc_sheet"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.qc_sheet"), key: "qc_sheet", disabled: false, @@ -333,7 +332,7 @@ export const TemplateList = (type, context) => { }, vehicle_delivery_check: { title: i18n.t("printcenter.jobs.vehicle_delivery_check"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.vehicle_delivery_check"), key: "vehicle_delivery_check", disabled: false, @@ -341,7 +340,7 @@ export const TemplateList = (type, context) => { }, guarantee: { title: i18n.t("printcenter.jobs.guarantee"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.guarantee"), key: "guarantee", disabled: false, @@ -349,7 +348,7 @@ export const TemplateList = (type, context) => { }, csi_invitation: { title: i18n.t("printcenter.jobs.csi_invitation"), - description: "CSI invite", + description: "", key: "csi_invitation", subject: i18n.t("printcenter.jobs.csi_invitation"), disabled: false, @@ -357,7 +356,7 @@ export const TemplateList = (type, context) => { }, window_tag_sublet: { title: i18n.t("printcenter.jobs.window_tag_sublet"), - description: "Window Tag Sublet", + description: "", key: "window_tag_sublet", subject: i18n.t("printcenter.jobs.window_tag_sublet"), disabled: false, @@ -365,7 +364,7 @@ export const TemplateList = (type, context) => { }, thank_you_ro: { title: i18n.t("printcenter.jobs.thank_you_ro"), - description: "Thank You Letter by RO", + description: "", key: "thank_you_ro", subject: i18n.t("printcenter.jobs.thank_you_ro"), disabled: false, @@ -373,7 +372,7 @@ export const TemplateList = (type, context) => { }, parts_label_single: { title: i18n.t("printcenter.jobs.parts_label_single"), - description: "Thank You Letter by RO", + description: "", key: "parts_label_single", subject: i18n.t("printcenter.jobs.parts_label_single"), disabled: false, @@ -382,7 +381,7 @@ export const TemplateList = (type, context) => { }, envelope_return_address: { title: i18n.t("printcenter.jobs.envelope_return_address"), - description: "All Jobs Notes", + description: "", subject: i18n.t("printcenter.jobs.envelope_return_address"), key: "envelope_return_address", disabled: false, @@ -391,7 +390,7 @@ export const TemplateList = (type, context) => { }, sgi_certificate_of_repairs: { title: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"), - description: "Thank You Letter by RO", + description: "", key: "sgi_certificate_of_repairs", subject: i18n.t("printcenter.jobs.sgi_certificate_of_repairs"), disabled: false, @@ -402,7 +401,7 @@ export const TemplateList = (type, context) => { }, sgi_windshield_auth: { title: i18n.t("printcenter.jobs.sgi_windshield_auth"), - description: "Thank You Letter by RO", + description: "", key: "sgi_windshield_auth", subject: i18n.t("printcenter.jobs.sgi_windshield_auth"), disabled: false, @@ -413,7 +412,7 @@ export const TemplateList = (type, context) => { }, mpi_final_acct_sheet: { title: i18n.t("printcenter.jobs.mpi_final_acct_sheet"), - description: "Thank You Letter by RO", + description: "", key: "mpi_final_acct_sheet", subject: i18n.t("printcenter.jobs.mpi_final_acct_sheet"), disabled: false, @@ -424,7 +423,7 @@ export const TemplateList = (type, context) => { }, mpi_eglass_auth: { title: i18n.t("printcenter.jobs.mpi_eglass_auth"), - description: "Thank You Letter by RO", + description: "", key: "mpi_eglass_auth", subject: i18n.t("printcenter.jobs.mpi_eglass_auth"), disabled: false, @@ -435,7 +434,7 @@ export const TemplateList = (type, context) => { }, mpi_animal_checklist: { title: i18n.t("printcenter.jobs.mpi_animal_checklist"), - description: "Thank You Letter by RO", + description: "", key: "mpi_animal_checklist", subject: i18n.t("printcenter.jobs.mpi_animal_checklist"), disabled: false, @@ -446,7 +445,7 @@ export const TemplateList = (type, context) => { }, ab_proof_of_loss: { title: i18n.t("printcenter.jobs.ab_proof_of_loss"), - description: "Thank You Letter by RO", + description: "", key: "ab_proof_of_loss", subject: i18n.t("printcenter.jobs.ab_proof_of_loss"), disabled: false, @@ -457,7 +456,7 @@ export const TemplateList = (type, context) => { }, // parts_label_multi: { // title: i18n.t("printcenter.jobs.parts_label_multi"), - // description: "Thank You Letter by RO", + // description: "", // key: "parts_label_multi", // subject: i18n.t("printcenter.jobs.parts_label_multi"), // disabled: false, @@ -465,7 +464,7 @@ export const TemplateList = (type, context) => { // }, iou_form: { title: i18n.t("printcenter.jobs.iou_form"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.iou_form"), key: "iou_form", disabled: false, @@ -473,7 +472,7 @@ export const TemplateList = (type, context) => { }, lag_time_ro: { title: i18n.t("printcenter.jobs.lag_time_ro"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.lag_time_ro"), key: "lag_time_ro", disabled: false, @@ -481,7 +480,7 @@ export const TemplateList = (type, context) => { }, rental_reservation: { title: i18n.t("printcenter.jobs.rental_reservation"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.rental_reservation"), key: "rental_reservation", disabled: false, @@ -489,7 +488,7 @@ export const TemplateList = (type, context) => { }, timetickets_ro: { title: i18n.t("printcenter.jobs.timetickets_ro"), - description: "CASL Authorization", + description: "", subject: i18n.t("printcenter.jobs.timetickets_ro"), key: "timetickets_ro", disabled: false, @@ -497,7 +496,7 @@ export const TemplateList = (type, context) => { }, dms_posting_sheet: { title: i18n.t("printcenter.jobs.dms_posting_sheet"), - description: "DMS Posting Sheet", + description: "", subject: i18n.t("printcenter.jobs.dms_posting_sheet"), key: "dms_posting_sheet", disabled: false, @@ -509,39 +508,39 @@ export const TemplateList = (type, context) => { ? { special_thirdpartypayer: { title: i18n.t("printcenter.jobs.thirdpartypayer"), - description: "CSI invite", + description: "", key: "special_thirdpartypayer", disabled: false, }, folder_label_multiple: { title: i18n.t("printcenter.jobs.folder_label_multiple"), - description: "Folder Label Multiple", + description: "", key: "folder_label_multiple", disabled: false, }, parts_label_multiple: { title: i18n.t("printcenter.jobs.parts_label_multiple"), - description: "Parts Label Multiple", + description: "", key: "parts_label_multiple", disabled: false, }, parts_invoice_label_single: { title: i18n.t("printcenter.jobs.parts_invoice_label_single"), - description: "Parts Label Multiple", + description: "", key: "parts_invoice_label_single", disabled: false, ignoreCustomMargins: true, }, csi_invitation_action: { title: i18n.t("printcenter.jobs.csi_invitation_action"), - description: "CSI invite", + description: "", key: "csi_invitation_action", subject: i18n.t("printcenter.jobs.csi_invitation_action"), disabled: false, }, individual_job_note: { title: i18n.t("printcenter.jobs.individual_job_note"), - description: "CSI invite", + description: "", key: "individual_job_note", subject: i18n.t("printcenter.jobs.individual_job_note", { ro_number: (context && context.ro_number) || "", @@ -554,7 +553,7 @@ export const TemplateList = (type, context) => { ? { appointment_confirmation: { title: i18n.t("printcenter.appointments.appointment_confirmation"), - description: "Appointment Confirmation", + description: "", subject: i18n.t( "printcenter.appointments.appointment_confirmation" ), @@ -567,7 +566,7 @@ export const TemplateList = (type, context) => { ? { parts_order: { title: i18n.t("printcenter.jobs.parts_order"), - description: "Parts Order", + description: "", key: "parts_order", subject: i18n.t("printcenter.subjects.jobs.parts_order", { ro_number: context && context.job && context.job.ro_number, @@ -581,7 +580,7 @@ export const TemplateList = (type, context) => { }, sublet_order: { title: i18n.t("printcenter.jobs.sublet_order"), - description: "Parts Order", + description: "", key: "sublet_order", subject: i18n.t("printcenter.subjects.jobs.sublet_order", { ro_number: context && context.job && context.job.ro_number, @@ -596,7 +595,7 @@ export const TemplateList = (type, context) => { parts_return_slip: { title: i18n.t("printcenter.jobs.parts_return_slip"), subject: i18n.t("printcenter.jobs.parts_return_slip"), - description: "Parts Return", + description: "", key: "parts_return_slip", disabled: false, }, @@ -606,7 +605,7 @@ export const TemplateList = (type, context) => { ? { payment_receipt: { title: i18n.t("printcenter.jobs.payment_receipt"), - description: "Payment Receipt", + description: "", subject: i18n.t("printcenter.jobs.payment_receipt"), key: "payment_receipt", disabled: false, @@ -1894,7 +1893,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.courtesycarcontract.courtesy_car_contract" ), - description: "Est Detail", + description: "", subject: i18n.t( "printcenter.courtesycarcontract.courtesy_car_contract" ), @@ -1903,7 +1902,7 @@ export const TemplateList = (type, context) => { }, courtesy_car_terms: { title: i18n.t("printcenter.courtesycarcontract.courtesy_car_terms"), - description: "Est Detail", + description: "", subject: i18n.t( "printcenter.courtesycarcontract.courtesy_car_terms" ), @@ -1914,7 +1913,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.courtesycarcontract.courtesy_car_impound" ), - description: "Est Detail", + description: "", subject: i18n.t( "printcenter.courtesycarcontract.courtesy_car_impound" ), @@ -1929,7 +1928,7 @@ export const TemplateList = (type, context) => { title: i18n.t( "printcenter.courtesycarcontract.courtesy_car_inventory" ), - description: "Est Detail", + description: "", subject: i18n.t( "printcenter.courtesycarcontract.courtesy_car_inventory" ), @@ -1942,7 +1941,7 @@ export const TemplateList = (type, context) => { ? { inhouse_invoice: { title: i18n.t("printcenter.bills.inhouse_invoice"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.bills.inhouse_invoice"), key: "inhouse_invoice", disabled: false, @@ -1953,7 +1952,7 @@ export const TemplateList = (type, context) => { ? { // timetickets: { // title: i18n.t("printcenter.timetickets.timetickets"), - // description: "Est Detail", + // description: "", // subject: `${i18n.t("printcenter.timetickets.timetickets")} - ${ // context && context.job && context.job.ro_number // }`, @@ -1966,14 +1965,14 @@ export const TemplateList = (type, context) => { ? { purchases_by_vendor_detailed: { title: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.vendors.purchases_by_vendor_detailed"), key: "purchases_by_vendor_detailed", disabled: false, }, purchases_by_vendor_summary: { title: i18n.t("printcenter.vendors.purchases_by_vendor_summary"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.vendors.purchases_by_vendor_summary"), key: "purchases_by_vendor_summary", disabled: false, @@ -2046,21 +2045,21 @@ export const TemplateList = (type, context) => { ? { ca_bc_etf_table: { title: i18n.t("printcenter.payments.ca_bc_etf_table"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.payments.ca_bc_etf_table"), key: "ca_bc_etf_table", disabled: false, }, exported_payroll: { title: i18n.t("printcenter.payments.exported_payroll"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.payments.exported_payroll"), key: "exported_payroll", disabled: false, }, attendance_detail_csv: { title: i18n.t("printcenter.special.attendance_detail_csv"), - description: "Est Detail", + description: "", subject: i18n.t("printcenter.special.attendance_detail_csv"), key: "attendance_detail_csv", disabled: false, From 7fae408454e8708a58fc59c79e9f7b8f1f84af7a Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 May 2023 14:38:09 -0700 Subject: [PATCH 04/11] IO-2261 Modify Opensearch Data after payment update --- .../payment-modal/payment-modal.container.jsx | 10 +++++++--- .../payment-list-paginated.component.jsx | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index b7152b8e3..a2e7e37fe 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -52,7 +52,7 @@ function PaymentModalContainer({ const { useStripe, sendby, ...paymentObj } = values; setLoading(true); - + let updatedPayment; //Moved up from if statement for greater scope. try { if (!context || (context && !context.id)) { const newPayment = await insertPayment({ @@ -87,7 +87,7 @@ function PaymentModalContainer({ ); } } else { - const updatedPayment = await updatePayment({ + updatedPayment = await updatePayment({ variables: { paymentId: context.id, payment: paymentObj, @@ -101,7 +101,11 @@ function PaymentModalContainer({ } } - if (actions.refetch) actions.refetch(); + if (actions.refetch) + actions.refetch( + updatedPayment && updatedPayment.data.update_payments.returning[0] + ); + if (enterAgain) { const prev = form.getFieldsValue(["date"]); diff --git a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx index 06bebafd1..d34b56f9c 100644 --- a/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx +++ b/client/src/components/payments-list-paginated/payment-list-paginated.component.jsx @@ -169,7 +169,20 @@ export function PaymentsListPaginated({ apolloResults = data.payments_by_pk; } setPaymentContext({ - actions: { refetch: refetch }, + actions: { + refetch: apolloResults + ? (updatedRecord) => { + setOpenSearchResults((results) => + results.map((result) => { + if (result.id !== record.id) { + return result; + } + return updatedRecord; + }) + ); + } + : refetch, + }, context: apolloResults ? apolloResults : record, }); }} From dab78e3dc9d872bc0eaa04de47174f51e5357abd Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 May 2023 16:07:28 -0700 Subject: [PATCH 05/11] IO-2190 Paint Costs for JC if Cost/Hr is 0 --- server/job/job-costing.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/server/job/job-costing.js b/server/job/job-costing.js index 94af28402..33ae5722b 100644 --- a/server/job/job-costing.js +++ b/server/job/job-costing.js @@ -612,7 +612,12 @@ function GenerateCostingData(job) { //If the hourly rates for job costing are set, add them in. - if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) { + if ( + job.bodyshop.jc_hourly_rates && + (job.bodyshop.jc_hourly_rates.mapa || + typeof job.bodyshop.jc_hourly_rates.mapa === "number" || + isNaN(job.bodyshop.jc_hourly_rates.mapa) === false) + ) { if ( !billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA @@ -626,7 +631,9 @@ function GenerateCostingData(job) { billTotalsByCostCenters.additionalCosts[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA ] = Dinero({ - amount: Math.round((job.mixdata[0] && job.mixdata[0].totalliquidcost || 0) * 100) + amount: Math.round( + ((job.mixdata[0] && job.mixdata[0].totalliquidcost) || 0) * 100 + ), }); } else { billTotalsByCostCenters.additionalCosts[ From 5cb17994cd5ea351b3554e432c6820bcd126bb64 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 11 May 2023 16:09:30 -0700 Subject: [PATCH 06/11] IO-2190 Allow for 0 in JC/Hr rate --- server/data/autohouse.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/data/autohouse.js b/server/data/autohouse.js index ca6fae6d9..947c8d218 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -762,7 +762,12 @@ const CreateCosts = (job) => { }, {}); //If the hourly rates for job costing are set, add them in. - if (job.bodyshop.jc_hourly_rates && job.bodyshop.jc_hourly_rates.mapa) { + if ( + job.bodyshop.jc_hourly_rates && + (job.bodyshop.jc_hourly_rates.mapa || + typeof job.bodyshop.jc_hourly_rates.mapa === "number" || + isNaN(job.bodyshop.jc_hourly_rates.mapa) === false) + ) { if ( !billTotalsByCostCenters[ job.bodyshop.md_responsibility_centers.defaults.costs.MAPA From ca9752d119695681838064fe35e6b6cff3340ee7 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 12 May 2023 08:23:16 -0700 Subject: [PATCH 07/11] IO-2261 Remove duplicate fields and add created_at into return querys --- client/src/graphql/payments.queries.js | 97 ++++++++++++-------------- 1 file changed, 45 insertions(+), 52 deletions(-) diff --git a/client/src/graphql/payments.queries.js b/client/src/graphql/payments.queries.js index 9d56dad7d..179065633 100644 --- a/client/src/graphql/payments.queries.js +++ b/client/src/graphql/payments.queries.js @@ -16,19 +16,15 @@ export const QUERY_ALL_PAYMENTS_PAGINATED = gql` $limit: Int $order: [payments_order_by!]! ) { - payments( - offset: $offset - limit: $limit - order_by: $order - ) { + payments(offset: $offset, limit: $limit, order_by: $order) { id + amount created_at - jobid - paymentnum date + exportedat + jobid job { id - ro_number ownerid ownr_co_nm ownr_fn @@ -39,15 +35,14 @@ export const QUERY_ALL_PAYMENTS_PAGINATED = gql` ownr_fn ownr_ln } + ro_number } - transactionid memo - type - amount - stripeid - exportedat - stripeid payer + paymentnum + stripeid + transactionid + type } payments_aggregate { aggregate { @@ -62,16 +57,16 @@ export const UPDATE_PAYMENT = gql` update_payments(where: { id: { _eq: $paymentId } }, _set: $payment) { returning { id - transactionid - memo - type amount - stripeid + created_at + date exportedat - stripeid + memo payer paymentnum - date + stripeid + transactionid + type } } } @@ -85,17 +80,16 @@ export const UPDATE_PAYMENTS = gql` update_payments(where: { id: { _in: $paymentIdList } }, _set: $payment) { returning { id - exportedat - transactionid - memo - type amount - stripeid + created_at + date exportedat - stripeid + memo payer paymentnum - date + stripeid + transactionid + type } } } @@ -115,36 +109,35 @@ export const QUERY_JOB_PAYMENT_TOTALS = gql` } `; - -export const QUERY_PAYMENT_BY_ID = gql`query QUERY_PAYMENT_BY_ID($paymentId: uuid!) { - payments_by_pk(id: $paymentId) { - id - created_at - jobid - paymentnum - date - job { +export const QUERY_PAYMENT_BY_ID = gql` + query QUERY_PAYMENT_BY_ID($paymentId: uuid!) { + payments_by_pk(id: $paymentId) { id - ro_number - ownerid - ownr_co_nm - ownr_fn - ownr_ln - owner { + amount + created_at + exportedat + date + jobid + job { id + ownerid ownr_co_nm ownr_fn ownr_ln + owner { + id + ownr_co_nm + ownr_fn + ownr_ln + } + ro_number } + memo + payer + paymentnum + stripeid + transactionid + type } - transactionid - memo - type - amount - stripeid - exportedat - stripeid - payer } -} -` \ No newline at end of file +`; From b2f616f1eb753b852eb97560f399cbc67440ab93 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 12 May 2023 10:12:49 -0700 Subject: [PATCH 08/11] IO-2261 Add missing fields to return querys Customer info missing on return --- client/src/graphql/payments.queries.js | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/client/src/graphql/payments.queries.js b/client/src/graphql/payments.queries.js index 179065633..98614f53f 100644 --- a/client/src/graphql/payments.queries.js +++ b/client/src/graphql/payments.queries.js @@ -61,6 +61,21 @@ export const UPDATE_PAYMENT = gql` created_at date exportedat + jobid + job { + id + ownerid + ownr_co_nm + ownr_fn + ownr_ln + owner { + id + ownr_co_nm + ownr_fn + ownr_ln + } + ro_number + } memo payer paymentnum @@ -84,6 +99,21 @@ export const UPDATE_PAYMENTS = gql` created_at date exportedat + jobid + job { + id + ownerid + ownr_co_nm + ownr_fn + ownr_ln + owner { + id + ownr_co_nm + ownr_fn + ownr_ln + } + ro_number + } memo payer paymentnum From fe49161718002f78934574bc54501389faf95cbc Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 15 May 2023 15:18:24 -0700 Subject: [PATCH 09/11] IO-2258 Scoreboard Chart Add in target paint and body to the overall calculation to bump the start value up to the target instead of zero. --- .../scoreboard-chart/scoreboard-chart.component.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx index 802697a02..545030397 100644 --- a/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx +++ b/client/src/components/scoreboard-chart/scoreboard-chart.component.jsx @@ -1,5 +1,6 @@ -import Dinero from "dinero.js"; import { Card } from "antd"; +import Dinero from "dinero.js"; +import _ from "lodash"; import moment from "moment"; import React from "react"; import { connect } from "react-redux"; @@ -18,7 +19,6 @@ import { import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; import * as Utils from "../scoreboard-targets-table/scoreboard-targets-table.util"; -import _ from "lodash"; import CustomTooltip from "./chart-custom-tooltip"; const graphProps = { @@ -71,7 +71,9 @@ export function ScoreboardChart({ sbEntriesByDate, bodyshop }) { bodyshop.scoreboard_target.dailyBodyTarget + bodyshop.scoreboard_target.dailyPaintTarget, val - ), + ) + + bodyshop.scoreboard_target.dailyBodyTarget + + bodyshop.scoreboard_target.dailyPaintTarget, 1 ), accHrs: _.round( From 2c80c8119728867ffe58f2252e68bab786274371 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 07:38:49 -0700 Subject: [PATCH 10/11] Added tasks presets to database schema. --- hasura/metadata/tables.yaml | 2 ++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql create mode 100644 hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index b49797a78..ebed06a7c 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -941,6 +941,7 @@ - md_referral_sources - md_responsibility_centers - md_ro_statuses + - md_tasks_presets - md_to_emails - messagingservicesid - pbs_configuration @@ -1038,6 +1039,7 @@ - md_referral_sources - md_responsibility_centers - md_ro_statuses + - md_tasks_presets - md_to_emails - pbs_configuration - phone diff --git a/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/down.sql new file mode 100644 index 000000000..df054809e --- /dev/null +++ b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/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"."bodyshops" add column "md_tasks_presets" jsonb +-- not null default jsonb_build_object(); diff --git a/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql new file mode 100644 index 000000000..a9439a13e --- /dev/null +++ b/hasura/migrations/1684251223317_alter_table_public_bodyshops_add_column_md_tasks_presets/up.sql @@ -0,0 +1,2 @@ +alter table "public"."bodyshops" add column "md_tasks_presets" jsonb + not null default jsonb_build_object(); From b06fbd25a0853e2d1c0f203234c4e271c0abe1d6 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 17 May 2023 07:49:25 -0700 Subject: [PATCH 11/11] Add shop config section. --- bodyshop_translations.babel | 215 ++++++++++++++++++ .../shop-info/shop-info.component.jsx | 7 + .../shop-info.task-presets.component.jsx | 144 ++++++++++++ .../time-ticket-task-modal.container.jsx | 7 +- .../time-ticket-tasks-presets.component.jsx | 59 +++-- client/src/graphql/bodyshop.queries.js | 2 + client/src/graphql/jobs-lines.queries.js | 2 +- client/src/graphql/timetickets.queries.js | 2 +- client/src/translations/en_us/common.json | 16 +- client/src/translations/es/common.json | 16 +- client/src/translations/fr/common.json | 16 +- 11 files changed, 457 insertions(+), 29 deletions(-) create mode 100644 client/src/components/shop-info/shop-info.task-presets.component.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 3b4fff18d..028b9e90c 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -3602,6 +3602,27 @@ actions + + add_task_preset + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + addapptcolor false @@ -5584,6 +5605,95 @@ + + md_tasks_presets + + + hourstype + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + memo + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + name + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + percent + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + messaginglabel false @@ -9750,6 +9860,27 @@ + + md_tasks_presets + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + md_to_emails false @@ -10259,6 +10390,27 @@ + + task-presets + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + workingdays false @@ -14788,6 +14940,27 @@ + + newmember + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + @@ -14814,6 +14987,27 @@ + + employeeid + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + name false @@ -14835,6 +15029,27 @@ + + percentage + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/components/shop-info/shop-info.component.jsx b/client/src/components/shop-info/shop-info.component.jsx index 9baeb2c58..aad29074e 100644 --- a/client/src/components/shop-info/shop-info.component.jsx +++ b/client/src/components/shop-info/shop-info.component.jsx @@ -15,6 +15,7 @@ import ShopInfoResponsibilityCenterComponent from "./shop-info.responsibilitycen import ShopInfoROStatusComponent from "./shop-info.rostatus.component"; import ShopInfoSchedulingComponent from "./shop-info.scheduling.component"; import ShopInfoSpeedPrint from "./shop-info.speedprint.component"; +import ShopInfoTaskPresets from "./shop-info.task-presets.component"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -83,6 +84,12 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) { )} + + + ); diff --git a/client/src/components/shop-info/shop-info.task-presets.component.jsx b/client/src/components/shop-info/shop-info.task-presets.component.jsx new file mode 100644 index 000000000..7218f8056 --- /dev/null +++ b/client/src/components/shop-info/shop-info.task-presets.component.jsx @@ -0,0 +1,144 @@ +import { DeleteFilled } from "@ant-design/icons"; +import { + Button, + Checkbox, + Col, + Form, + Input, + InputNumber, + Row, + Space, +} from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; +import LayoutFormRow from "../layout-form-row/layout-form-row.component"; + +export default function ShopInfoTaskPresets({ form }) { + const { t } = useTranslation(); + + return ( + + + {(fields, { add, remove, move }) => { + return ( +
+ {fields.map((field, index) => ( + + + + + + + + + + + {t("joblines.fields.lbr_types.LAB")} + + + + + {t("joblines.fields.lbr_types.LAR")} + + + + + {t("joblines.fields.lbr_types.LAM")} + + + + + {t("joblines.fields.lbr_types.LAF")} + + + + + {t("joblines.fields.lbr_types.LAG")} + + + + + + + + + + + + + { + remove(field.name); + }} + /> + + + + + ))} + + + +
+ ); + }} +
+
+ ); +} diff --git a/client/src/components/time-ticket-task-modal/time-ticket-task-modal.container.jsx b/client/src/components/time-ticket-task-modal/time-ticket-task-modal.container.jsx index cc8ae83a6..09fffd9b2 100644 --- a/client/src/components/time-ticket-task-modal/time-ticket-task-modal.container.jsx +++ b/client/src/components/time-ticket-task-modal/time-ticket-task-modal.container.jsx @@ -52,6 +52,10 @@ export function TimeTickeTaskModalContainer({ }); async function handleFinish(values) { + console.log( + "🚀 ~ file: time-ticket-task-modal.container.jsx:55 ~ handleFinish ~ values:", + values + ); try { if (true) { const result = await insertTimeTicketApproval({ @@ -112,7 +116,6 @@ export function TimeTickeTaskModalContainer({ }, [context.jobid, queryJobInfo, visible]); const calculateTimeTickets = (presetMemo) => { - console.log("🚀 ~ file: time-ticket-task-modal.container.jsx:115 ~ calculateTimeTickets ~ presetMemo:", presetMemo) const formData = form.getFieldsValue(); if ( !formData.jobid || @@ -147,7 +150,7 @@ export function TimeTickeTaskModalContainer({ jobid: formData.jobid, rate: e.labor_rates[hourstype], actualhrs: 0, - memo: presetMemo, + memo: typeof presetMemo === "string" ? presetMemo : "", flat_rate: true, ciecacode: hourstype, cost_center: diff --git a/client/src/components/time-ticket-tasks-presets/time-ticket-tasks-presets.component.jsx b/client/src/components/time-ticket-tasks-presets/time-ticket-tasks-presets.component.jsx index 05a845926..b940ca972 100644 --- a/client/src/components/time-ticket-tasks-presets/time-ticket-tasks-presets.component.jsx +++ b/client/src/components/time-ticket-tasks-presets/time-ticket-tasks-presets.component.jsx @@ -1,12 +1,28 @@ import { Button, Dropdown } from "antd"; import React from "react"; -export default function TimeTicketsTasksPresets({ +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(TimeTicketsTasksPresets); + +export function TimeTicketsTasksPresets({ + bodyshop, form, calculateTimeTickets, }) { const handleClick = (props) => { - const preset = samplePresets.find((p) => { + const preset = bodyshop.md_tasks_presets?.presets?.find((p) => { return p.name === props.key; }); @@ -24,7 +40,12 @@ export default function TimeTicketsTasksPresets({ ({ label: p.name, key: p.name })), + items: bodyshop.md_tasks_presets?.presets + ? bodyshop.md_tasks_presets?.presets?.map((p) => ({ + label: p.name, + key: p.name, + })) + : [], onClick: handleClick, }} > @@ -33,19 +54,19 @@ export default function TimeTicketsTasksPresets({ ); } -const samplePresets = [ - { - name: "Teardown", - hourstype: ["LAB", "LAM"], - percent: 10, - memo: "Teardown Preset Task", - }, - { - name: "Disassembly", - hourstype: ["LAB", "LAD"], - percent: 20, - memo: "Disassy Preset Claim", - }, - { name: "Body", hourstype: ["LAB", "LAD"], percent: 20 }, - { name: "Prep", hourstype: ["LAR"], percent: 20 }, -]; +// const samplePresets = [ +// { +// name: "Teardown", +// hourstype: ["LAB", "LAM"], +// percent: 10, +// memo: "Teardown Preset Task", +// }, +// { +// name: "Disassembly", +// hourstype: ["LAB", "LAD"], +// percent: 20, +// memo: "Disassy Preset Claim", +// }, +// { name: "Body", hourstype: ["LAB", "LAD"], percent: 20 }, +// { name: "Prep", hourstype: ["LAR"], percent: 20 }, +// ]; diff --git a/client/src/graphql/bodyshop.queries.js b/client/src/graphql/bodyshop.queries.js index c934c9514..301ed6628 100644 --- a/client/src/graphql/bodyshop.queries.js +++ b/client/src/graphql/bodyshop.queries.js @@ -117,6 +117,7 @@ export const QUERY_BODYSHOP = gql` md_parts_scan enforce_conversion_category tt_enforce_hours_for_tech_console + md_tasks_presets employees { user_email id @@ -232,6 +233,7 @@ export const UPDATE_SHOP = gql` md_parts_scan enforce_conversion_category tt_enforce_hours_for_tech_console + md_tasks_presets employees { id first_name diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index 03b3a3075..9318f3d88 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -67,7 +67,7 @@ export const GET_LINE_TICKET_BY_PK = gql` clockoff rate committed_at - committed_by + commited_by employee { id first_name diff --git a/client/src/graphql/timetickets.queries.js b/client/src/graphql/timetickets.queries.js index 88c710a2b..0dec7c9e4 100644 --- a/client/src/graphql/timetickets.queries.js +++ b/client/src/graphql/timetickets.queries.js @@ -84,7 +84,7 @@ export const QUERY_TIME_TICKETS_IN_RANGE_SB = gql` memo jobid committed_at - committed_by + commited_by flat_rate job { id diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index b158ec418..0639c7b09 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -227,6 +227,7 @@ }, "bodyshop": { "actions": { + "add_task_preset": "Add Task Preset", "addapptcolor": "Add Appointment Color", "addbucket": "Add Definition", "addpartslocation": "Add Parts Location", @@ -339,6 +340,12 @@ }, "md_payment_types": "Payment Types", "md_referral_sources": "Referral Sources", + "md_tasks_presets": { + "hourstype": "Hour Types", + "memo": "Time Ticket Memo", + "name": "Preset Name", + "percent": "Percent" + }, "messaginglabel": "Messaging Preset Label", "messagingtext": "Messaging Preset Text", "noteslabel": "Note Label", @@ -592,6 +599,7 @@ "jobstatuses": "Job Statuses", "laborrates": "Labor Rates", "licensing": "Licensing", + "md_tasks_presets": "Tasks Presets", "md_to_emails": "Preset To Emails", "md_to_emails_emails": "Emails", "messagingpresets": "Messaging Presets", @@ -618,6 +626,7 @@ "speedprint": "Speed Print Configuration", "ssbuckets": "Job Size Definitions", "systemsettings": "System Settings", + "task-presets": "Task Presets", "workingdays": "Working Days" }, "successes": { @@ -919,11 +928,14 @@ }, "employee_teams": { "actions": { - "new": "New Team" + "new": "New Team", + "newmember": "New Team Member" }, "fields": { "active": "Active", - "name": "Team Name" + "employeeid": "Employee", + "name": "Team Name", + "percentage": "Percent" } }, "employees": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 5d7a7bf2e..1d2f81e58 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -227,6 +227,7 @@ }, "bodyshop": { "actions": { + "add_task_preset": "", "addapptcolor": "", "addbucket": "", "addpartslocation": "", @@ -339,6 +340,12 @@ }, "md_payment_types": "", "md_referral_sources": "", + "md_tasks_presets": { + "hourstype": "", + "memo": "", + "name": "", + "percent": "" + }, "messaginglabel": "", "messagingtext": "", "noteslabel": "", @@ -592,6 +599,7 @@ "jobstatuses": "", "laborrates": "", "licensing": "", + "md_tasks_presets": "", "md_to_emails": "", "md_to_emails_emails": "", "messagingpresets": "", @@ -618,6 +626,7 @@ "speedprint": "", "ssbuckets": "", "systemsettings": "", + "task-presets": "", "workingdays": "" }, "successes": { @@ -919,11 +928,14 @@ }, "employee_teams": { "actions": { - "new": "" + "new": "", + "newmember": "" }, "fields": { "active": "", - "name": "" + "employeeid": "", + "name": "", + "percentage": "" } }, "employees": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index f6a56ac38..57a2e32a8 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -227,6 +227,7 @@ }, "bodyshop": { "actions": { + "add_task_preset": "", "addapptcolor": "", "addbucket": "", "addpartslocation": "", @@ -339,6 +340,12 @@ }, "md_payment_types": "", "md_referral_sources": "", + "md_tasks_presets": { + "hourstype": "", + "memo": "", + "name": "", + "percent": "" + }, "messaginglabel": "", "messagingtext": "", "noteslabel": "", @@ -592,6 +599,7 @@ "jobstatuses": "", "laborrates": "", "licensing": "", + "md_tasks_presets": "", "md_to_emails": "", "md_to_emails_emails": "", "messagingpresets": "", @@ -618,6 +626,7 @@ "speedprint": "", "ssbuckets": "", "systemsettings": "", + "task-presets": "", "workingdays": "" }, "successes": { @@ -919,11 +928,14 @@ }, "employee_teams": { "actions": { - "new": "" + "new": "", + "newmember": "" }, "fields": { "active": "", - "name": "" + "employeeid": "", + "name": "", + "percentage": "" } }, "employees": {