]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
fix duplication af account amounts on refresh
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / async / RetrieveTransactionsTask.java
index dfb1f74548a891e04a6c802c26b376be356aef0d..8f1a764b386aa4db91a901fcde5688ec346dd6d6 100644 (file)
@@ -170,9 +170,10 @@ public class RetrieveTransactionsTask
                                     L(String.format("found account: %s", acct_name));
 
                                     lastAccount = profile.tryLoadAccount(db, acct_name);
-                                    if (lastAccount == null) {
+                                    if (lastAccount == null)
                                         lastAccount = new LedgerAccount(acct_name);
-                                    }
+                                    else
+                                        lastAccount.removeAmounts();
                                     profile.storeAccount(db, lastAccount);
 
                                     // make sure the parent account(s) are present,