From 6ad7688fbdaca0e6a181504790e1d4deee204aa5 Mon Sep 17 00:00:00 2001 From: renee-png Date: Sat, 13 Jun 2026 11:02:06 -0400 Subject: [PATCH] Reconciliation: clear any uncleared item regardless of billed date MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A transaction's billed date no longer gates which reconciliation it can clear in — items billed in one period frequently clear the bank in another. The reconcile list now shows every uncleared, non-voided item for the account (reconciliation_id is null), dropping the date <= statement_end_date ceiling. Finalized items still carry a reconciliation_id and drop off. Co-Authored-By: Claude Opus 4.8 --- .../accounting/AccountingReconcileDetailPage.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/accounting/AccountingReconcileDetailPage.tsx b/src/pages/accounting/AccountingReconcileDetailPage.tsx index 684ff2b..cfb7f6b 100644 --- a/src/pages/accounting/AccountingReconcileDetailPage.tsx +++ b/src/pages/accounting/AccountingReconcileDetailPage.tsx @@ -137,20 +137,20 @@ export default function AccountingReconcileDetailPage() { }); const { data: txs = [] } = useQuery({ - queryKey: ["recon-txs", accountId, active?.statement_end_date, priorReconDate], + queryKey: ["recon-txs", accountId], enabled: !!accountId && !!active, queryFn: async () => { - // Show every item not yet tied to a completed reconciliation, on/before the - // statement date — INCLUDING outstanding items from prior periods. Items - // that were finalized get a reconciliation_id and drop off; uncleared ones - // carry forward until they clear. Voided items are excluded entirely. + // Show EVERY uncleared item for this account, regardless of its (billed) + // date — a transaction billed in one period often clears the bank in + // another, so the transaction date must not gate which reconciliation it + // can be cleared in. The only constraints: not already finalized into a + // completed reconciliation (reconciliation_id is null) and not voided. const { data } = await accounting .from("transactions") .select("id,date,description,reference,amount,type,cleared,reconciliation_id,voided") .eq("account_id", accountId) .is("reconciliation_id", null) .eq("voided", false) - .lte("date", active!.statement_end_date) .order("date"); return (data ?? []) as Tx[]; }, @@ -514,7 +514,7 @@ export default function AccountingReconcileDetailPage() { })} {filtered.length === 0 && ( - No unreconciled transactions in this period. + No unreconciled transactions for this account. )}