diff options
Diffstat (limited to 'src/post.cc')
-rw-r--r-- | src/post.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/post.cc b/src/post.cc index 7b5e5325..0d6ab8a0 100644 --- a/src/post.cc +++ b/src/post.cc @@ -141,6 +141,12 @@ namespace { return string_value(post.xact->payee); } + value_t get_note(post_t& post) { + string note = post.note ? *post.note : empty_string; + note += post.xact->note ? *post.xact->note : empty_string; + return string_value(note); + } + value_t get_magnitude(post_t& post) { return post.xact->magnitude(); } @@ -318,6 +324,11 @@ expr_t::ptr_op_t post_t::lookup(const string& name) return WRAP_FUNCTOR(get_wrapper<&get_magnitude>); break; + case 'n': + if (name == "note") + return WRAP_FUNCTOR(get_wrapper<&get_note>); + break; + case 'p': if (name == "post") return WRAP_FUNCTOR(get_wrapper<&get_this>); |