From adb3965e947d4891c8ab59a63cf6e7f7db1f25fb Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 21 Jun 2004 18:49:43 -0400 Subject: further pricing fixes --- ledger.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ledger.cc') diff --git a/ledger.cc b/ledger.cc index 4722ac31..31a369b0 100644 --- a/ledger.cc +++ b/ledger.cc @@ -448,6 +448,23 @@ void totals::print(std::ostream& out, int width) const } } +void totals::print_street(std::ostream& out, int width, std::time_t * when, + bool use_history, bool download) const +{ + totals street_balance; + + for (const_iterator i = amounts.begin(); i != amounts.end(); i++) { + if ((*i).second->is_zero()) + continue; + + amount * street = (*i).second->street(when, use_history, download); + street_balance.credit(street); + delete street; + } + + street_balance.print(out, width); +} + account::~account() { for (accounts_map_iterator i = children.begin(); -- cgit v1.2.3