Booking date vs. accrual period: when did you really earn it?
Open almost any budgeting app and look at your monthly income over a year. There’s a good chance you’ll find a month with two salaries and a month with none. You didn’t get a bonus, and you weren’t unpaid. Your employer simply paid February’s salary on 1 March because the last day of February fell on a weekend.
It’s a small calendar accident, and it wrecks two months of reports: one looks unusually rich, the other looks like a crisis, and your savings rate swings for no real reason. When we designed Ahorreo, we decided that this wasn’t a user error and wasn’t the bank’s fault either. It’s a modelling problem: the date a bank books a transaction and the month it belongs to are two different things.
Two dates, two jobs
Every transaction in Ahorreo carries two pieces of time information:
- The booking date: when the bank recorded it. It comes from the statement and never changes.
- The accrual period: the month it belongs to in your reports. By default it’s the month of the booking date.
Monthly reports, budgets and savings rates are grouped by accrual period. Balance reconciliation, on the other hand, always uses the booking date: your bank knows nothing about accrual periods, and a balance on a given day is a fact about that day. The balance also stops at today. A statement can contain rows dated next week, and a movement that hasn’t happened yet isn’t part of what you have.
Each transaction also records why its accrual period is what it is. There are five possible sources, from src/domain/types.ts:
| Source | Meaning |
|---|---|
default | The month of the booking date |
payroll-rule | Moved by the salary rule below |
card-cycle | The settlement row of a credit card cycle |
refund | Moved to the month of the charge it undoes |
user | You set it by hand |
That last one matters most. When the rules change later, any period you set yourself is left alone.
The transaction list stays honest
The list of transactions always shows the real date the money moved. When the accrual period differs, it says so next to the date, and "Change the month it counts in" lets you correct it. Nothing is hidden or rewritten; the app just files it in the right month.
Case 1: salaries
For income that looks like a salary, Ahorreo applies a simple rule with two thresholds, both in Settings. By default, a payment on or before the 10th belongs to the previous month, and anything later stays in the month it was paid. This is the real function, from src/domain/accrual.ts:
export function payrollAccrual(date: IsoDate, rule: Settings['payrollAccrual']): AccrualResult {
const day = dayOf(date);
const period = periodOf(date);
if (day <= rule.lateDayMax) return { period: addMonths(period, -1), source: 'payroll-rule' };
return { period, source: 'payroll-rule' };
}
The test file pins down what that means with the default of 10:
| Paid on | Counts in |
|---|---|
| 1 March 2026 | February 2026 |
| 10 March 2026 | February 2026 |
| 11 March 2026 | March 2026 |
| 25 March 2026 | March 2026 |
| 5 January 2026 | December 2025 |
The last row is the one that’s easy to get wrong by hand: a salary paid in early January is December’s, and it moves into the previous year. Another test pays twelve salaries on the 28th of each month and checks that they land in twelve different months.
What counts as a salary
The rule only applies to income whose description matches a short list of patterns: “nómina” (with or without the accent), “payroll”, “salari” and “sueldo”. It has to be income, too: an expense with “nómina” in its description stays in its own month, and a test checks exactly that.
The two thresholds are validated before they’re saved. The day up to which a payment belongs to the previous month must be between 1 and 28, and the second threshold between 2 and 31. If the first reaches or passes the second, some days would match both conditions and the result would depend on which check ran first, so the configuration is rejected instead.
Changing the rule without rewriting history
If you change a threshold after importing a year of statements, some salaries will move month. Ahorreo shows how many would change, and which ones, before applying anything (previewAccrualChange). Periods you set by hand are skipped in that preview and never touched.
You may not need to find this setting at all. When the app sees salaries bunching up (two in one month and none in another), it shows a suggestion titled “Your salary jumps between months”, with a button to turn on the payroll rule.
Case 2: credit cards
Credit cards produce the same distortion in reverse. You buy something on 28 March; the card’s cycle closes, and the total is charged to your current account in April. If you only import your current account, all you see is one lump in April.
Ahorreo treats a credit card with a billing cycle as its own account. Purchases are transactions of the card, dated when you made them, so the purchase on 28 March is March spending, because that’s when you decided to spend. The lump-sum charge on your current account becomes an internal transfer to the card, matched against the cycle it settles. It’s not spending, because the spending already happened when you bought things.
Which cycle a purchase belongs to depends on two numbers you give the card: the closing day and the charge day. cycleFor in src/domain/cards/cycle.ts assigns each purchase to the first cycle that closes on or after its date. Two examples for the same purchase on 28 March 2026:
| Closing day | Charge day | Cycle | Charged on |
|---|---|---|---|
| 31 | 1 | 1 March to 31 March | 1 April |
| 25 | 1 | 26 March to 25 April | 1 May |
In both cases the purchase still counts in March. Only the settlement date changes. A closing day of 31 is clamped to the length of the month, so in February the cycle closes on the 28th.
That clamping had an edge case of its own. A comment in cycle.ts records it: with the closing day on the 31st, January’s cycle once started on 1 January of the previous year, thirteen months long, and every purchase from that year counted twice towards the card’s debt. The start of a cycle that follows a 31 December closing now rolls over to the next year.
When the cycle doesn’t add up
Real life isn’t always tidy: a hold on the 24th and its release on the 27th can land in the same bill, and a purchase on the 26th can end up in the bill that closed on the 25th. Ahorreo doesn’t use a tolerance for this. An earlier version accepted a 2% or €5 margin, and it quietly turned a €78.00 bookshop purchase and an €18.00 subscription into transfers without anyone clicking anything.
Now the rule is exact. A charge settles a cycle if it equals the cycle’s total to the cent, or if moving one specific transaction into or out of the cycle makes it equal to the cent. In that second case the app points to the transaction, with a note that the same amount sits in the previous or the next cycle. If no single transaction explains the difference, there’s no match, and the cycle waits for you. A cycle paid in two charges works too: the second is compared with what was still owed, not with the whole cycle.
Case 3: refunds
A refund arrives with a positive amount, and until something says otherwise it looks like income. If you returned something bought in March and the money comes back in April, March keeps the full expense and April gets income that doesn’t exist: two wrong months from one movement.
Ahorreo looks for the charge a refund undoes: the same account, the opposite amount to the cent, a refund that arrives after the charge and no more than 90 days later, and descriptions that share at least half their words. A partial refund isn’t guessed, because that would mean inventing which part of the purchase was undone. Once the pair is accepted, the refund takes the charge’s accrual period and its category, with refund as the source. March goes back to zero, in the report and in the budget, and April is untouched.
Why not “payday to payday” months?
A popular alternative is to redefine the month itself: your month runs from payday to payday. We considered it and rejected it. It shifts every period to fix one case, complicates every aggregate, every budget and every chart label, and still doesn’t fix credit cards or refunds. Assigning an accrual period per transaction fixes all three without touching the calendar.
The same idea, everywhere
Once you have the concept, it shows up in more places. A mortgage payment is split into interest, which is an expense, and principal, which is money moving from your current account into the home you own. We cover that split, and what it means for shared property, in Household or my share?
All of these follow one principle: your reports should describe your economic life, not your bank’s processing calendar. The bank’s dates are kept as they are; the month a transaction belongs to is a separate, visible, correctable fact.
Limits
- The salary rule recognises salaries by their description. If your bank writes the payment as the company’s name only, the rule won’t see it; you can set those periods by hand, and a categorisation rule will at least file it under the right category.
- There is one payroll rule for the whole app, not one per employer. If two salaries in the same household are paid on very different days, the thresholds have to suit both, or one of them needs corrections by hand.
- Card cycles need the closing and charge days. Without them, the card statement is just a list of purchases and the settlement charge on your current account can’t be paired.
The amounts themselves are integers, for a related reason: why money should never be a float. And the mortgage calculator shows the interest and principal split for any loan, without importing anything.
This article explains how our software works and the maths behind it. It is not financial, tax or legal advice: for decisions about your own money, check with a qualified professional.