From cd340aa3ac865a4e7ae7fd2b570b08c35d3ea7dc Mon Sep 17 00:00:00 2001 From: Bill Ballou Date: Sun, 22 Mar 2026 13:32:14 -0400 Subject: [PATCH] Fix spending-by-category counting transfers as uncategorized spending Inter-account transfers have no category and a non-null transfer_id. The spending-by-category command was only filtering out positive amounts (income) but not transfers, causing the negative side of each transfer to appear as "Uncategorized" spending. --- scripts/actual-query.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/actual-query.mjs b/scripts/actual-query.mjs index ed7d395..834d9d9 100644 --- a/scripts/actual-query.mjs +++ b/scripts/actual-query.mjs @@ -208,6 +208,7 @@ async function main() { const txns = await api.getTransactions(acct.id, startDate, endDate); for (const t of txns) { if (t.amount >= 0) continue; // skip income + if (t.transfer_id) continue; // skip inter-account transfers const catName = categoryMap[t.category] || 'Uncategorized'; spending[catName] = (spending[catName] || 0) + t.amount; }