From e86160e530f02fb965f03be5d32fc7560b9b194e Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Wed, 11 Aug 2021 08:06:51 -0700 Subject: [PATCH] IO-1307 Resolve table check error on export tables. --- .../accounting-payables-table.component.jsx | 1 + .../accounting-payments-table.component.jsx | 1 + .../accounting-receivables-table.component.jsx | 1 + .../jobs-close-export-button.component.jsx | 6 ++++++ .../payable-export-button.component.jsx | 6 ++++++ .../payment-export-button.component.jsx | 7 +++++++ 6 files changed, 22 insertions(+) diff --git a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx index 097c66bb4..c28c95ca1 100644 --- a/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx +++ b/client/src/components/accounting-payables-table/accounting-payables-table.component.jsx @@ -121,6 +121,7 @@ export default function AccountingPayablesTableComponent({ loading, bills }) { billId={record.id} disabled={transInProgress || !!record.exported} loadingCallback={setTransInProgress} + setSelectedBills={setSelectedBills} /> ), diff --git a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx index 94ca9e50b..be98297b6 100644 --- a/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx +++ b/client/src/components/accounting-payments-table/accounting-payments-table.component.jsx @@ -120,6 +120,7 @@ export default function AccountingPayablesTableComponent({ paymentId={record.id} disabled={transInProgress || !!record.exportedat} loadingCallback={setTransInProgress} + setSelectedPayments={setSelectedPayments} /> ), }, diff --git a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx index 6f3a2dce3..5492e83ec 100644 --- a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx +++ b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx @@ -125,6 +125,7 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) { diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index b6e2006f8..d790328ff 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -24,6 +24,7 @@ export function JobsCloseExportButton({ currentUser, jobId, disabled, + setSelectedJobs, }) { const { t } = useTranslation(); const [updateJob] = useMutation(UPDATE_JOB); @@ -147,6 +148,11 @@ export function JobsCloseExportButton({ }), }); } + if (setSelectedJobs) { + setSelectedJobs((selectedJobs) => { + return selectedJobs.filter((i) => i.id !== jobId); + }); + } } setLoading(false); diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index bdeaa4455..a25361256 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -25,6 +25,7 @@ export function PayableExportButton({ billId, disabled, loadingCallback, + setSelectedBills, }) { const { t } = useTranslation(); const [updateBill] = useMutation(UPDATE_BILLS); @@ -142,6 +143,11 @@ export function PayableExportButton({ }), }); } + if (setSelectedBills) { + setSelectedBills((selectedBills) => { + return selectedBills.filter((i) => i.id !== billId); + }); + } } if (!!loadingCallback) loadingCallback(false); diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index 3c0254180..f05c839d2 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -24,6 +24,7 @@ export function PaymentExportButton({ paymentId, disabled, loadingCallback, + setSelectedPayments, }) { const { t } = useTranslation(); const [updatePayment] = useMutation(UPDATE_PAYMENTS); @@ -141,6 +142,12 @@ export function PaymentExportButton({ }), }); } + + if (setSelectedPayments) { + setSelectedPayments((selectedBills) => { + return selectedBills.filter((i) => i.id !== paymentId); + }); + } } if (!!loadingCallback) loadingCallback(false);