Deferred-debit credit cards: month-to-month balance is cumulative and never resets (absurd historical values)
Summary
For deferred-debit credit cards, purchases accumulate during the month and are debited in one go on a fixed settlement date: the checking account is charged and the card balance resets to ~0. Sure does not reproduce this: the month-to-month balance is cumulative instead of resetting, which produces absurd historical values.
Observed on a real account (sure v0.7.4): the card ledger contained duplicated postings (authorization + monthly re-listing of the same purchases). Even after cleaning them, the reverse-walked history never returns to ~0 at the settlement dates, and the day-1 balance shows ≈ -2 893 € (before any transaction) — a value that matches the accumulated settlements booked on the checking account but never recorded on the card side.
Real-world behavior
- Card purchases accumulate during the month.
- On the fixed settlement date:
- the checking account is debited with one aggregated line (the "card settlement" of the period);
- the card balance resets to ~0.
- The bank never books the settlement on the card account: the OpenBanking/Enable Banking feed only contains the authorization posting and the statement re-listing (both positive). The bank's own app presents the monthly settlement as an envelope around the detailed card operations.
Problem
The balance series of a linked deferred-debit card is derived by the reverse calculator, seeded from the current provider balance (the daily current_anchor). Because the card ledger never receives the monthly settlement as an inflow:
- the historical balance accumulates every purchase and never drops back to ~0 at the settlement date;
- the day-1 value becomes a meaningless cumulative residual (≈ -2 893 € in our case) instead of the real opening value (the account opens at 0 by default, which is correct);
- the longer the account runs, the more the historical series drifts and looks absurd, and
auto_match_transfers!cannot fix it because the aggregated settlement line (checking account) cannot be paired 1:1 with the itemized card purchases.
Expected behavior
A deferred-debit card's balance history should follow the real sawtooth: accumulate during the month, then reset to ~0 on the settlement date — consistent with the provider-reported card balance (the current_anchor/reconciliation waypoints already capture the reset going forward; the gap is the historical reconstruction).
Proposed options
- A. Product feature (recommended): model "deferred-debit card" accounts with a configurable settlement day (or use the reconciliation/current-anchor waypoints) so the balance series resets at the monthly boundary.
- B. Provider data: investigate whether the OpenBanking/Enable Banking data can expose the settlement relation ("envelope") on the card side — see the
additionalInformationfindings in #3274 (not part of the Enable Banking schema). - C. Data hygiene: make imports idempotent/content-deduplicated (see #954) so double imports never re-create card twins without an
external_id; #3644 is directly related (an import can silently destroy an opening anchor).
Related issues / PRs
- #954 — Enable Banking duplicate transactions (closed; fix present in v0.7.4)
- #3274 — discard the merchant-view row of a card purchase (N26) — unmerged
- #3284 — review/remove duplicate merchant-side card transactions (cleanup screen) — draft
- #3644 — CSV import silently destroys an account's opening anchor
- #3711 — Fix opening balance amount and ordering for same-day entries
Workaround used (for the record)
- Removed duplicated postings (kept provider-declared rows + deduplicated non-provider rows) and set the opening anchor to 0.00 on the day before the first transaction (via a QIF import containing an
Opening Balancerecord, the only native path to create one on an existing account; the wizard requiresrows_count > 0, so a dummy transaction line is needed and can be deleted right after). - These fixes make the START correct, but the month-to-month cumulative history described above remains the core issue.
Source: we-promise/sure