summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/journal.cc b/src/journal.cc
index 9ff42832..2f501aff 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -153,7 +153,7 @@ bool entry_base_t::finalize()
// account if one has been set.
if (journal && journal->basket && transactions.size() == 1) {
- assert(balance.type < value_t::BALANCE);
+ assert(balance.is_type(value_t::AMOUNT));
transaction_t * nxact = new transaction_t(journal->basket);
// The amount doesn't need to be set because the code below will
// balance this transaction against the other.
@@ -166,7 +166,7 @@ bool entry_base_t::finalize()
// determine its price by dividing the unit count into the value of
// the balance. This is done for the last eligible commodity.
- if (! saw_null && balance && balance.type == value_t::BALANCE &&
+ if (! saw_null && balance && balance.is_type(value_t::BALANCE) &&
balance.as_balance().amounts.size() == 2) {
transactions_list::const_iterator x = transactions.begin();
assert((*x)->amount);
@@ -227,8 +227,8 @@ bool entry_base_t::finalize()
// commodities are involved, multiple transactions will be
// generated to balance them all.
- balance_t * bal = NULL;
- switch (balance.type) {
+ const balance_t * bal = NULL;
+ switch (balance.type()) {
case value_t::BALANCE_PAIR:
bal = &balance.as_balance_pair().quantity;
// fall through...