@JsonIgnoreProperties(ignoreUnknown = true)
public class ParsedLedgerTransaction {
private String tdate;
- private String tdate2;
+ private String tdate2 = null;
private String tdescription;
private String tcomment;
private String tcode = "";
private String tstatus = "Unmarked";
- private String tprecedingcomment;
+ private String tprecedingcomment = "";
private int tindex;
private List<ParsedPosting> tpostings;
private List<List<String>> ttags = new ArrayList<>();
}
public void setTindex(int tindex) {
this.tindex = tindex;
- for(ParsedPosting p : tpostings) {
- p.setPtransaction_(tindex);
- }
+ if (tpostings != null)
+ for (ParsedPosting p : tpostings) {
+ p.setPtransaction_(tindex);
+ }
}
public List<ParsedPosting> getTpostings() {
return tpostings;
}
+ public void setTpostings(List<ParsedPosting> tpostings) {
+ this.tpostings = tpostings;
+ }
public void addPosting(ParsedPosting posting) {
posting.setPtransaction_(tindex);
tpostings.add(posting);
}
- public void setTpostings(List<ParsedPosting> tpostings) {
- this.tpostings = tpostings;
- }
public LedgerTransaction asLedgerTransaction() throws ParseException {
Date date = Globals.parseIsoDate(tdate);
LedgerTransaction tr = new LedgerTransaction(tindex, date, tdescription);