From 4f7aa3c8dc34ffc7d6b2707d622a007151b3d018 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 30 Nov 2019 23:04:41 +0200 Subject: [PATCH] ParsedAmount: do not create a price member object by default when no price is entered the member should be sent as null, otherwise hledger-web 1.15.2 rejects the request with err 400 and complains about invalid price object further fixing this would need making it send a proper price object, but since MoLe doesn't support entering prices, that is left for the future --- app/src/main/java/net/ktnx/mobileledger/json/ParsedAmount.java | 2 +- app/src/main/java/net/ktnx/mobileledger/json/ParsedPrice.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/json/ParsedAmount.java b/app/src/main/java/net/ktnx/mobileledger/json/ParsedAmount.java index 4d38c55b..e66258b1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/ParsedAmount.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/ParsedAmount.java @@ -25,7 +25,7 @@ public class ParsedAmount { private ParsedQuantity aquantity; private boolean aismultiplier; private ParsedStyle astyle; - private ParsedPrice aprice = new ParsedPrice(); + private ParsedPrice aprice; public ParsedAmount() { } public ParsedPrice getAprice() { diff --git a/app/src/main/java/net/ktnx/mobileledger/json/ParsedPrice.java b/app/src/main/java/net/ktnx/mobileledger/json/ParsedPrice.java index fe152565..fe8154cd 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/ParsedPrice.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/ParsedPrice.java @@ -42,6 +42,7 @@ class ParsedPrice { private boolean aismultiplier; private ParsedStyle astyle; public Contents() { + acommodity = ""; } public ParsedPrice getAprice() { return aprice; -- 2.39.5