fix(finance): preserve visibility and settlement updates

This commit is contained in:
Felipe Coutinho
2026-03-25 00:29:36 +00:00
parent 5f70421f5a
commit 1e0c93fb6c
10 changed files with 18 additions and 3 deletions

View File

@@ -111,10 +111,11 @@ export function buildCategoryBreakdownData({
});
}
categories.sort((a, b) => b.currentAmount - a.currentAmount);
const filtered = categories.filter((c) => c.currentAmount > 0);
filtered.sort((a, b) => b.currentAmount - a.currentAmount);
return {
categories,
categories: filtered,
currentTotal,
previousTotal,
};

View File

@@ -111,6 +111,7 @@ export async function fetchCategoryDetails(
sanitizedNote,
eq(transactions.period, previousPeriod),
or(
isNull(transactions.note),
ne(transactions.note, INITIAL_BALANCE_NOTE),
isNull(financialAccounts.excludeInitialBalanceFromIncome),
eq(financialAccounts.excludeInitialBalanceFromIncome, false),

View File

@@ -50,6 +50,7 @@ export const excludeAutoGeneratedEntryNotes = () =>
export const excludeInitialBalanceWhenConfigured = () =>
or(
isNull(transactions.note),
ne(transactions.note, INITIAL_BALANCE_NOTE),
isNull(financialAccounts.excludeInitialBalanceFromIncome),
eq(financialAccounts.excludeInitialBalanceFromIncome, false),