]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java
add support for transaction-level comments in the JSON-based parser
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / json / v1_14 / ParsedLedgerTransaction.java
index 058319a3b4e250b12cc19b33afa241915b149af9..926717cc9f7570862915a98dba2907e5ce02c2a8 100644 (file)
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import net.ktnx.mobileledger.model.LedgerTransaction;
 import net.ktnx.mobileledger.model.LedgerTransactionAccount;
 import net.ktnx.mobileledger.utils.Globals;
+import net.ktnx.mobileledger.utils.Misc;
 
 import java.text.ParseException;
 import java.util.ArrayList;
@@ -146,6 +147,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse
     public LedgerTransaction asLedgerTransaction() throws ParseException {
         Date date = Globals.parseIsoDate(tdate);
         LedgerTransaction tr = new LedgerTransaction(tindex, date, tdescription);
+        tr.setComment(Misc.trim(Misc.emptyIsNull(tcomment)));
 
         List<ParsedPosting> postings = tpostings;