Reclassify self-named transactions (VICENTETIRAD) as self_transfer
This commit is contained in:
parent
fae5af446f
commit
b266542591
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue