summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-21 00:12:22 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-21 00:12:22 -0400
commit23725ffafbbe1d4463f9cfd805f4f59f4c8a2591 (patch)
treee28681157228a09d0bf729edb1100591e93d052e /src/filters.cc
parent3c18d3054f36dec049809cbf3321eeeeadcf2349 (diff)
downloadfork-ledger-23725ffafbbe1d4463f9cfd805f4f59f4c8a2591.tar.gz
fork-ledger-23725ffafbbe1d4463f9cfd805f4f59f4c8a2591.tar.bz2
fork-ledger-23725ffafbbe1d4463f9cfd805f4f59f4c8a2591.zip
Restored --forecast, now also --forecast-while
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/filters.cc b/src/filters.cc
index 0bb4cf98..06bc4487 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -660,16 +660,14 @@ void dow_xacts::flush()
subtotal_xacts::flush();
}
-void generate_xacts::add_period_entries
- (period_entries_list& period_entries)
+void generate_xacts::add_period_entries(period_entries_list& period_entries)
{
foreach (period_entry_t * entry, period_entries)
foreach (xact_t * xact, entry->xacts)
add_xact(entry->period, *xact);
}
-void generate_xacts::add_xact(const interval_t& period,
- xact_t& xact)
+void generate_xacts::add_xact(const interval_t& period, xact_t& xact)
{
pending_xacts.push_back(pending_xacts_pair(period, &xact));
}
@@ -722,7 +720,7 @@ void budget_xacts::operator()(xact_t& xact)
{
bool xact_in_budget = false;
- foreach (pending_xacts_list::value_type& pair, pending_xacts)
+ foreach (pending_xacts_list::value_type& pair, pending_xacts) {
for (account_t * acct = xact.reported_account();
acct;
acct = acct->parent) {
@@ -735,6 +733,7 @@ void budget_xacts::operator()(xact_t& xact)
goto handle;
}
}
+ }
handle:
if (xact_in_budget && flags & BUDGET_BUDGETED) {
@@ -763,7 +762,7 @@ void forecast_xacts::add_xact(const interval_t& period, xact_t& xact)
void forecast_xacts::flush()
{
xacts_list passed;
- date_t last;
+ date_t last;
while (pending_xacts.size() > 0) {
pending_xacts_list::iterator least = pending_xacts.begin();