summaryrefslogtreecommitdiff
path: root/account.cc
diff options
context:
space:
mode:
Diffstat (limited to 'account.cc')
-rw-r--r--account.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/account.cc b/account.cc
index 241ac097..9fee7145 100644
--- a/account.cc
+++ b/account.cc
@@ -143,4 +143,25 @@ bool account_t::valid() const
return true;
}
+void account_t::calculate_sums()
+{
+ xdata_t& xd(xdata());
+
+ foreach (accounts_map::value_type& pair, accounts) {
+ (*pair.second).calculate_sums();
+
+ xd.total += (*pair.second).xdata().total;
+ xd.total_count += ((*pair.second).xdata().total_count +
+ (*pair.second).xdata().count);
+ }
+
+ value_t result;
+#if 0
+ compute_amount(result, details_t(account));
+#endif
+ if (! result.is_realzero())
+ xd.total += result;
+ xd.total_count += xd.count;
+}
+
} // namespace ledger