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. )}