summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-13 18:33:28 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-13 18:33:28 -0400
commitb345a45c9bd80fd1171e31f43a0f423f7d891a95 (patch)
treef906237081183d85bafc5f1b72109f2b6714ccc1 /src/xact.cc
parent7a0e61f45800f11f55cfd1f74d1082057aa5bce4 (diff)
downloadfork-ledger-b345a45c9bd80fd1171e31f43a0f423f7d891a95.tar.gz
fork-ledger-b345a45c9bd80fd1171e31f43a0f423f7d891a95.tar.bz2
fork-ledger-b345a45c9bd80fd1171e31f43a0f423f7d891a95.zip
Don't print an xact's amount if it was calculated
That is, if the user didn't enter an amount for that transaction in their ledger journal, don't print one out either.
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xact.cc b/src/xact.cc
index 3106f1a3..1942e175 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -76,6 +76,10 @@ namespace {
return value_t(static_cast<scope_t *>(&xact));
}
+ value_t get_is_calculated(xact_t& xact) {
+ return xact.has_flags(XACT_CALCULATED);
+ }
+
value_t get_entry(xact_t& xact) {
return value_t(static_cast<scope_t *>(xact.entry));
}
@@ -175,6 +179,8 @@ expr_t::ptr_op_t xact_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_code>);
else if (name == "cost")
return WRAP_FUNCTOR(get_wrapper<&get_cost>);
+ else if (name == "calculated")
+ return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
break;
case 'e':