From b8cf3b58fa7365e62197e7363d1cd72bf4b1406b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 3 May 2019 20:20:15 +0300 Subject: [PATCH] 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 --- .../net/ktnx/mobileledger/async/RetrieveTransactionsTask.java | 3 +++ 1 file changed, 3 insertions(+) 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"); } -- 2.39.5