From: Damyan Ivanov Date: Fri, 3 May 2019 17:20:15 +0000 (+0300) Subject: clear synthetic accounts list after propagating parsed amount X-Git-Tag: v0.10.0~33 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=b8cf3b58fa7365e62197e7363d1cd72bf4b1406b;p=mobile-ledger.git clear synthetic accounts list after propagating parsed amount this fixes a bug where a synthetic accounts tree gets the amounts of the following real account --- diff --git a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java index 3ba73936..f971cb02 100644 --- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java +++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java @@ -251,12 +251,15 @@ public class RetrieveTransactionsTask profile.storeAccountValue(db, lastAccount.getName(), currency, val); lastAccount.addAmount(val, currency); for (LedgerAccount syn : syntheticAccounts.values()) { + L(String.format(Locale.ENGLISH, "propagating %s %1.2f to %s", + currency, val, syn.getName())); syn.addAmount(val, currency); profile.storeAccountValue(db, syn.getName(), currency, val); } } if (match_found) { + syntheticAccounts.clear(); state = ParserState.EXPECTING_ACCOUNT; L("→ expecting account"); }