From f69cd8338818dc8c7f3103d0829eff4b436e1b19 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 20 Nov 2019 22:52:27 +0200 Subject: [PATCH] attempt to be compatible with hledger-web 1.15.1 add 'ptransaction_' field to the postings --- .../ktnx/mobileledger/json/ParsedLedgerTransaction.java | 7 +++++++ .../java/net/ktnx/mobileledger/json/ParsedPosting.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java index 4b9361e1..5d3241d2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/ParsedLedgerTransaction.java @@ -101,10 +101,17 @@ public class ParsedLedgerTransaction { } public void setTindex(int tindex) { this.tindex = tindex; + for(ParsedPosting p : tpostings) { + p.setPtransaction_(tindex); + } } public List getTpostings() { return tpostings; } + public void addPosting(ParsedPosting posting) { + posting.setPtransaction_(tindex); + tpostings.add(posting); + } public void setTpostings(List tpostings) { this.tpostings = tpostings; } diff --git a/app/src/main/java/net/ktnx/mobileledger/json/ParsedPosting.java b/app/src/main/java/net/ktnx/mobileledger/json/ParsedPosting.java index b09fb512..d52a8ce7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/ParsedPosting.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/ParsedPosting.java @@ -35,6 +35,13 @@ public class ParsedPosting { private String pcomment = ""; private List> 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() { -- 2.39.5