diff options
author | John Wiegley <johnw@newartisans.com> | 2005-10-14 19:05:55 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:19 -0400 |
commit | a53f44ecdaf9051c9e7f64993787c88d98b5348a (patch) | |
tree | 5d3876db32ae57002ec870583c5acb623e4c34c4 /journal.h | |
parent | 50c689e1ae75a304ef7431fa489360076e837120 (diff) | |
download | fork-ledger-a53f44ecdaf9051c9e7f64993787c88d98b5348a.tar.gz fork-ledger-a53f44ecdaf9051c9e7f64993787c88d98b5348a.tar.bz2 fork-ledger-a53f44ecdaf9051c9e7f64993787c88d98b5348a.zip |
Support has been added for clearing of individual transactions. Set
`ledger-clear-whole-entries' in Emacs to revert to the old behavior.
Diffstat (limited to 'journal.h')
-rw-r--r-- | journal.h | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -29,17 +29,20 @@ class account_t; class transaction_t { public: + enum state_t { UNCLEARED, CLEARED, PENDING }; + entry_t * entry; account_t * account; amount_t amount; amount_t * cost; + state_t state; unsigned short flags; std::string note; mutable void * data; transaction_t(account_t * _account = NULL) : entry(NULL), account(_account), cost(NULL), - flags(TRANSACTION_NORMAL), data(NULL) { + state(UNCLEARED), flags(TRANSACTION_NORMAL), data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } @@ -48,14 +51,16 @@ class transaction_t unsigned int _flags = TRANSACTION_NORMAL, const std::string& _note = "") : entry(NULL), account(_account), amount(_amount), - cost(NULL), flags(_flags), note(_note), data(NULL) { + cost(NULL), state(UNCLEARED), flags(_flags), + note(_note), data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } transaction_t(const transaction_t& xact) : entry(xact.entry), account(xact.account), amount(xact.amount), cost(xact.cost ? new amount_t(*xact.cost) : NULL), - flags(xact.flags), note(xact.note), data(NULL) { + state(xact.state), flags(xact.flags), note(xact.note), + data(NULL) { DEBUG_PRINT("ledger.memory.ctors", "ctor transaction_t"); } @@ -128,14 +133,11 @@ class entry_base_t class entry_t : public entry_base_t { public: - enum state_t { UNCLEARED, CLEARED, PENDING }; - std::time_t date; - state_t state; std::string code; std::string payee; - entry_t() : date(0), state(UNCLEARED) { + entry_t() : date(0) { DEBUG_PRINT("ledger.memory.ctors", "ctor entry_t"); } entry_t(const entry_t& e); |