From d2d2c83e7bf7d5b6117177d981613e649bab1945 Mon Sep 17 00:00:00 2001 From: renee-png Date: Tue, 9 Jun 2026 00:53:18 -0400 Subject: [PATCH] Accounting: refresh reports + General Ledger after posting a journal entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual journal entries post straight to the GL, but saving/deleting one only invalidated the journal-entries list — so the Reports data (P&L / Balance Sheet) and the General Ledger tab kept showing stale figures until a manual refresh. Invalidate reports-data and gl-journal-entries on save and delete too. Co-Authored-By: Claude Opus 4.8 --- src/pages/accounting/AccountingJournalEntriesPage.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/accounting/AccountingJournalEntriesPage.tsx b/src/pages/accounting/AccountingJournalEntriesPage.tsx index 518952d..94e0bb2 100644 --- a/src/pages/accounting/AccountingJournalEntriesPage.tsx +++ b/src/pages/accounting/AccountingJournalEntriesPage.tsx @@ -164,6 +164,10 @@ export default function AccountingJournalEntriesPage() { setOpen(false); resetForm(); qc.invalidateQueries({ queryKey: ["journal-entries", cid] }); + // Manual JEs post straight to the GL, so refresh anything built from it: + // the Reports data (P&L / Balance Sheet) and the General Ledger tab. + qc.invalidateQueries({ queryKey: ["reports-data", cid] }); + qc.invalidateQueries({ queryKey: ["gl-journal-entries", cid] }); }; const deleteEntry = async (id: string) => { @@ -173,6 +177,10 @@ export default function AccountingJournalEntriesPage() { toast.success("Journal entry deleted"); if (detailId === id) setDetailId(null); qc.invalidateQueries({ queryKey: ["journal-entries", cid] }); + // Manual JEs post straight to the GL, so refresh anything built from it: + // the Reports data (P&L / Balance Sheet) and the General Ledger tab. + qc.invalidateQueries({ queryKey: ["reports-data", cid] }); + qc.invalidateQueries({ queryKey: ["gl-journal-entries", cid] }); }; if (!associationId) return

Select an association.

;