]> git.ktnx.net Git - mobile-ledger.git/commitdiff
attempt to be compatible with hledger-web 1.15.1
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 Nov 2019 20:52:27 +0000 (22:52 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 20 Nov 2019 20:52:27 +0000 (22:52 +0200)
add 'ptransaction_' field to the postings

app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java
app/src/main/java/net/ktnx/mobileledger/json/ParsedPosting.java

index 4b9361e10e8800fb5134ebbf1d7f94fcfb1d3cb7..5d3241d2b911123e902cfe902b67e2c8952f13c6 100644 (file)
@@ -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;
     }
index b09fb512aff454c1052d2e58fdc3e31885340597..d52a8ce782a39b99a2aafc3700de01aa7283047b 100644 (file)
@@ -35,6 +35,13 @@ public class ParsedPosting {
     private String pcomment = "";
     private List<List<String>> ptags = new ArrayList<>();
     private String poriginal = null;
+    private int ptransaction_;
+    public int getPtransaction_() {
+        return ptransaction_;
+    }
+    public void setPtransaction_(int ptransaction_) {
+        this.ptransaction_ = ptransaction_;
+    }
     public ParsedPosting() {
     }
     public String getPdate() {