diff options
| author | Calvin Morrison <calvin@pobox.com> | 2025-12-27 19:26:21 -0500 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2025-12-27 19:26:21 -0500 |
| commit | 5cf763ea3ba2a89acfa5f24422cc71e0ff7fb35b (patch) | |
| tree | ef3541cf3650eb14a46b2a54f1b63b1351c08082 /transaction.h | |
| parent | 5e9b299dfe95a7f99f029802089c047a392eee3a (diff) | |
Add reconciliation system with checkpoints and adjustments
- Add Reconciliation transaction type that appears as visible rows
- Reconciliation checkpoints show expected vs calculated balance
- Red background if out of balance, green if balanced
- Description shows balance status (Balanced or Out of balance by .XX)
- Create Adjustment button appears when reconciliation is out of balance
- Adjustment transactions automatically created to match bank balance
- Reconciliations always sort last on their date
- Auto-recalculate all reconciliations when any transaction changes
- Persistent projection months setting (1-24 months, default 3)
- Persistent date range between sessions
- Fix projection regeneration to start from rule start date
- Fix duplicate projections when converting to actuals
- Grey out irrelevant fields when Reconciliation type selected
Diffstat (limited to 'transaction.h')
| -rw-r--r-- | transaction.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/transaction.h b/transaction.h index 9628a4e..0d608f2 100644 --- a/transaction.h +++ b/transaction.h @@ -7,7 +7,8 @@ enum class TransactionType { Estimated, - Actual + Actual, + Reconciliation }; enum class RecurrenceFrequency { @@ -33,8 +34,10 @@ struct Transaction { QString occurrenceKey; // e.g. "2025-01" for monthly, "2025-W03" for weekly double expectedAmount; // original projected amount (for variance tracking) QDate expectedDate; // original projected date (for variance tracking) + double expectedBalance; // for reconciliation checkpoints - what bank says + double calculatedBalance; // for reconciliation checkpoints - what we calculated - Transaction() : id(-1), amount(0.0), type(TransactionType::Estimated), recurringId(-1), sortOrder(0), reconciled(false), expectedAmount(0.0) {} + Transaction() : id(-1), amount(0.0), type(TransactionType::Estimated), recurringId(-1), sortOrder(0), reconciled(false), expectedAmount(0.0), expectedBalance(0.0), calculatedBalance(0.0) {} double getBalance() const { return amount; } }; @@ -53,6 +56,7 @@ struct RecurringRule { int dayOfMonth; // 1-31 for monthly, -1 if not applicable int occurrences; // Number of times to repeat, -1 for indefinite int sortOrder; // For ordering transactions on same date + QDate projectionEndDate; // How far into future to generate projections RecurringRule() : id(-1), frequency(RecurrenceFrequency::None), amount(0.0), dayOfWeek(-1), dayOfMonth(-1), occurrences(-1), sortOrder(0) {} |
