From 6f1b41d75a0814639a0000024c353e343ce56340 Mon Sep 17 00:00:00 2001 From: Rutvik Rajendra Panchal <39809059+rutvik-panchal@users.noreply.github.com> Date: Sun, 29 Nov 2020 20:37:16 +0530 Subject: [PATCH] fix- Displayed Currency Code or Symbol --- .../ui/fragments/LoanAccountsDetailFragment.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/mifos/mobile/ui/fragments/LoanAccountsDetailFragment.kt b/app/src/main/java/org/mifos/mobile/ui/fragments/LoanAccountsDetailFragment.kt index a7e539993..4d0b1bdfc 100644 --- a/app/src/main/java/org/mifos/mobile/ui/fragments/LoanAccountsDetailFragment.kt +++ b/app/src/main/java/org/mifos/mobile/ui/fragments/LoanAccountsDetailFragment.kt @@ -152,18 +152,19 @@ class LoanAccountsDetailFragment : BaseFragment(), LoanAccountsDetailView { * @param loanWithAssociations object containing details of each loan account, */ fun showDetails(loanWithAssociations: LoanWithAssociations?) { - tvOutstandingBalanceName?.text = resources.getString(R.string.string_and_string, - loanWithAssociations?.summary?.currency?.displaySymbol, CurrencyUtil.formatCurrency(activity, - loanWithAssociations?.summary?.totalOutstanding)) + var currencyRepresentation = loanWithAssociations?.summary?.currency?.displaySymbol + if (currencyRepresentation == null) { + currencyRepresentation = loanWithAssociations?.summary?.currency?.code + } + tvOutstandingBalanceName?.text = currencyRepresentation + + CurrencyUtil.formatCurrency(activity, loanWithAssociations?.summary?.totalOutstanding) if (loanWithAssociations?.repaymentSchedule?.periods != null) for ((_, _, dueDate, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, totalDueForPeriod) in loanWithAssociations.repaymentSchedule?.periods!!) { if (dueDate == loanWithAssociations.summary?.getOverdueSinceDate()) { - tvNextInstallmentName?.text = resources.getString(R.string.string_and_string, - loanWithAssociations.summary?.currency?.displaySymbol, - CurrencyUtil.formatCurrency(activity, - totalDueForPeriod)) + tvNextInstallmentName?.text = currencyRepresentation + + CurrencyUtil.formatCurrency(activity, totalDueForPeriod) break } else if (loanWithAssociations.summary?.getOverdueSinceDate() == null) { - tvNextInstallmentName?.setText(R.string.not_available) + tvNextInstallmentName?.text = getString(R.string.not_available) } } tvAccountNumberName?.text = loanWithAssociations?.accountNo