diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-26 19:09:24 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-26 19:09:24 -0400 |
commit | 7fae606d622d8cd463ce5f81f5d7872a4fdebc60 (patch) | |
tree | be5550e492b20c135143c821fbc18cbd63c27060 /src/output.cc | |
parent | 92d1bbbe75df71731d458f5b48bcb0f145428920 (diff) | |
parent | 3fdd75fb5b2614f7dab29fd5ad5c9efed6e80b79 (diff) | |
download | fork-ledger-7fae606d622d8cd463ce5f81f5d7872a4fdebc60.tar.gz fork-ledger-7fae606d622d8cd463ce5f81f5d7872a4fdebc60.tar.bz2 fork-ledger-7fae606d622d8cd463ce5f81f5d7872a4fdebc60.zip |
Merge branch 'next'
Diffstat (limited to 'src/output.cc')
-rw-r--r-- | src/output.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/output.cc b/src/output.cc index 92824714..a0c2581b 100644 --- a/src/output.cc +++ b/src/output.cc @@ -136,13 +136,14 @@ format_accounts::format_accounts(report_t& _report, } } -std::size_t format_accounts::post_account(account_t& account) +std::size_t format_accounts::post_account(account_t& account, const bool flat) { - if (account.xdata().has_flags(ACCOUNT_EXT_TO_DISPLAY)) { - if (account.parent && + if (account.xdata().has_flags(ACCOUNT_EXT_TO_DISPLAY) && + ! account.xdata().has_flags(ACCOUNT_EXT_DISPLAYED)) { + if (! flat && account.parent && account.parent->xdata().has_flags(ACCOUNT_EXT_TO_DISPLAY) && ! account.parent->xdata().has_flags(ACCOUNT_EXT_DISPLAYED)) - post_account(*account.parent); + post_account(*account.parent, flat); account.xdata().add_flags(ACCOUNT_EXT_DISPLAYED); @@ -207,7 +208,7 @@ void format_accounts::flush() std::size_t displayed = 0; foreach (account_t * account, posted_accounts) - displayed += post_account(*account); + displayed += post_account(*account, report.HANDLED(flat)); if (displayed > 1 && ! report.HANDLED(no_total) && ! report.HANDLED(percent)) { @@ -221,6 +222,7 @@ void format_accounts::flush() void format_accounts::operator()(account_t& account) { + DEBUG("account.display", "Posting account: " << account.fullname()); posted_accounts.push_back(&account); } |