summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
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 1f5d4f47..bbe8ff47 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -154,6 +154,10 @@ namespace {
}
}
+ value_t get_commodity(xact_t& xact) {
+ return string_value(xact.amount.commodity().symbol());
+ }
+
value_t get_cost(xact_t& xact) {
if (xact.has_xdata() &&
xact.xdata().has_flags(XACT_EXT_COMPOUND)) {
@@ -237,6 +241,8 @@ expr_t::ptr_op_t xact_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_count>);
else if (name == "calculated")
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
+ else if (name == "commodity")
+ return WRAP_FUNCTOR(get_wrapper<&get_commodity>);
break;
case 'd':