From: Damyan Ivanov Date: Wed, 13 May 2020 18:41:28 +0000 (+0300) Subject: pass transaction comment to the JSON API X-Git-Tag: v0.13.0~12 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ca1f506ac639a2590b2170e277d2913eeb350f61;p=mobile-ledger.git 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) --- 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++) {