]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_15 / ParsedLedgerTransaction.java
index 225f162b0fe8b41d00cad60ec559e2cf88e3b0ca..bc1950badca0ff381f701c0cb511fe3d36da7da4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2020 Damyan Ivanov.
+ * Copyright © 2021 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
@@ -46,7 +46,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse
     }
     public static ParsedLedgerTransaction fromLedgerTransaction(LedgerTransaction tr) {
         ParsedLedgerTransaction result = new ParsedLedgerTransaction();
-        result.setTcomment(tr.getComment());
+        result.setTcomment(Misc.nullIsEmpty(tr.getComment()));
         result.setTprecedingcomment("");
 
         ArrayList<ParsedPosting> postings = new ArrayList<>();
@@ -57,7 +57,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse
         }
 
         result.setTpostings(postings);
-        SimpleDate transactionDate = tr.getDate();
+        SimpleDate transactionDate = tr.getDateIfAny();
         if (transactionDate == null) {
             transactionDate = SimpleDate.today();
         }
@@ -153,6 +153,8 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse
                 tr.addAccount(p.asLedgerAccount());
             }
         }
+
+        tr.markDataAsLoaded();
         return tr;
     }
 }