summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-28 01:37:29 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-28 01:37:29 -0600
commit887f429ae40934c145e03b03cc452e6af4457c0f (patch)
treec021ea1b6b67b0d866d67d114a7ce68ffdb00532 /src/filters.cc
parentd3d13329d98b2b26378813a91ad0d4e49045a426 (diff)
downloadfork-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.cc')
-rw-r--r--src/filters.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/filters.cc b/src/filters.cc
index f57f37e7..fbef1cd8 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -916,11 +916,24 @@ void interval_posts::report_subtotal(const date_interval_t& ival)
void interval_posts::operator()(post_t& post)
{
- if (! interval.find_period(post.date()))
+ DEBUG("filters.interval", "Considering post with amount " << post.amount);
+#if defined(DEBUG_ON)
+ DEBUG("filters.interval", "interval is:");
+ debug_interval(interval);
+#endif
+ if (! interval.find_period(post.date())) {
+ DEBUG("filters.interval", "Post does not fall within period");
return;
+ }
if (interval.duration) {
- if (last_interval && interval != last_interval) {
+ DEBUG("filters.interval", "There is an interval duration");
+ if (interval != last_interval) {
+#if defined(DEBUG_ON)
+ DEBUG("filters.interval", "interval != last_interval, so reporting");
+ DEBUG("filters.interval", "last_interval is:");
+ debug_interval(last_interval);
+#endif
report_subtotal(last_interval);
if (generate_empty_posts) {
@@ -942,13 +955,14 @@ void interval_posts::operator()(post_t& post)
}
assert(last_interval <= interval);
} else {
+ DEBUG("filters.interval", "Setting last_interval = interval");
last_interval = interval;
}
- } else {
- last_interval = interval;
}
+ DEBUG("filters.interval", "Calling subtotal_posts::operator()");
subtotal_posts::operator()(post);
} else {
+ DEBUG("filters.interval", "There is no interval duration");
item_handler<post_t>::operator()(post);
}