Hide system equity accounts from Accounts page
System accounts (Operating Fund Balance, Reserve Fund Balance) are auto-created as double-entry offsets when users set initial balances. They don't represent real bank accounts and were confusing to see alongside actual accounts. Now filtered from account lists, tab counts, and summary card totals. They remain active under the covers for journal entries and are still visible on the Balance Sheet report where equity belongs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -388,7 +388,9 @@ export function AccountsPage() {
|
||||
};
|
||||
|
||||
// ── Filtering ──
|
||||
// Hide system accounts (auto-created equity offsets) from the accounts view
|
||||
const filtered = accounts.filter((a) => {
|
||||
if (a.is_system) return false;
|
||||
if (search && !a.name.toLowerCase().includes(search.toLowerCase()) && !String(a.account_number).includes(search)) return false;
|
||||
if (filterType && a.account_type !== filterType) return false;
|
||||
if (filterFund && a.fund_type !== filterFund) return false;
|
||||
@@ -403,9 +405,10 @@ export function AccountsPage() {
|
||||
const reserveInvestments = investments.filter((i) => i.fund_type === 'reserve' && i.is_active);
|
||||
|
||||
// ── Summary cards ──
|
||||
// Exclude system accounts from summaries to avoid double-counting
|
||||
const totalsByType = accounts.reduce(
|
||||
(acc, a) => {
|
||||
if (a.is_active) {
|
||||
if (a.is_active && !a.is_system) {
|
||||
acc[a.account_type] = (acc[a.account_type] || 0) + parseFloat(a.balance || '0');
|
||||
}
|
||||
return acc;
|
||||
|
||||
Reference in New Issue
Block a user