Fix spent amounts and carry unspent money to the next DCA period #2

Merged
rubenjr0 merged 3 commits from fix/spent-and-period-carryover into main 2026-09-30 16:21:11 +00:00
Owner
  • The app kept each budget's "remaining" as a stored number. Each new or deleted transaction changed this number. When
    the same transaction was sent more than one time at the same moment, some of these changes were lost. SOL showed
    "spent: −10" and "remaining: 91". The correct values are 65 spent and 16 remaining.
  • "Remaining this period" divided the month's remaining money into equal parts. It did not look at the date. Money that
    you did not spend in one period did not go to the next period.

Changes

  • "Spent" is now the total of the month's transactions. "Remaining" is "allocated" minus "spent". The app does not store
    a balance.
  • A new migration removes the month_budgets.remaining column. The server applies it at start. No data is lost.
  • The monthly rollover uses the same calculation for the money it carries over.
  • "Remaining this period" is now the money allocated up to the current period, minus all money spent this month. Money
    that you did not spend moves to the next period. In the last period, this value is equal to the month's remaining
    money.
  • New column labels: "Allocated this month", "Spent this month", "Remaining this month", "Remaining this period".
  • On wide screens, the three panels have the same height.

Test

  • New unit tests check the period carryover.
  • Tested on a copy of the production data. SOL shows 65 spent and 16 remaining. After you add a transaction and then
    delete it, the values are correct. The rollover carries the correct amounts.
- The app kept each budget's "remaining" as a stored number. Each new or deleted transaction changed this number. When the same transaction was sent more than one time at the same moment, some of these changes were lost. SOL showed "spent: −10" and "remaining: 91". The correct values are 65 spent and 16 remaining. - "Remaining this period" divided the month's remaining money into equal parts. It did not look at the date. Money that you did not spend in one period did not go to the next period. Changes - "Spent" is now the total of the month's transactions. "Remaining" is "allocated" minus "spent". The app does not store a balance. - A new migration removes the month_budgets.remaining column. The server applies it at start. No data is lost. - The monthly rollover uses the same calculation for the money it carries over. - "Remaining this period" is now the money allocated up to the current period, minus all money spent this month. Money that you did not spend moves to the next period. In the last period, this value is equal to the month's remaining money. - New column labels: "Allocated this month", "Spent this month", "Remaining this month", "Remaining this period". - On wide screens, the three panels have the same height. Test - New unit tests check the period carryover. - Tested on a copy of the production data. SOL shows 65 spent and 16 remaining. After you add a transaction and then delete it, the values are correct. The rollover carries the correct amounts.
rubenjr0 changed title from fix/spent-and-period-carryover to Fix spent amounts and carry unspent money to the next DCA period 2026-09-30 16:18:06 +00:00
rubenjr0 deleted branch fix/spent-and-period-carryover 2026-09-30 16:21:13 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rubenjr0/budgit!2
No description provided.