diff options
Diffstat (limited to 'transaction.h')
| -rw-r--r-- | transaction.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/transaction.h b/transaction.h index 8aa0a06..9628a4e 100644 --- a/transaction.h +++ b/transaction.h @@ -3,6 +3,7 @@ #include <QString> #include <QDate> +#include <QMetaType> enum class TransactionType { Estimated, @@ -28,8 +29,12 @@ struct Transaction { TransactionType type; int recurringId; // -1 if not part of recurring series int sortOrder; // For ordering on same date + bool reconciled; // true if converted from projection to actual + 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) - Transaction() : id(-1), amount(0.0), type(TransactionType::Estimated), recurringId(-1), sortOrder(0) {} + Transaction() : id(-1), amount(0.0), type(TransactionType::Estimated), recurringId(-1), sortOrder(0), reconciled(false), expectedAmount(0.0) {} double getBalance() const { return amount; } }; @@ -50,7 +55,10 @@ struct RecurringRule { int sortOrder; // For ordering transactions on same date RecurringRule() : id(-1), frequency(RecurrenceFrequency::None), - amount(0.0), dayOfWeek(-1), dayOfMonth(-1), occurrences(-1), sortOrder(0) {} + amount(0.0), dayOfWeek(-1), dayOfMonth(-1), occurrences(-1), sortOrder(0) {} }; -#endif // TRANSACTION_H +// Register Transaction for use in QVariant +Q_DECLARE_METATYPE(Transaction) + +#endif // TRANSACTION_H
\ No newline at end of file |
