X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fasync%2FRetrieveTransactionsTask.java;h=f971cb02eb585232e0662481c549f03503379524;hp=465977b32e2c97e16235b49ffffaf2c55cbed201;hb=b8cf3b58fa7365e62197e7363d1cd72bf4b1406b;hpb=c17ccecec53bfff9f250db515513992466a5828b
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 465977b3..f971cb02 100644
--- a/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
+++ b/app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java
@@ -54,6 +54,8 @@ import java.util.Stack;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import androidx.annotation.NonNull;
+
import static net.ktnx.mobileledger.utils.Logger.debug;
@@ -75,7 +77,7 @@ public class RetrieveTransactionsTask
"\\s*([-+]?[\\d.,]+)(?:\\s+(\\S+))?");
private MobileLedgerProfile profile;
public RetrieveTransactionsTask(WeakReference contextRef,
- MobileLedgerProfile profile) {
+ @NonNull MobileLedgerProfile profile) {
this.contextRef = contextRef;
this.profile = profile;
}
@@ -249,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");
}
@@ -389,8 +394,7 @@ public class RetrieveTransactionsTask
new String[]{profile.getUuid()});
db.execSQL("update accounts set keep=0 where profile=?;", new String[]{profile.getUuid()});
}
- private boolean retrieveAccountList()
- throws IOException, HTTPException {
+ private boolean retrieveAccountList() throws IOException, HTTPException {
Progress progress = new Progress();
HttpURLConnection http = NetworkUtil.prepareConnection(profile, "accounts");
@@ -477,8 +481,7 @@ public class RetrieveTransactionsTask
return true;
}
- private boolean retrieveTransactionList()
- throws IOException, ParseException, HTTPException {
+ private boolean retrieveTransactionList() throws IOException, ParseException, HTTPException {
Progress progress = new Progress();
int maxTransactionId = Progress.INDETERMINATE;