summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-26 00:56:47 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-26 03:16:39 -0400
commitd58797e98c82ced16fbc0a213fd104fb72a9de08 (patch)
treececde49eece8edc80e334f74895e0861a56c0fdb /src/account.cc
parent74e569e220bee08d6c9eda59b5e4021748344994 (diff)
downloadfork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.tar.gz
fork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.tar.bz2
fork-ledger-d58797e98c82ced16fbc0a213fd104fb72a9de08.zip
The -B, -G, -V reports now show rounding amounts
This way, if the running total is off by a penny or two due to rounding of one or more commodities in the account, the user will see it. This commit also reorganizes the testing code a bit, which I did after adding the ninth test series (ConfirmTests), to validate the new rounding code.
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index d65b6911..9bc96564 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -196,6 +196,10 @@ namespace {
return long(account.depth);
}
+ value_t ignore(account_t&) {
+ return false;
+ }
+
value_t get_depth_spacer(account_t& account)
{
std::size_t depth = 0;
@@ -259,6 +263,11 @@ expr_t::ptr_op_t account_t::lookup(const string& name)
if (name == "total")
return WRAP_FUNCTOR(get_wrapper<&get_total>);
break;
+
+ case 'u':
+ if (name == "use_direct_amount")
+ return WRAP_FUNCTOR(get_wrapper<&ignore>);
+ break;
}
return NULL;