summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-03 10:40:44 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:28 -0400
commit2ebfddf4010a2f97c982fa6f9e04a25e2f456af4 (patch)
treebf9ffc9ce2a3be3126b434934f36118c57f6cd0e /valexpr.cc
parent96d6d62ad94082ca777c2c88b88e0346a5d00e65 (diff)
downloadfork-ledger-2ebfddf4010a2f97c982fa6f9e04a25e2f456af4.tar.gz
fork-ledger-2ebfddf4010a2f97c982fa6f9e04a25e2f456af4.tar.bz2
fork-ledger-2ebfddf4010a2f97c982fa6f9e04a25e2f456af4.zip
Began support for improved commodity handling.
Diffstat (limited to 'valexpr.cc')
-rw-r--r--valexpr.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 61574d3f..c8495771 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -13,6 +13,10 @@ std::auto_ptr<value_calc> total_expr;
std::auto_ptr<scope_t> global_scope;
std::time_t terminus;
+bool keep_price = false;
+bool keep_date = false;
+bool keep_tag = false;
+
details_t::details_t(const transaction_t& _xact)
: entry(_xact.entry), xact(&_xact), account(xact_account(_xact))
{
@@ -643,6 +647,9 @@ void value_expr_t::compute(value_t& result, const details_t& details,
assert(0);
break;
}
+
+ if (! keep_price || ! keep_date || ! keep_tag)
+ result = result.reduce(keep_price, keep_date, keep_tag);
}
static inline void unexpected(char c, char wanted = '\0') {