]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java
rework transaction date handling
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / MobileLedgerProfile.java
index b31ddef396741d50971c2716de52a6e4ab4a5d81..925e05eb3fd95ef3ddd64efd83c3b654ead3c0b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -292,10 +292,13 @@ 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, date, description, data_hash, keep) " +
-                   "values(?,?,?,?,?,1)",
-                new Object[]{uuid, tr.getId(), Globals.formatLedgerDate(tr.getDate()),
-                             tr.getDescription(), tr.getDataHash()
+        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()
                 });
 
         for (LedgerTransactionAccount item : tr.getAccounts()) {