fix(web): categorize queue excludes salary/income/transfers (only uncategorized spending)

This commit is contained in:
Munkherdene 2026-08-23 00:26:56 +08:00
parent 3f42f21504
commit ed4f7ca97b
2 changed files with 14 additions and 1 deletions

View file

@ -34,6 +34,11 @@ function buildQueue(txns: Txn[]): ReviewItem[] {
const groups = new Map<string, ReviewItem>();
for (const t of txns) {
if (t.category) continue; // defensive — the fetch already scopes to Uncategorized
// Only uncategorized SPENDING needs sorting. Salary (auto-detected income),
// any income, and transfers between accounts are not expenses to categorize.
if (t.salary === true) continue;
if (t.direction === "income") continue;
if (t.transfer === true) continue;
const key = t.matchKey || t.title;
if (!key) continue;
const amount = parseFloat(t.amount) || 0;

View file

@ -163,7 +163,15 @@ export function TransactionList() {
const categoryOptions = useMemo(() => categoriesIn(all), [all]);
const hasUncategorized = useMemo(
() => all.some((txn) => !txn.category && (txn.matchKey || txn.title)),
() =>
all.some(
(txn) =>
!txn.category &&
txn.salary !== true &&
txn.transfer !== true &&
txn.direction !== "income" &&
(txn.matchKey || txn.title),
),
[all],
);