From dca587d6e07c5527735d8334c5d9a824633db6da Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 1 Apr 2024 13:20:30 -0700 Subject: [PATCH 01/10] IO-2730 Bill Search Result Align Signed-off-by: Allan Carr --- client/src/pages/bills/bills.page.component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/pages/bills/bills.page.component.jsx b/client/src/pages/bills/bills.page.component.jsx index 43e199ae5..d9d47f936 100644 --- a/client/src/pages/bills/bills.page.component.jsx +++ b/client/src/pages/bills/bills.page.component.jsx @@ -241,7 +241,7 @@ export function BillsListPage({ extra={ {search.search && ( - <> + {t("general.labels.searchresults", { search: search.search })} @@ -254,7 +254,7 @@ export function BillsListPage({ > {t("general.actions.clear")} - + )} )} - + } > {!context || (context && !context.id) ? null : ( From 04315a904579d05a24a86f847f203d94f13cea7f Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 1 Apr 2024 14:07:58 -0700 Subject: [PATCH 03/10] IO-2563 Repair LIne Expander Bills Translation Signed-off-by: Allan Carr --- .../job-detail-lines/job-lines-expander.component.jsx | 2 +- client/src/translations/en_us/common.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/components/job-detail-lines/job-lines-expander.component.jsx b/client/src/components/job-detail-lines/job-lines-expander.component.jsx index 06e00c729..9c5fd608e 100644 --- a/client/src/components/job-detail-lines/job-lines-expander.component.jsx +++ b/client/src/components/job-detail-lines/job-lines-expander.component.jsx @@ -84,7 +84,7 @@ export default function JobLinesExpander({ jobline, jobid }) { )) ) : ( - {t("parts_orders.labels.notyetordered")} + {t("bills.labels.nobilllines")} )} diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 210f04c0f..447cb881d 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -217,8 +217,9 @@ "markexported": "Mark Exported", "markforreexport": "Mark for Re-export", "new": "New Bill", + "nobilllines": "This part has not yet been recieved.", "noneselected": "No bill selected.", - "onlycmforinvoiced": "Only credit memos can be entered for any Job that has been invoiced, exported, or voided.", + "onlycmforinvoiced": "Only credit memos can be entered for any Job that has been invoiced, exported, or voided.", "printlabels": "Print Labels", "retailtotal": "Bills Retail Total", "savewithdiscrepancy": "You are about to save this bill with a discrepancy. The system will continue to use the calculated amount using the bill lines. Press cancel to return to the bill.", From 817c41afb98e6c7a2c9900514f1c55b7aaae76e8 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 1 Apr 2024 14:27:25 -0700 Subject: [PATCH 04/10] IO-2552 PVRT Button Spacing and Alignment Signed-off-by: Allan Carr --- .../ca-bc-pvrt-calculator.component.jsx | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/client/src/components/ca-bc-pvrt-calculator/ca-bc-pvrt-calculator.component.jsx b/client/src/components/ca-bc-pvrt-calculator/ca-bc-pvrt-calculator.component.jsx index 0a1476ee5..887ece76b 100644 --- a/client/src/components/ca-bc-pvrt-calculator/ca-bc-pvrt-calculator.component.jsx +++ b/client/src/components/ca-bc-pvrt-calculator/ca-bc-pvrt-calculator.component.jsx @@ -1,8 +1,8 @@ -import React, { useState } from "react"; -import { Button, Form, InputNumber, Popover } from "antd"; -import { logImEXEvent } from "../../firebase/firebase.utils"; -import { useTranslation } from "react-i18next"; import { CalculatorFilled } from "@ant-design/icons"; +import { Button, Form, InputNumber, Popover, Space } from "antd"; +import React, { useState } from "react"; +import { useTranslation } from "react-i18next"; +import { logImEXEvent } from "../../firebase/firebase.utils"; export default function CABCpvrtCalculator({ disabled, form }) { const [visibility, setVisibility] = useState(false); @@ -26,10 +26,14 @@ export default function CABCpvrtCalculator({ disabled, form }) { - - +
+ + + + +
); From 7d1910086eed0cb6406595106f0ce0fc5f569025 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 2 Apr 2024 10:39:41 -0700 Subject: [PATCH 05/10] IO-2553 Unsaved Changes on Edit CC Signed-off-by: Allan Carr --- .../courtesy-car-form/courtesy-car-form.component.jsx | 10 +++++++--- client/src/graphql/courtesy-car.queries.js | 2 +- .../courtesy-car-create.page.container.jsx | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/client/src/components/courtesy-car-form/courtesy-car-form.component.jsx b/client/src/components/courtesy-car-form/courtesy-car-form.component.jsx index f9a32dfee..6c223353a 100644 --- a/client/src/components/courtesy-car-form/courtesy-car-form.component.jsx +++ b/client/src/components/courtesy-car-form/courtesy-car-form.component.jsx @@ -10,11 +10,15 @@ import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel import CourtesyCarReadiness from "../courtesy-car-readiness-select/courtesy-car-readiness-select.component"; import CourtesyCarStatus from "../courtesy-car-status-select/courtesy-car-status-select.component"; import FormDatePicker from "../form-date-picker/form-date-picker.component"; -//import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component"; +import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-alert.component"; import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; -export default function CourtesyCarCreateFormComponent({ form, saveLoading }) { +export default function CourtesyCarCreateFormComponent({ + form, + saveLoading, + newCC, +}) { const { t } = useTranslation(); const client = useApolloClient(); @@ -33,7 +37,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) { } /> - {/* */} + {newCC ? null : } - + ); From 37196e65c3ec98219cf4d85b2a4980ae2231badd Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 3 Apr 2024 09:46:52 -0700 Subject: [PATCH 06/10] Add schema changes for RO Guard to bodyshop table. --- hasura/metadata/tables.yaml | 2 ++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 3 files changed, 8 insertions(+) create mode 100644 hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/down.sql create mode 100644 hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/up.sql diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 38dff43fa..7a9de6b10 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -969,6 +969,7 @@ - md_rbac - md_referral_sources - md_responsibility_centers + - md_ro_guard - md_ro_statuses - md_tasks_presets - md_to_emails @@ -1068,6 +1069,7 @@ - md_rbac - md_referral_sources - md_responsibility_centers + - md_ro_guard - md_ro_statuses - md_tasks_presets - md_to_emails diff --git a/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/down.sql b/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/down.sql new file mode 100644 index 000000000..8f554a895 --- /dev/null +++ b/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/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_ro_guard" jsonb +-- null default jsonb_build_object(); diff --git a/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/up.sql b/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/up.sql new file mode 100644 index 000000000..a932a2446 --- /dev/null +++ b/hasura/migrations/1712162752434_alter_table_public_bodyshops_add_column_md_ro_guard/up.sql @@ -0,0 +1,2 @@ +alter table "public"."bodyshops" add column "md_ro_guard" jsonb + null default jsonb_build_object(); From 1f5c1b9658f636eb6b3c6c43d4e7b748005f8761 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 4 Apr 2024 17:00:30 -0700 Subject: [PATCH 07/10] IO-2750 Missing Mutation return fields Signed-off-by: Allan Carr --- client/src/graphql/jobs-lines.queries.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/graphql/jobs-lines.queries.js b/client/src/graphql/jobs-lines.queries.js index c3b9ddfcb..cb4b6d06e 100644 --- a/client/src/graphql/jobs-lines.queries.js +++ b/client/src/graphql/jobs-lines.queries.js @@ -172,6 +172,12 @@ export const UPDATE_JOB_LINE = gql` id notes mod_lbr_ty + mod_lb_hrs + part_type + op_code_desc + prt_dsmk_m + prt_dsmk_p + tax_part part_qty db_price act_price From b5a371d0cfe815c941a69e525ea1334994ffe8ae Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Fri, 5 Apr 2024 12:01:26 -0700 Subject: [PATCH 08/10] IO-2568 Button Padding in Print Center Label Modal Signed-off-by: Allan Carr --- .../print-center-jobs-labels.component.jsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx b/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx index 5bd0f15e5..c42756de9 100644 --- a/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx +++ b/client/src/components/print-center-jobs-labels/print-center-jobs-labels.component.jsx @@ -6,6 +6,7 @@ import { notification, Popover, Radio, + Space, } from "antd"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; @@ -115,10 +116,16 @@ export function PrintCenterJobsLabels({ bodyshop, jobId }) { > - - +
+ + + + +
); From c3b395c99e2202fe9ce4598a5f5a04189e1fc688 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Mon, 8 Apr 2024 09:53:20 -0700 Subject: [PATCH 09/10] IO-2749 Pass Jobs data from Parts Return to Parts Order Modal Signed-off-by: Allan Carr --- .../bill-detail-edit/bill-detail-edit-return.component.jsx | 1 + .../components/bills-list-table/bills-list-table.component.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx index 87ea3e730..1121d9779 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit-return.component.jsx @@ -45,6 +45,7 @@ export function BillDetailEditReturn({ actions: {}, context: { jobId: data.bills_by_pk.jobid, + job: data.bills_by_pk.job, vendorId: data.bills_by_pk.vendorid, returnFromBill: data.bills_by_pk.id, invoiceNumber: data.bills_by_pk.invoice_number, diff --git a/client/src/components/bills-list-table/bills-list-table.component.jsx b/client/src/components/bills-list-table/bills-list-table.component.jsx index 5f5bd7011..621fe8e8e 100644 --- a/client/src/components/bills-list-table/bills-list-table.component.jsx +++ b/client/src/components/bills-list-table/bills-list-table.component.jsx @@ -60,7 +60,7 @@ export function BillsListTableComponent({ )} Date: Mon, 8 Apr 2024 12:23:04 -0700 Subject: [PATCH 10/10] IO-2731 Payment Edit Signed-off-by: Allan Carr --- .../payment-mark-export-button-component.jsx | 19 ++++++++--- .../payment-modal/payment-modal.container.jsx | 17 ++++++---- .../payment-reexport-button.component.jsx | 33 +++++++++++++++---- .../payment-list-paginated.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 + 7 files changed, 59 insertions(+), 20 deletions(-) diff --git a/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx b/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx index 5f8cb395a..5ffdc58ee 100644 --- a/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx +++ b/client/src/components/payment-mark-export-button/payment-mark-export-button-component.jsx @@ -7,10 +7,12 @@ import { createStructuredSelector } from "reselect"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; import { setModalContext } from "../../redux/modals/modals.actions"; +import { selectPayment } from "../../redux/modals/modals.selectors"; import { selectCurrentUser } from "../../redux/user/user.selectors"; const mapStateToProps = createStructuredSelector({ currentUser: selectCurrentUser, + paymentModal: selectPayment, }); const mapDispatchToProps = (dispatch) => ({ @@ -24,6 +26,7 @@ const PaymentMarkForExportButton = ({ refetch, setPaymentContext, currentUser, + paymentModal, }) => { const { t } = useTranslation(); const [insertExportLog, { loading: exportLogLoading }] = @@ -65,16 +68,22 @@ const PaymentMarkForExportButton = ({ refetch, }, context: { + ...paymentModal.context, ...payment, exportedat: today, }, }); - if (refetch) - refetch( - paymentUpdateResponse && - paymentUpdateResponse.data.update_payments.returning[0] - ); + if (refetch) { + if (paymentModal.context.refetchRequiresContext) { + refetch( + paymentUpdateResponse && + paymentUpdateResponse.data.update_payments.returning[0] + ); + } else { + refetch(); + } + } } else { notification["error"]({ message: t("payments.errors.exporting", { diff --git a/client/src/components/payment-modal/payment-modal.container.jsx b/client/src/components/payment-modal/payment-modal.container.jsx index e53894920..11666914d 100644 --- a/client/src/components/payment-modal/payment-modal.container.jsx +++ b/client/src/components/payment-modal/payment-modal.container.jsx @@ -97,16 +97,21 @@ function PaymentModalContainer({ }); if (!!!updatedPayment.errors) { - notification["success"]({ message: t("payments.successes.payment") }); + notification["success"]({ message: t("payments.successes.paymentupdate") }); } else { - notification["error"]({ message: t("payments.errors.payment") }); + notification["error"]({ message: t("payments.errors.paymentupdate") }); } } - if (actions.refetch) - actions.refetch( - updatedPayment && updatedPayment.data.update_payments.returning[0] - ); + if (actions.refetch) { + if (context.refetchRequiresContext) { + actions.refetch( + updatedPayment && updatedPayment.data.update_payments.returning[0] + ); + } else { + actions.refetch(); + } + } if (enterAgain) { const prev = form.getFieldsValue(["date"]); diff --git a/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx b/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx index a7434e76d..fa6063d67 100644 --- a/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx +++ b/client/src/components/payment-reexport-button/payment-reexport-button.component.jsx @@ -3,15 +3,25 @@ import { Button, notification } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; import { UPDATE_PAYMENT } from "../../graphql/payments.queries"; import { setModalContext } from "../../redux/modals/modals.actions"; +import { selectPayment } from "../../redux/modals/modals.selectors"; +const mapStateToProps = createStructuredSelector({ + paymentModal: selectPayment, +}); const mapDispatchToProps = (dispatch) => ({ setPaymentContext: (context) => dispatch(setModalContext({ context: context, modal: "payment" })), }); -const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { +const PaymentReexportButton = ({ + paymentModal, + payment, + refetch, + setPaymentContext, +}) => { const { t } = useTranslation(); const [updatePayment, { loading }] = useMutation(UPDATE_PAYMENT); @@ -35,15 +45,21 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { refetch, }, context: { + ...paymentModal.context, ...payment, exportedat: null, }, }); - if (refetch) - refetch( - paymentUpdateResponse && - paymentUpdateResponse.data.update_payments.returning[0] - ); + if (refetch) { + if (paymentModal.context.refetchRequiresContext) { + refetch( + paymentUpdateResponse && + paymentUpdateResponse.data.update_payments.returning[0] + ); + } else { + refetch(); + } + } } else { notification["error"]({ message: t("payments.errors.exporting", { @@ -64,4 +80,7 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => { ); }; -export default connect(null, mapDispatchToProps)(PaymentReexportButton); +export default connect( + mapStateToProps, + mapDispatchToProps +)(PaymentReexportButton); 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 86ad50cb8..6fdfd108a 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 @@ -14,11 +14,11 @@ import { selectBodyshop } from "../../redux/user/user.selectors"; import CurrencyFormatter from "../../utils/CurrencyFormatter"; import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter"; import { TemplateList } from "../../utils/TemplateConstants"; +import { pageLimit } from "../../utils/config"; import { alphaSort } from "../../utils/sorters"; import CaBcEtfTableModalContainer from "../ca-bc-etf-table-modal/ca-bc-etf-table-modal.container"; import OwnerNameDisplay from "../owner-name-display/owner-name-display.component"; import PrintWrapperComponent from "../print-wrapper/print-wrapper.component"; -import {pageLimit} from "../../utils/config"; const mapStateToProps = createStructuredSelector({ //currentUser: selectCurrentUser @@ -184,7 +184,10 @@ export function PaymentsListPaginated({ } : refetch, }, - context: apolloResults ? apolloResults : record, + context: { + ...(apolloResults ? apolloResults : record), + refetchRequiresContext: true, + }, }); }} > diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 210f04c0f..d54e65c1a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -2332,6 +2332,7 @@ "markexported": "Payment(s) marked exported.", "markreexported": "Payment marked for re-export successfully", "payment": "Payment created successfully. ", + "paymentupdate": "Payment updated successfully. ", "stripe": "Credit card transaction charged successfully." } }, diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index d1a760146..30ab017ba 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -2331,6 +2331,7 @@ "markexported": "", "markreexported": "", "payment": "", + "paymentupdate": "", "stripe": "" } }, diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 87253cf17..8a77e2231 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -2331,6 +2331,7 @@ "markexported": "", "markreexported": "", "payment": "", + "paymentupdate": "", "stripe": "" } },