diff options
-rw-r--r-- | src/post.cc | 14 | ||||
-rw-r--r-- | src/report.h | 5 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/post.cc b/src/post.cc index fb3281a7..18c566c4 100644 --- a/src/post.cc +++ b/src/post.cc @@ -187,11 +187,21 @@ namespace { } value_t get_commodity(post_t& post) { - return string_value(post.amount.commodity().symbol()); + if (post.has_xdata() && + post.xdata().has_flags(POST_EXT_COMPOUND)) + return string_value(post.xdata().compound_value.to_amount() + .commodity().symbol()); + else + return string_value(post.amount.commodity().symbol()); } value_t get_commodity_is_primary(post_t& post) { - return post.amount.commodity().has_flags(COMMODITY_PRIMARY); + if (post.has_xdata() && + post.xdata().has_flags(POST_EXT_COMPOUND)) + return post.xdata().compound_value.to_amount() + .commodity().has_flags(COMMODITY_PRIMARY); + else + return post.amount.commodity().has_flags(COMMODITY_PRIMARY); } value_t get_has_cost(post_t& post) { diff --git a/src/report.h b/src/report.h index 783f0026..df2f3469 100644 --- a/src/report.h +++ b/src/report.h @@ -459,11 +459,12 @@ public: OPTION__(report_t, csv_format_, CTOR(report_t, csv_format_) { on(none, "%(quoted(date))," + "%(quoted(code))," "%(quoted(payee))," "%(quoted(account))," - "%(quoted(scrub(display_amount)))," + "%(quoted(commodity))," + "%(quoted(quantity(scrub(display_amount))))," "%(quoted(cleared ? \"*\" : (pending ? \"!\" : \"\")))," - "%(quoted(code))," "%(quoted(join(note | xact.note)))\n"); }); |