X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FLedgerTransaction.java;h=8417eae1dc5090261dcd121b850dde3398de8632;hb=1ad7a3b131b2510bcb9a515dafe6a08765bd6100;hp=db5bbc7bf584286c2aac1de0e578e2c7e3771192;hpb=69ced96a5bafb6cbc81245e6f10fca0ed8e5515c;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java index db5bbc7b..8417eae1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/LedgerTransaction.java @@ -127,6 +127,7 @@ public class LedgerTransaction { try { Digest sha = new Digest(DIGEST_TYPE); StringBuilder data = new StringBuilder(); + data.append("ver1"); data.append(profile); data.append(getId()); data.append('\0'); @@ -170,7 +171,7 @@ public class LedgerTransaction { return; try (Cursor cTr = db.rawQuery( - "SELECT date, description from transactions WHERE profile=? AND id=?", + "SELECT date, description, comment from transactions WHERE profile=? AND id=?", new String[]{profile, String.valueOf(id)})) { if (cTr.moveToFirst()) { @@ -185,6 +186,9 @@ public class LedgerTransaction { dateString, id)); } description = cTr.getString(1); + comment = cTr.getString(2); + + accounts.clear(); try (Cursor cAcc = db.rawQuery( "SELECT account_name, amount, currency, comment FROM " + @@ -206,6 +210,7 @@ public class LedgerTransaction { } public String getDataHash() { + fillDataHash(); return dataHash; } public void finishLoading() {