From 9b2ed5acac2771812a115f83273691b55185c4fd Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 4 Oct 2020 05:50:50 +0000 Subject: [PATCH] Revert "remove references to style members from the parser classes" Breaks new transaction submission This reverts commit 47f69abd0ff71ef40d37fc8b9f8693d370f473ea. --- .../net/ktnx/mobileledger/json/v1_15/ParsedAmount.java | 10 +++++++++- .../ktnx/mobileledger/json/v1_15/ParsedBalance.java | 9 ++++++++- .../ktnx/mobileledger/json/v1_15/ParsedPosting.java | 8 +++++++- .../net/ktnx/mobileledger/json/v1_15/ParsedPrice.java | 7 +++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java index dd32d8b6..3dee4ae9 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedAmount.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2019 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -24,6 +24,7 @@ public class ParsedAmount { private String acommodity; private ParsedQuantity aquantity; private boolean aismultiplier; + private ParsedStyle astyle; private ParsedPrice aprice; public ParsedAmount() { } @@ -51,4 +52,11 @@ public class ParsedAmount { public void setAismultiplier(boolean aismultiplier) { this.aismultiplier = aismultiplier; } + public ParsedStyle getAstyle() { + return astyle; + } + public void setAstyle(ParsedStyle astyle) { + this.astyle = astyle; + } + } diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java index c2854c0e..24e9ccb0 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedBalance.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2019 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; public class ParsedBalance { private ParsedQuantity aquantity; private String acommodity; + private ParsedStyle astyle; public ParsedBalance() { } public ParsedQuantity getAquantity() { @@ -40,4 +41,10 @@ public class ParsedBalance { public void setAcommodity(String acommodity) { this.acommodity = acommodity; } + public ParsedStyle getAstyle() { + return astyle; + } + public void setAstyle(ParsedStyle astyle) { + this.astyle = astyle; + } } diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java index d773420e..38777684 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPosting.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Damyan Ivanov. + * Copyright © 2019 Damyan Ivanov. * This file is part of MoLe. * MoLe is free software: you can distribute it and/or modify it * under the term of the GNU General Public License as published by @@ -56,6 +56,12 @@ public class ParsedPosting extends net.ktnx.mobileledger.json.ParsedPosting { qty.setDecimalPlaces(2); qty.setDecimalMantissa(Math.round(acc.getAmount() * 100)); amt.setAquantity(qty); + ParsedStyle style = new ParsedStyle(); + style.setAscommodityside(getCommoditySide()); + style.setAscommodityspaced(getCommoditySpaced()); + style.setAsprecision(2); + style.setAsdecimalpoint('.'); + amt.setAstyle(style); if (acc.getCurrency() != null) amt.setAcommodity(acc.getCurrency()); amounts.add(amt); diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java index d3691d66..0b93e15f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedPrice.java @@ -40,6 +40,7 @@ class ParsedPrice { private ParsedQuantity aquantity; private String acommodity; private boolean aismultiplier; + private ParsedStyle astyle; public Contents() { acommodity = ""; } @@ -67,5 +68,11 @@ class ParsedPrice { public void setAismultiplier(boolean aismultiplier) { this.aismultiplier = aismultiplier; } + public ParsedStyle getAstyle() { + return astyle; + } + public void setAstyle(ParsedStyle astyle) { + this.astyle = astyle; + } } } -- 2.39.5