From 8a7cee24c8b130b7d79b41b55b559bb6864d6fc6 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 23 Sep 2004 19:17:21 -0400 Subject: fixed a bug with interval reporting --- walk.cc | 6 ++++-- walk.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/walk.cc b/walk.cc index 6621a263..6786eae4 100644 --- a/walk.cc +++ b/walk.cc @@ -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) diff --git a/walk.h b/walk.h index a234ed85..b78ae733 100644 --- a/walk.h +++ b/walk.h @@ -273,7 +273,7 @@ class collapse_transactions : public item_handler // 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); -- cgit v1.2.3