diff options
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/xact.cc b/src/xact.cc index 9e5322fa..bd8a5955 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -35,6 +35,7 @@ #include "post.h" #include "account.h" #include "journal.h" +#include "pool.h" namespace ledger { @@ -269,9 +270,9 @@ bool xact_base_t::finalize() throw_(balance_error, _("A posting's cost must be of a different commodity than its amount")); - commodity_t::cost_breakdown_t breakdown = - commodity_t::exchange(post->amount, *post->cost, false, - datetime_t(date(), time_duration(0, 0, 0, 0))); + cost_breakdown_t breakdown = + amount_t::current_pool->exchange(post->amount, *post->cost, false, + datetime_t(date(), time_duration(0, 0, 0, 0))); if (post->amount.is_annotated() && breakdown.basis_cost.commodity() == @@ -387,10 +388,16 @@ expr_t::ptr_op_t xact_t::lookup(const string& name) bool xact_t::valid() const { - if (! _date || ! journal) { - DEBUG("ledger.validate", "xact_t: ! _date || ! journal"); + if (! _date) { + DEBUG("ledger.validate", "xact_t: ! _date"); return false; } +#if 0 + if (! journal) { + DEBUG("ledger.validate", "xact_t: ! journal"); + return false; + } +#endif foreach (post_t * post, posts) if (post->xact != this || ! post->valid()) { |