Added a "commodity" valexpr variable for xacts
This commit is contained in:
parent
72cdb41727
commit
db0689f547
1 changed files with 6 additions and 0 deletions
|
|
@ -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) {
|
value_t get_cost(xact_t& xact) {
|
||||||
if (xact.has_xdata() &&
|
if (xact.has_xdata() &&
|
||||||
xact.xdata().has_flags(XACT_EXT_COMPOUND)) {
|
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>);
|
return WRAP_FUNCTOR(get_wrapper<&get_count>);
|
||||||
else if (name == "calculated")
|
else if (name == "calculated")
|
||||||
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
|
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
|
||||||
|
else if (name == "commodity")
|
||||||
|
return WRAP_FUNCTOR(get_wrapper<&get_commodity>);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue