From b2665425919d0ca5b009cb2a8fa316b49df712ee Mon Sep 17 00:00:00 2001 From: Kavi Date: Tue, 2 Jun 2026 04:28:09 -0400 Subject: [PATCH] Reclassify self-named transactions (VICENTETIRAD) as self_transfer --- web/engine.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/engine.js b/web/engine.js index ff08489..5e21f3e 100644 --- a/web/engine.js +++ b/web/engine.js @@ -134,13 +134,20 @@ // really internal movements — debt repayments to cards (the purchases already // happened on those cards; only interest/fees are new costs) and known // card-payment intermediaries (MACH→Servipag for Rappi card, etc.) + // Reclassify transactions that the raw parser tagged as 'expense' but are + // really internal movements. const DEBT_RE = /TRASPASO\s+(A\s+DEUDA|POR\s+CIERRE\s+DE\s+CUENTA|DE\s+DEUDA\b|DEUDA\s*(NACIONAL|INTERNACIONAL)?$)/i; const CPAY_RE = /PAGO\s+EN\s+SERVIPAG\.COM|COMPRA\s+MACH\s+COMERCIOS.*SERVIPAG/i; + // Transactions where the counterparty is the account holder themselves + const SELF_RE = /VICENTETIRAD|VICENTE\s*TIRAD/i; TX = TX.map(t => { if (t.flow_type !== 'expense') return t; if (DEBT_RE.test(t.description) || CPAY_RE.test(t.description)) { return { ...t, flow_type: 'card_payment', internal: true }; } + if (SELF_RE.test(t.description) || SELF_RE.test(t.counterparty || '')) { + return { ...t, flow_type: 'self_transfer', internal: true }; + } return t; }); MONTHS = [...new Set(TX.map(t => t.ym))].sort();