]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java
attempt to be compatible with hledger-web 1.15.1
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / json / ParsedLedgerTransaction.java
index 8743780ce915355fad2bd2759010ca2baea2ee7f..5d3241d2b911123e902cfe902b67e2c8952f13c6 100644 (file)
@@ -38,7 +38,7 @@ public class ParsedLedgerTransaction {
     private String tprecedingcomment;
     private int tindex;
     private List<ParsedPosting> tpostings;
-    private List<String> ttags = new ArrayList<>();
+    private List<List<String>> ttags = new ArrayList<>();
     private ParsedSourcePos tsourcepos = new ParsedSourcePos();
     public ParsedLedgerTransaction() {
     }
@@ -54,10 +54,10 @@ public class ParsedLedgerTransaction {
     public void setTstatus(String tstatus) {
         this.tstatus = tstatus;
     }
-    public List<String> getTtags() {
+    public List<List<String>> getTtags() {
         return ttags;
     }
-    public void setTtags(List<String> ttags) {
+    public void setTtags(List<List<String>> ttags) {
         this.ttags = ttags;
     }
     public ParsedSourcePos getTsourcepos() {
@@ -101,10 +101,17 @@ public class ParsedLedgerTransaction {
     }
     public void setTindex(int tindex) {
         this.tindex = tindex;
+        for(ParsedPosting p : tpostings) {
+            p.setPtransaction_(tindex);
+        }
     }
     public List<ParsedPosting> getTpostings() {
         return tpostings;
     }
+    public void addPosting(ParsedPosting posting) {
+        posting.setPtransaction_(tindex);
+        tpostings.add(posting);
+    }
     public void setTpostings(List<ParsedPosting> tpostings) {
         this.tpostings = tpostings;
     }