diff options
-rw-r--r-- | walk.cc | 6 | ||||
-rw-r--r-- | walk.h | 2 |
2 files changed, 5 insertions, 3 deletions
@@ -138,8 +138,10 @@ void collapse_transactions::report_cumulative_subtotal() handle_value(result, &totals_account, last_entry, 0, xact_temps, handler); } - subtotal = 0; - count = 0; + last_entry = NULL; + last_xact = NULL; + subtotal = 0; + count = 0; } void changed_value_transactions::output_diff(const std::time_t current) @@ -273,7 +273,7 @@ class collapse_transactions : public item_handler<transaction_t> // If we've reached a new entry, report on the subtotal // accumulated thus far. - if (last_entry && last_entry != xact.entry) + if (last_entry && last_entry != xact.entry && count > 0) report_cumulative_subtotal(); add_transaction_to(xact, subtotal); |