From b4014f378ce82de4996454f0e59da293978cca69 Mon Sep 17 00:00:00 2001 From: renee-png Date: Fri, 12 Jun 2026 20:38:00 -0400 Subject: [PATCH] Payment accounts can be equity; archived accounts excluded from all dropdowns - Bill payment + expense paid-through pickers now offer bank OR equity accounts (reserve-component style payments); label updated to 'Payment account' - is_archived=false filter added to every accounting account dropdown: journal entries, bills (expense + payment), expenses, invoices/sales receipts/receive payments deposit-to, deposits (bank + line source), assessments, opening balances, budget detail, reconciliation Co-Authored-By: Claude Opus 4.8 --- src/pages/accounting/AccountingAssessmentsPage.tsx | 2 +- src/pages/accounting/AccountingBillsPage.tsx | 10 ++++++---- src/pages/accounting/AccountingBudgetDetailPage.tsx | 2 +- src/pages/accounting/AccountingDepositsPage.tsx | 4 ++-- src/pages/accounting/AccountingExpensesPage.tsx | 3 ++- src/pages/accounting/AccountingInvoicesPage.tsx | 1 + src/pages/accounting/AccountingJournalEntriesPage.tsx | 2 +- src/pages/accounting/AccountingOpeningBalancesPage.tsx | 2 +- src/pages/accounting/AccountingReceivePaymentsPage.tsx | 2 +- src/pages/accounting/AccountingReconcileDetailPage.tsx | 2 +- src/pages/accounting/AccountingSalesReceiptsPage.tsx | 3 ++- 11 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/pages/accounting/AccountingAssessmentsPage.tsx b/src/pages/accounting/AccountingAssessmentsPage.tsx index ddb9b5b..849569c 100644 --- a/src/pages/accounting/AccountingAssessmentsPage.tsx +++ b/src/pages/accounting/AccountingAssessmentsPage.tsx @@ -55,7 +55,7 @@ export default function AccountingAssessmentsPage() { queryKey: ["income-accounts", cid], enabled: !!cid, queryFn: async () => - (await accounting.from("accounts").select("id,name,code").eq("company_id", cid).eq("type", "income").order("code")).data ?? [], + (await accounting.from("accounts").select("id,name,code").eq("company_id", cid).eq("type", "income").eq("is_archived", false).order("code")).data ?? [], }); const allSelected = selectedHomeowners.size === (homeowners as any[]).length && (homeowners as any[]).length > 0; diff --git a/src/pages/accounting/AccountingBillsPage.tsx b/src/pages/accounting/AccountingBillsPage.tsx index 936037e..c5285ec 100644 --- a/src/pages/accounting/AccountingBillsPage.tsx +++ b/src/pages/accounting/AccountingBillsPage.tsx @@ -89,7 +89,7 @@ export default function AccountingBillsPage() { queryKey: ["expense-accounts", cid], enabled: !!cid, queryFn: async () => - (await accounting.from("accounts").select("id,name,code,type").eq("company_id", cid).eq("type", "expense").order("code")).data ?? [], + (await accounting.from("accounts").select("id,name,code,type").eq("company_id", cid).eq("type", "expense").eq("is_archived", false).order("code")).data ?? [], }); const enriched = useMemo( @@ -320,7 +320,9 @@ export default function AccountingBillsPage() { queryKey: ["bank-accounts", cid], enabled: !!cid, queryFn: async () => - (await accounting.from("accounts").select("id,name,code,balance,is_bank").eq("company_id", cid).eq("is_bank", true).order("code")).data ?? [], + // Payment accounts: banks plus equity accounts (e.g. reserve components + // paid directly from equity). Archived accounts never appear. + (await accounting.from("accounts").select("id,name,code,balance,is_bank,type").eq("company_id", cid).or("is_bank.eq.true,type.eq.equity").eq("is_archived", false).order("code")).data ?? [], }); const openPayment = async (b: any) => { @@ -404,7 +406,7 @@ export default function AccountingBillsPage() { }; const savePayment = async () => { - if (!payBill || !payAccountId) return toast.error("Bank account required"); + if (!payBill || !payAccountId) return toast.error("Payment account required"); if (!payAmount || payAmount <= 0) return toast.error("Invalid amount"); setPaying(true); try { @@ -810,7 +812,7 @@ export default function AccountingBillsPage() {
- +