diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-28 01:37:29 -0600 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-28 01:37:29 -0600 |
commit | 887f429ae40934c145e03b03cc452e6af4457c0f (patch) | |
tree | c021ea1b6b67b0d866d67d114a7ce68ffdb00532 /src/filters.h | |
parent | d3d13329d98b2b26378813a91ad0d4e49045a426 (diff) | |
download | fork-ledger-887f429ae40934c145e03b03cc452e6af4457c0f.tar.gz fork-ledger-887f429ae40934c145e03b03cc452e6af4457c0f.tar.bz2 fork-ledger-887f429ae40934c145e03b03cc452e6af4457c0f.zip |
Added debug code for debugging interval reports
Diffstat (limited to 'src/filters.h')
-rw-r--r-- | src/filters.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/filters.h b/src/filters.h index d207d842..2e51c91c 100644 --- a/src/filters.h +++ b/src/filters.h @@ -728,21 +728,44 @@ public: empty_account = &temps.create_account(_("<None>")); } - void report_subtotal(const date_interval_t& interval); + void report_subtotal(const date_interval_t& ival); + +#if defined(DEBUG_ON) + void debug_interval(const date_interval_t& ival) { + if (ival.start) + DEBUG("filters.interval", "start = " << *ival.start); + else + DEBUG("filters.interval", "no start"); + + if (ival.finish) + DEBUG("filters.interval", "finish = " << *ival.finish); + else + DEBUG("filters.interval", "no finish"); + } +#endif virtual void flush() { if (last_post && interval.duration) { - if (last_interval && interval != last_interval) + DEBUG("filters.interval", "There is a last_post and an interval.duration"); + if (interval != last_interval) { +#if defined(DEBUG_ON) + DEBUG("filters.interval", "interval != last_interval, so reporting"); + DEBUG("filters.interval", "interval is:"); + debug_interval(interval); + DEBUG("filters.interval", "last_interval is:"); + debug_interval(last_interval); +#endif report_subtotal(last_interval); + } subtotal_posts::flush(); } } virtual void operator()(post_t& post); virtual void clear() { - interval = start_interval; + interval = start_interval; last_interval = date_interval_t(); - last_post = NULL; + last_post = NULL; subtotal_posts::clear(); create_accounts(); |