]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java
speculatively add new transactions to the database and UI list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / new_transaction / NewTransactionModel.java
index ad9c75cd87282307581f5679d5825095734e4110..2bcf82fb8d46ce3d54d193436087eaf4bba83ba4 100644 (file)
@@ -426,7 +426,6 @@ public class NewTransactionModel extends ViewModel {
         List<Item> list = Objects.requireNonNull(items.getValue());
         TransactionHead head = list.get(0)
                                    .toTransactionHead();
-        SimpleDate date = head.getDate();
         LedgerTransaction tr = head.asLedgerTransaction();
 
         tr.setComment(head.getComment());
@@ -1027,7 +1026,8 @@ public class NewTransactionModel extends ViewModel {
             return ItemType.generalData;
         }
         public LedgerTransaction asLedgerTransaction() {
-            return new LedgerTransaction(0, date, description, Data.getProfile());
+            return new LedgerTransaction(0, (date == null) ? SimpleDate.today() : date, description,
+                    Data.getProfile());
         }
         public boolean equalContents(TransactionHead other) {
             if (other == null)