From ca1f506ac639a2590b2170e277d2913eeb350f61 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 13 May 2020 21:41:28 +0300 Subject: [PATCH] pass transaction comment to the JSON API as a 'same line' comment, e.g. date description ; comment account 42 account the "preceding" comment is not working (at least with 1.14) --- .../ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java | 2 +- .../ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java | 2 +- .../ktnx/mobileledger/ui/activity/NewTransactionFragment.java | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java index e95c27c1..058319a3 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_14/ParsedLedgerTransaction.java @@ -48,7 +48,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse public static ParsedLedgerTransaction fromLedgerTransaction(LedgerTransaction tr) { ParsedLedgerTransaction result = new ParsedLedgerTransaction(); - result.setTcomment(""); + result.setTcomment(tr.getComment()); result.setTprecedingcomment(""); ArrayList postings = new ArrayList<>(); diff --git a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java index 2f6867dc..1cffcfac 100644 --- a/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java +++ b/app/src/main/java/net/ktnx/mobileledger/json/v1_15/ParsedLedgerTransaction.java @@ -46,7 +46,7 @@ public class ParsedLedgerTransaction implements net.ktnx.mobileledger.json.Parse } public static ParsedLedgerTransaction fromLedgerTransaction(LedgerTransaction tr) { ParsedLedgerTransaction result = new ParsedLedgerTransaction(); - result.setTcomment(""); + result.setTcomment(tr.getComment()); result.setTprecedingcomment(""); ArrayList postings = new ArrayList<>(); diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java index 39f53a97..2b3adc9f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java @@ -201,6 +201,7 @@ public class NewTransactionFragment extends Fragment { LedgerTransaction tr = new LedgerTransaction(null, date, viewModel.getDescription(), mProfile); + tr.setComment(viewModel.getComment()); LedgerTransactionAccount emptyAmountAccount = null; float emptyAmountAccountBalance = 0; for (int i = 0; i < viewModel.getAccountCount(); i++) { -- 2.39.5