Skip to content
Permalink
Browse files

Change --invert to invert displayed amounts and totals, not amo… (#1804)

Change --invert to invert displayed amounts and totals, not amounts
  • Loading branch information...
jwiegley committed Jul 5, 2019
2 parents c4eab00 + bb78c6e commit 2ac86f5dfeda2cb5fd8d948cc4a75a2ce2d45025
Showing with 2 additions and 10 deletions.
  1. +0 −9 src/filters.cc
  2. +2 −1 src/report.h
@@ -894,16 +894,7 @@ void subtotal_posts::operator()(post_t& post)
account_t * acct = post.reported_account();
assert(acct);

#if 0
// jww (2012-04-06): The problem with doing this early is that
// fn_display_amount will recalculate this again. For example, if you
// use --invert, it will invert both here and in the display amount,
// effectively negating it.
bind_scope_t bound_scope(*amount_expr.get_context(), post);
value_t amount(amount_expr.calc(bound_scope));
#else
value_t amount(post.amount);
#endif

post.xdata().compound_value = amount;
post.xdata().add_flags(POST_EXT_COMPOUND);
@@ -732,7 +732,8 @@ class report_t : public scope_t
OPTION(report_t, inject_);

OPTION_(report_t, invert, DO() {
OTHER(amount_).on(whence, "-amount_expr");
OTHER(display_amount_).on(whence, "-display_amount");
OTHER(display_total_).on(whence, "-display_total");
});

OPTION_

0 comments on commit 2ac86f5

Please sign in to comment.
You can’t perform that action at this time.