From 1f5c1b9658f636eb6b3c6c43d4e7b748005f8761 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Thu, 4 Apr 2024 17:00:30 -0700 Subject: [PATCH 1/4] 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 2/4] 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 3/4] 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 4/4] 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": "" } },