diff options
author | John Wiegley <johnw@newartisans.com> | 2012-05-07 01:53:53 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-05-07 01:53:53 -0500 |
commit | c0fa144ca586bfc3d48d7f2512bb90ebdde148df (patch) | |
tree | 98e03564cf1e4297723edf5d7576290baa12df2b /src/account.cc | |
parent | 6a0daf634fa76ba61ea79e55e4d3f213aa27e306 (diff) | |
download | fork-ledger-c0fa144ca586bfc3d48d7f2512bb90ebdde148df.tar.gz fork-ledger-c0fa144ca586bfc3d48d7f2512bb90ebdde148df.tar.bz2 fork-ledger-c0fa144ca586bfc3d48d7f2512bb90ebdde148df.zip |
Added "last_checkout_cleared" valexpr variable
Diffstat (limited to 'src/account.cc')
-rw-r--r-- | src/account.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/account.cc b/src/account.cc index 206e2350..1ea13330 100644 --- a/src/account.cc +++ b/src/account.cc @@ -309,6 +309,10 @@ namespace { return (! account.self_details().latest_checkout.is_not_a_date_time() ? value_t(account.self_details().latest_checkout) : NULL_VALUE); } + value_t get_latest_checkout_cleared(account_t& account) + { + return account.self_details().latest_checkout_cleared; + } template <value_t (*Func)(account_t&)> value_t get_wrapper(call_scope_t& args) { @@ -405,6 +409,8 @@ expr_t::ptr_op_t account_t::lookup(const symbol_t::kind_t kind, return WRAP_FUNCTOR(get_wrapper<&get_latest>); else if (fn_name == "latest_checkout") return WRAP_FUNCTOR(get_wrapper<&get_latest_checkout>); + else if (fn_name == "latest_checkout_cleared") + return WRAP_FUNCTOR(get_wrapper<&get_latest_checkout_cleared>); break; case 'n': @@ -662,8 +668,10 @@ void account_t::xdata_t::details_t::update(post_t& post, earliest_checkin = *post.checkin; if (post.checkout && (latest_checkout.is_not_a_date_time() || - *post.checkout > latest_checkout)) + *post.checkout > latest_checkout)) { latest_checkout = *post.checkout; + latest_checkout_cleared = post.state() == item_t::CLEARED; + } if (post.state() == item_t::CLEARED) { posts_cleared_count++; |