From d0460b06924ce9a25953247ee1c6049d6d0a2d36 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 7 May 2010 22:57:55 -0400 Subject: The --invert option now works with "convert" --- src/convert.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/convert.cc') diff --git a/src/convert.cc b/src/convert.cc index 6c02cff3..2e6da2f6 100644 --- a/src/convert.cc +++ b/src/convert.cc @@ -83,7 +83,7 @@ value_t convert_command(call_scope_t& scope) } } - // Create a flat list o + // Create a flat list xacts_list current_xacts(journal.xacts_begin(), journal.xacts_end()); // Read in the series of transactions from the CSV file @@ -93,6 +93,11 @@ value_t convert_command(call_scope_t& scope) csv_reader reader(data); while (xact_t * xact = reader.read_xact(journal, bucket)) { + if (report.HANDLED(invert)) { + foreach (post_t * post, xact->posts) + post->amount.in_place_negate(); + } + bool matched = false; post_map_t::iterator i = post_map.find(- xact->posts.front()->amount); if (i != post_map.end()) { -- cgit v1.2.3