X-Git-Url: https://git.ktnx.net/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2Fmodel%2FMobileLedgerProfile.java;h=21acf677ddc426fac048fb79937d2dbbb49a406e;hb=d58f8f4a9edd8b96005d1900c51b589471424165;hp=2a603d7d2958e8933e66d8512da921565b485c0e;hpb=1e6438e12905ef2436adbe9383c15473a0b393fd;p=mobile-ledger.git diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index 2a603d7d..21acf677 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -294,13 +294,11 @@ public final class MobileLedgerProfile { db.execSQL("DELETE from transaction_accounts WHERE profile = ? and transaction_id=?", new Object[]{uuid, tr.getId()}); - db.execSQL( - "INSERT INTO transactions(profile, id, year, month, day, description, "+ - "comment, data_hash, keep) " + - "values(?,?,?,?,?,?,?,?,1)", + db.execSQL("INSERT INTO transactions(profile, id, year, month, day, description, " + + "comment, data_hash, keep) values(?,?,?,?,?,?,?,?,1)", new Object[]{uuid, tr.getId(), tr.getDate().year, tr.getDate().month, - tr.getDate().day, tr.getDescription(), - tr.getComment(), tr.getDataHash() + tr.getDate().day, tr.getDescription(), tr.getComment(), + tr.getDataHash() }); for (LedgerTransactionAccount item : tr.getAccounts()) { @@ -407,10 +405,11 @@ public final class MobileLedgerProfile { try (Cursor cursor = db.rawQuery("SELECT a.expanded, (select 1 from accounts a2 " + "where a2.profile = a.profile and a2.name like a" + ".name||':%' limit 1) " + - "FROM accounts a WHERE a.profile = ? and a.name=?", new String[]{uuid, accName})) + "FROM accounts a WHERE a.profile = ? and a.name=?", + new String[]{uuid, accName})) { if (cursor.moveToFirst()) { - LedgerAccount acc = new LedgerAccount(accName); + LedgerAccount acc = new LedgerAccount(this, accName); acc.setExpanded(cursor.getInt(0) == 1); acc.setHasSubAccounts(cursor.getInt(1) == 1);