fix(web): categorize queue excludes salary/income/transfers (only uncategorized spending)
This commit is contained in:
parent
3f42f21504
commit
ed4f7ca97b
2 changed files with 14 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue