summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <jwiegley@gmail.com>2017-10-26 21:04:00 -0700
committerGitHub <noreply@github.com>2017-10-26 21:04:00 -0700
commita8a9c1a5284ddb3b497a6ade13901f04b3e33870 (patch)
treefae2e8b6e897b96759bf891f35750eea8c4b093c /src
parentd1928e648368c1635c0ad2330d308b85f33a6494 (diff)
parentde1b48a013b6f4bdf68f7edf333db63a0994ef20 (diff)
downloadfork-ledger-a8a9c1a5284ddb3b497a6ade13901f04b3e33870.tar.gz
fork-ledger-a8a9c1a5284ddb3b497a6ade13901f04b3e33870.tar.bz2
fork-ledger-a8a9c1a5284ddb3b497a6ade13901f04b3e33870.zip
Merge pull request #494 from jjlee/fix-total
Fix bug where .total used in value exprs breaks totals
Diffstat (limited to 'src')
-rw-r--r--src/account.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index 14e8b0a9..da8b0b8e 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -136,6 +136,19 @@ void account_t::add_post(post_t * post)
xdata_->self_details.calculated = false;
xdata_->family_details.gathered = false;
xdata_->family_details.calculated = false;
+ if (! xdata_->family_details.total.is_null()) {
+ xdata_->family_details.total = ledger::value_t();
+ }
+ account_t *ancestor = this;
+ while (ancestor->parent) {
+ ancestor = ancestor->parent;
+ if (ancestor->has_xdata()) {
+ xdata_t &xdata = ancestor->xdata();
+ xdata.family_details.gathered = false;
+ xdata.family_details.calculated = false;
+ xdata.family_details.total = ledger::value_t();
+ }
+ }
}
}