Improve report boxes one by one #2428

This commit is contained in:
James Cole 2019-08-16 06:21:10 +02:00
parent 41c15b0cf8
commit d8eb59736e
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
18 changed files with 268 additions and 252 deletions

View File

@ -78,10 +78,10 @@ class OperationsController extends Controller
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore return $cache->get(); // @codeCoverageIgnore
} }
$entries = $this->tasker->getExpenseReport($start, $end, $accounts); $report = $this->tasker->getExpenseReport($start, $end, $accounts);
$type = 'expense-entry'; $type = 'expense-entry';
try { try {
$result = view('reports.partials.income-expenses', compact('entries', 'type'))->render(); $result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
} catch (Throwable $e) { } catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage())); Log::debug(sprintf('Could not render reports.partials.income-expense: %s', $e->getMessage()));
@ -113,17 +113,16 @@ class OperationsController extends Controller
if ($cache->has()) { if ($cache->has()) {
return $cache->get(); // @codeCoverageIgnore return $cache->get(); // @codeCoverageIgnore
} }
$entries = $this->tasker->getIncomeReport($start, $end, $accounts); $report = $this->tasker->getIncomeReport($start, $end, $accounts);
$type = 'income-entry'; $type = 'income-entry';
try { try {
$result = view('reports.partials.income-expenses', compact('entries', 'type'))->render(); $result = view('reports.partials.income-expenses', compact('report', 'type'))->render();
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
} catch (Throwable $e) { } catch (Throwable $e) {
Log::debug(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage())); Log::debug(sprintf('Could not render reports.partials.income-expenses: %s', $e->getMessage()));
$result = 'Could not render view.'; $result = 'Could not render view.';
} }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
$cache->store($result); $cache->store($result);
return $result; return $result;
@ -152,30 +151,32 @@ class OperationsController extends Controller
$incomes = $this->tasker->getIncomeReport($start, $end, $accounts); $incomes = $this->tasker->getIncomeReport($start, $end, $accounts);
$expenses = $this->tasker->getExpenseReport($start, $end, $accounts); $expenses = $this->tasker->getExpenseReport($start, $end, $accounts);
$incomeSum = array_sum( $sums = [];
array_map( $keys = array_unique(array_merge(array_keys($incomes['sums']), array_keys($expenses['sums'])));
static function ($item) {
return $item['sum'];
},
$incomes
)
);
$expensesSum = array_sum( /** @var int $currencyId */
array_map( foreach ($keys as $currencyId) {
static function ($item) { $currencyInfo = $incomes['sums'][$currencyId] ?? $expenses['sums'][$currencyId];
return $item['sum']; $sums[$currencyId] = $sums[$currencyId] ?? [
}, 'currency_id' => $currencyId,
$expenses 'currency_name' => $currencyInfo['currency_name'],
) 'currency_code' => $currencyInfo['currency_code'],
); 'currency_symbol' => $currencyInfo['currency_symbol'],
try { 'currency_decimal_places' => $currencyInfo['currency_decimal_places'],
$result = view('reports.partials.operations', compact('incomeSum', 'expensesSum'))->render(); 'in' => $incomes['sums'][$currencyId]['sum'] ?? '0',
// @codeCoverageIgnoreStart 'out' => $expenses['sums'][$currencyId]['sum'] ?? '0',
} catch (Throwable $e) { 'sum' => '0',
Log::debug(sprintf('Could not render reports.partials.operations: %s', $e->getMessage())); ];
$result = 'Could not render view.'; $sums[$currencyId]['sum'] = bcadd($sums[$currencyId]['in'], $sums[$currencyId]['out']);
} }
//try {
$result = view('reports.partials.operations', compact('sums'))->render();
// @codeCoverageIgnoreStart
// } catch (Throwable $e) {
// Log::debug(sprintf('Could not render reports.partials.operations: %s', $e->getMessage()));
// $result = 'Could not render view.';
// }
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
$cache->store($result); $cache->store($result);

View File

@ -304,7 +304,7 @@ class CreateRecurringTransactions implements ShouldQueue
Log::debug(sprintf('Now at date %s.', $date->format('Y-m-d'))); Log::debug(sprintf('Now at date %s.', $date->format('Y-m-d')));
$date->startOfDay(); $date->startOfDay();
if ($date->ne($this->date)) { if ($date->ne($this->date)) {
Log::debug(sprintf('%s is not not today (%s)', $date->format('Y-m-d'), $this->date->format('Y-m-d'))); Log::debug(sprintf('%s is not today (%s)', $date->format('Y-m-d'), $this->date->format('Y-m-d')));
return null; return null;
} }

View File

@ -55,7 +55,6 @@ class AccountTasker implements AccountTaskerInterface
* @param Carbon $end * @param Carbon $end
* *
* @return array * @return array
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/ */
public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array public function getAccountReport(Collection $accounts, Carbon $start, Carbon $end): array
{ {
@ -63,34 +62,40 @@ class AccountTasker implements AccountTaskerInterface
$yesterday->subDay(); $yesterday->subDay();
$startSet = app('steam')->balancesByAccounts($accounts, $yesterday); $startSet = app('steam')->balancesByAccounts($accounts, $yesterday);
$endSet = app('steam')->balancesByAccounts($accounts, $end); $endSet = app('steam')->balancesByAccounts($accounts, $end);
Log::debug('Start of accountreport'); Log::debug('Start of accountreport');
/** @var AccountRepositoryInterface $repository */ /** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class); $repository = app(AccountRepositoryInterface::class);
/** @var CurrencyRepositoryInterface $currencyRepository */
$currencyRepository = app(CurrencyRepositoryInterface::class);
$defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user); $defaultCurrency = app('amount')->getDefaultCurrencyByUser($this->user);
$return = [ $return = [
'currencies' => [],
'start' => '0',
'end' => '0',
'difference' => '0',
'accounts' => [], 'accounts' => [],
'sums' => [],
]; ];
/** @var Account $account */ /** @var Account $account */
foreach ($accounts as $account) { foreach ($accounts as $account) {
$id = $account->id; $id = $account->id;
$currencyId = (int)$repository->getMetaValue($account, 'currency_id'); $currency = $repository->getAccountCurrency($account) ?? $defaultCurrency;
$currency = $currencyRepository->findNull($currencyId); $return['sums'][$currency->id] = $return['sums'][$currency->id] ?? [
$return['currencies'][] = $currencyId; 'start' => '0',
'end' => '0',
'difference' => '0',
'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_name' => $currency->name,
'currency_decimal_places' => $currency->decimal_places,];
$entry = [ $entry = [
'name' => $account->name, 'name' => $account->name,
'id' => $account->id, 'id' => $account->id,
'currency' => $currency ?? $defaultCurrency, 'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_name' => $currency->name,
'currency_decimal_places' => $currency->decimal_places,
'start_balance' => '0', 'start_balance' => '0',
'end_balance' => '0', 'end_balance' => '0',
]; ];
@ -106,13 +111,14 @@ class AccountTasker implements AccountTaskerInterface
$entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount; $entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount;
Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance'])); Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance']));
} }
$return['start'] = bcadd($return['start'], $entry['start_balance']); $return['sums'][$currency->id]['start'] = bcadd($return['sums'][$currency->id]['start'], $entry['start_balance']);
$return['end'] = bcadd($return['end'], $entry['end_balance']); $return['sums'][$currency->id]['end'] = bcadd($return['sums'][$currency->id]['end'], $entry['end_balance']);
$return['accounts'][$id] = $entry; $return['accounts'][$id] = $entry;
} }
$return['currencies'] = count(array_unique($return['currencies']));
$return['difference'] = bcsub($return['end'], $return['start']); foreach (array_keys($return['sums']) as $index) {
$return['sums'][$index]['difference'] = bcsub($return['sums'][$index]['end'], $return['sums'][$index]['start']);
}
return $return; return $return;
} }
@ -135,21 +141,21 @@ class AccountTasker implements AccountTaskerInterface
$collector->setSourceAccounts($accounts)->setRange($start, $end); $collector->setSourceAccounts($accounts)->setRange($start, $end);
$collector->excludeDestinationAccounts($accounts); $collector->excludeDestinationAccounts($accounts);
$collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER]) $collector->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])->withAccountInformation();
->withAccountInformation();
$journals = $collector->getExtractedJournals(); $journals = $collector->getExtractedJournals();
$expenses = $this->groupExpenseByDestination($journals); $report = $this->groupExpenseByDestination($journals);
// sort the result // TODO sorting
// Obtain a list of columns // // sort the result
$sum = []; // // Obtain a list of columns
foreach ($expenses as $accountId => $row) { // $sum = [];
$sum[$accountId] = (float)$row['sum']; // foreach ($expenses as $accountId => $row) {
} // $sum[$accountId] = (float)$row['sum'];
// }
//
// array_multisort($sum, SORT_ASC, $expenses);
array_multisort($sum, SORT_ASC, $expenses); return $report;
return $expenses;
} }
/** /**
@ -169,20 +175,20 @@ class AccountTasker implements AccountTaskerInterface
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setDestinationAccounts($accounts)->setRange($start, $end); $collector->setDestinationAccounts($accounts)->setRange($start, $end);
$collector->excludeSourceAccounts($accounts); $collector->excludeSourceAccounts($accounts);
$collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER]) $collector->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])->withAccountInformation();
->withAccountInformation(); $report = $this->groupIncomeBySource($collector->getExtractedJournals());
$income = $this->groupIncomeBySource($collector->getExtractedJournals());
// sort the result // sort the result
// Obtain a list of columns // Obtain a list of columns
$sum = []; // $sum = [];
foreach ($income as $accountId => $row) { // foreach ($report['income'] as $accountId => $row) {
$sum[$accountId] = (float)$row['sum']; // $sum[$accountId] = (float)$row['sum'];
} // }
// TODO proper sorting.
//array_multisort($sum, SORT_DESC, $report);
// var_dump($report);exit;
array_multisort($sum, SORT_DESC, $income); return $report;
return $income;
} }
/** /**
@ -204,51 +210,52 @@ class AccountTasker implements AccountTaskerInterface
/** @var CurrencyRepositoryInterface $currencyRepos */ /** @var CurrencyRepositoryInterface $currencyRepos */
$currencyRepos = app(CurrencyRepositoryInterface::class); $currencyRepos = app(CurrencyRepositoryInterface::class);
$currencies = [$defaultCurrency->id => $defaultCurrency,]; $currencies = [$defaultCurrency->id => $defaultCurrency,];
$expenses = []; $report = [
$countAccounts = []; // if count remains 0 use original name, not the name with the currency. 'accounts' => [],
'sums' => [],
];
/** @var array $journal */ /** @var array $journal */
foreach ($array as $journal) { foreach ($array as $journal) {
$destinationId = (int)$journal['destination_account_id']; $sourceId = (int)$journal['destination_account_id'];
$currencyId = (int)$journal['currency_id']; $currencyId = (int)$journal['currency_id'];
$key = sprintf('%s-%s', $destinationId, $currencyId); $key = sprintf('%s-%s', $sourceId, $currencyId);
$name = sprintf('%s (%s)', $journal['destination_account_name'], $journal['currency_name']); if (!isset($report['accounts'][$key])) {
$countAccounts[$destinationId] = isset($countAccounts[$destinationId]) ? $countAccounts[$destinationId] + 1 : 1;
if (!isset($expenses[$key])) {
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId); $currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId);
$expenses[$key] = [ $report['accounts'][$key] = [
'id' => $destinationId, 'id' => $sourceId,
'name' => $name, 'name' => $journal['destination_account_name'],
'original' => $journal['destination_account_name'],
'sum' => '0', 'sum' => '0',
'average' => '0', 'average' => '0',
'currencies' => [],
'single_currency' => $currencies[$currencyId],
'count' => 0, 'count' => 0,
'currency_id' => $currencies[$currencyId]->id,
'currency_name' => $currencies[$currencyId]->name,
'currency_symbol' => $currencies[$currencyId]->symbol,
'currency_code' => $currencies[$currencyId]->code,
'currency_decimal_places' => $currencies[$currencyId]->decimal_places,
]; ];
} }
$expenses[$key]['currencies'][] = (int)$journal['currency_id']; $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], $journal['amount']);
$expenses[$key]['sum'] = bcadd($expenses[$key]['sum'], $journal['amount']); ++$report['accounts'][$key]['count'];
++$expenses[$key]['count'];
} }
// do averages: // do averages and sums.
$keys = array_keys($expenses); foreach (array_keys($report['accounts']) as $key) {
foreach ($keys as $key) { if ($report['accounts'][$key]['count'] > 1) {
$opposingId = $expenses[$key]['id']; $report['accounts'][$key]['average'] = bcdiv($report['accounts'][$key]['sum'], (string)$report['accounts'][$key]['count']);
if (1 === $countAccounts[$opposingId]) {
$expenses[$key]['name'] = $expenses[$key]['original'];
} }
$currencyId = $report['accounts'][$key]['currency_id'];
if ($expenses[$key]['count'] > 1) { $report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
$expenses[$key]['average'] = bcdiv($expenses[$key]['sum'], (string)$expenses[$key]['count']); 'sum' => '0',
'currency_id' => $report['accounts'][$key]['currency_id'],
'currency_name' => $report['accounts'][$key]['currency_name'],
'currency_symbol' => $report['accounts'][$key]['currency_symbol'],
'currency_code' => $report['accounts'][$key]['currency_code'],
'currency_decimal_places' => $report['accounts'][$key]['currency_decimal_places'],
];
$report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
} }
$expenses[$key]['currencies'] = count(array_unique($expenses[$key]['currencies'])); return $report;
$expenses[$key]['all_currencies'] = count($currencies);
}
return $expenses;
} }
/** /**
@ -262,50 +269,52 @@ class AccountTasker implements AccountTaskerInterface
/** @var CurrencyRepositoryInterface $currencyRepos */ /** @var CurrencyRepositoryInterface $currencyRepos */
$currencyRepos = app(CurrencyRepositoryInterface::class); $currencyRepos = app(CurrencyRepositoryInterface::class);
$currencies = [$defaultCurrency->id => $defaultCurrency,]; $currencies = [$defaultCurrency->id => $defaultCurrency,];
$income = []; $report = [
$countAccounts = []; // if count remains 0 use original name, not the name with the currency. 'accounts' => [],
'sums' => [],
];
/** @var array $journal */ /** @var array $journal */
foreach ($array as $journal) { foreach ($array as $journal) {
$sourceId = (int)$journal['source_account_id']; $sourceId = (int)$journal['source_account_id'];
$currencyId = (int)$journal['currency_id']; $currencyId = (int)$journal['currency_id'];
$key = sprintf('%s-%s', $sourceId, $currencyId); $key = sprintf('%s-%s', $sourceId, $currencyId);
$name = sprintf('%s (%s)', $journal['source_account_name'], $journal['currency_name']); if (!isset($report['accounts'][$key])) {
$countAccounts[$sourceId] = isset($countAccounts[$sourceId]) ? $countAccounts[$sourceId] + 1 : 1;
if (!isset($income[$key])) {
$currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId); $currencies[$currencyId] = $currencies[$currencyId] ?? $currencyRepos->findNull($currencyId);
$income[$key] = [ $report['accounts'][$key] = [
'id' => $sourceId, 'id' => $sourceId,
'name' => $name, 'name' => $journal['source_account_name'],
'original' => $journal['source_account_name'],
'sum' => '0', 'sum' => '0',
'average' => '0', 'average' => '0',
'currencies' => [],
'single_currency' => $currencies[$currencyId],
'count' => 0, 'count' => 0,
'currency_id' => $currencies[$currencyId]->id,
'currency_name' => $currencies[$currencyId]->name,
'currency_symbol' => $currencies[$currencyId]->symbol,
'currency_code' => $currencies[$currencyId]->code,
'currency_decimal_places' => $currencies[$currencyId]->decimal_places,
]; ];
} }
$income[$key]['currencies'][] = (int)$journal['currency_id']; $report['accounts'][$key]['sum'] = bcadd($report['accounts'][$key]['sum'], bcmul($journal['amount'], '-1'));
$income[$key]['sum'] = bcadd($income[$key]['sum'], bcmul($journal['amount'], '-1')); ++$report['accounts'][$key]['count'];
++$income[$key]['count'];
} }
// do averages: // do averages and sums.
$keys = array_keys($income); foreach (array_keys($report['accounts']) as $key) {
foreach ($keys as $key) { if ($report['accounts'][$key]['count'] > 1) {
$opposingId = $income[$key]['id']; $report['accounts'][$key]['average'] = bcdiv($report['accounts'][$key]['sum'], (string)$report['accounts'][$key]['count']);
if (1 === $countAccounts[$opposingId]) { }
$income[$key]['name'] = $income[$key]['original']; $currencyId = $report['accounts'][$key]['currency_id'];
$report['sums'][$currencyId] = $report['sums'][$currencyId] ?? [
'sum' => '0',
'currency_id' => $report['accounts'][$key]['currency_id'],
'currency_name' => $report['accounts'][$key]['currency_name'],
'currency_symbol' => $report['accounts'][$key]['currency_symbol'],
'currency_code' => $report['accounts'][$key]['currency_code'],
'currency_decimal_places' => $report['accounts'][$key]['currency_decimal_places'],
];
$report['sums'][$currencyId]['sum'] = bcadd($report['sums'][$currencyId]['sum'], $report['accounts'][$key]['sum']);
} }
if ($income[$key]['count'] > 1) { return $report;
$income[$key]['average'] = bcdiv($income[$key]['sum'], (string)$income[$key]['count']);
}
$income[$key]['currencies'] = count(array_unique($income[$key]['currencies']));
$income[$key]['all_currencies'] = count($currencies);
}
return $income;
} }
} }

View File

@ -94,9 +94,9 @@
<td style="text-align: right;"> <td style="text-align: right;">
<span style="margin-right:5px;"> <span style="margin-right:5px;">
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
</span> </span>
</td> </td>

View File

@ -25,13 +25,13 @@ TODO: hide and show columns
<td colspan="2" style="border-top:1px #aaa solid;"> <td colspan="2" style="border-top:1px #aaa solid;">
{% for sum in group.sums %} {% for sum in group.sums %}
{% if group.transaction_type == 'Deposit' %} {% if group.transaction_type == 'Deposit' %}
{{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_symbol_decimal_places) }}{% if loop.index != group.sums|length %},{% endif %} {{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_decimal_places) }}{% if loop.index != group.sums|length %},{% endif %}
{% elseif group.transaction_type == 'Transfer' %} {% elseif group.transaction_type == 'Transfer' %}
<span class="text-info"> <span class="text-info">
{{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_symbol_decimal_places, false) }}{% if loop.index != group.sums|length %},{% endif %}X {{ formatAmountBySymbol(sum.amount*-1, sum.currency_symbol, sum.currency_decimal_places, false) }}{% if loop.index != group.sums|length %},{% endif %}X
</span> </span>
{% else %} {% else %}
{{ formatAmountBySymbol(sum.amount, sum.currency_symbol, sum.currency_symbol_decimal_places) }}{% if loop.index != group.sums|length %},{% endif %} {{ formatAmountBySymbol(sum.amount, sum.currency_symbol, sum.currency_decimal_places) }}{% if loop.index != group.sums|length %},{% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</td> </td>
@ -90,21 +90,21 @@ TODO: hide and show columns
</td> </td>
<td style=" {{ style|raw }}"> <td style=" {{ style|raw }}">
{% if transaction.transaction_type_type == 'Deposit' %} {% if transaction.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% elseif transaction.transaction_type_type == 'Transfer' %} {% elseif transaction.transaction_type_type == 'Transfer' %}
<span class="text-info"> <span class="text-info">
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places, false) }} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %} {% endif %}
</span> </span>
{% else %} {% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% endif %} {% endif %}
</td> </td>

View File

@ -63,23 +63,23 @@
<td> <td>
{% if transaction.transaction_type_type == 'Deposit' %} {% if transaction.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% set sum = (sum + (transaction.amount*-1)) %} {% set sum = (sum + (transaction.amount*-1)) %}
{% elseif transaction.transaction_type_type == 'Transfer' %} {% elseif transaction.transaction_type_type == 'Transfer' %}
<span class="text-info"> <span class="text-info">
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places, false) }} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %} {% endif %}
</span> </span>
{% set sum = (sum + transaction.amount*-1) %} {% set sum = (sum + transaction.amount*-1) %}
{% else %} {% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% set sum = (sum + transaction.amount) %} {% set sum = (sum + transaction.amount) %}
{% endif %} {% endif %}

View File

@ -250,7 +250,7 @@
<td data-value="{{ row.amount}}" style="text-align: right;"> <td data-value="{{ row.amount}}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td> </td>
</tr> </tr>

View File

@ -283,7 +283,7 @@
</a> </a>
</td> </td>
<td data-value="{{ row.amount }}" style="text-align: right;"> <td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
@ -404,7 +404,7 @@
</a> </a>
</td> </td>
<td data-value="{{ row.amount }}" style="text-align: right;"> <td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount*-1, row.currency_symbol, row.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(row.amount*-1, row.currency_symbol, row.currency_decimal_places) }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -14,28 +14,35 @@
<a href="{{ route('accounts.show',account.id) }}" title="{{ account.name }}">{{ account.name }}</a> <a href="{{ route('accounts.show',account.id) }}" title="{{ account.name }}">{{ account.name }}</a>
</td> </td>
<td class="hidden-xs" data-value="{{ account.start_balance }}" style="text-align: right;"> <td class="hidden-xs" data-value="{{ account.start_balance }}" style="text-align: right;">
{{ formatAmountByCurrency(account.currency, account.start_balance) }} {{ formatAmountBySymbol(account.start_balance, account.currency_symbol, account.currency_decimal_places) }}
</td> </td>
<td class="hidden-xs" data-value="{{ account.end_balance }}" style="text-align: right;"> <td class="hidden-xs" data-value="{{ account.end_balance }}" style="text-align: right;">
{{ formatAmountByCurrency(account.currency, account.end_balance) }}</td> {{ formatAmountBySymbol(account.end_balance, account.currency_symbol, account.currency_decimal_places) }}
</td>
<td style="text-align: right;" <td style="text-align: right;"
data-value="{{ (account.end_balance - account.start_balance) }}"> data-value="{{ (account.end_balance - account.start_balance) }}">
{{ formatAmountByCurrency(account.currency, (account.end_balance - account.start_balance)) }} {{ formatAmountBySymbol(account.end_balance - account.start_balance, account.currency_symbol, account.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
<tr>
<td colspan="4"><em>{{ 'sumOfSums'|_ }}</em></td>
</tr>
{% for sum in accountReport.sums %}
<tr>
<td>
&nbsp;
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.start, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.end, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.difference, sum.currency_symbol, sum.currency_decimal_places) }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot>
<tr>
<td><em>{{ 'sumOfSums'|_ }}</em></td>
<td class="hidden-xs" style="text-align: right;">{{ accountReport.start|formatAmount }}</td>
<td class="hidden-xs" style="text-align: right;">{{ accountReport.end|formatAmount }}</td>
<td style="text-align: right;">{{ accountReport.difference|formatAmount }}</td>
</tr>
{% if accountReport.currencies > 1 %}
<tr>
<td colspan="4"><small class="text-warning">{{ 'multi_currency_report_sum'|_ }}</small></td>
</tr>
{% endif %}
</tfoot>
</table> </table>

View File

@ -8,58 +8,54 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% set sum = 0 %} {% for account in report.accounts %}
{% for entry in entries %}
{% set sum = sum + entry.sum %}
{% if loop.index > listLength %} {% if loop.index > listLength %}
<tr class="overListLength"> <tr class="overListLength">
{% else %} {% else %}
<tr> <tr>
{% endif %} {% endif %}
<td data-value="{{ entry.name }}"> <td data-value="{{ account.name }}">
<a href="{{ route('accounts.show',entry.id) }}">{{ entry.name }}</a> <a href="{{ route('accounts.show',account.id) }}">{{ account.name }}</a>
{% if entry.count > 1 %} {% if account.count > 1 %}
<br/> <br/>
<small> <small>
{{ entry.count }} {{ 'transactions'|_|lower }} {{ account.count }} {{ 'transactions'|_|lower }}
</small> </small>
{% endif %} {% endif %}
</td> </td>
<td data-value="{{ entry.sum }}" style="text-align: right;"> <td data-value="{{ account.sum }}" style="text-align: right;">
{% if entry.currencies == 1 %} {{ formatAmountBySymbol(account.sum, account.currency_symbol, account.currency_decimal_places) }}
{{ formatAmountByCurrency(entry.single_currency, entry.sum) }}
{% else %}
{{ (entry.sum)|formatAmount }}
{% endif %}
</td> </td>
<td class="hidden-xs" data-value="{{ entry.average }}" style="text-align: right;"> <td class="hidden-xs" data-value="{{ entry.average }}" style="text-align: right;">
{% if entry.count > 1 %} {% if entry.count > 1 %}
{{ entry.average|formatAmount }} {{ formatAmountBySymbol(account.average, account.currency_symbol, account.currency_decimal_places) }}
{% else %} {% else %}
&mdash; &mdash;
{% endif %} {% endif %}
</td> </td>
<td> <td>
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="{{ type }}" <i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="{{ type }}"
data-account-id="{{ entry.id }}"></i> data-account-id="{{ account.id }}"></i>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
{% if entries|length > listLength %} {% if report.accounts|length > listLength %}
<tr> <tr>
<td colspan="4" class="active"> <td colspan="4" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a> <a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
{% for sum in report.sums %}
<tr> <tr>
<td><em>{{ 'sum'|_ }}</em></td> <td><em>{{ 'sum'|_ }} ({{ sum.currency_name }})</em></td>
<td style="text-align: right;">{{ (sum)|formatAmount }}</td> <td style="text-align: right;">
{{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td>&nbsp;</td>
</tr> </tr>
<tr> {% endfor %}
<td colspan="4"><small class="text-warning">{{ 'sum_in_default_currency'|_ }}</small></td>
</tr>
</tfoot>
</table> </table>

View File

@ -77,14 +77,14 @@
</td> </td>
<td class="hide-balance_before" style="text-align: right;"> <td class="hide-balance_before" style="text-align: right;">
{{ formatAmountBySymbol(journal.balance_before, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.balance_before, journal.currency_symbol, journal.currency_decimal_places) }}
</td> </td>
<td class="hide-amount" style="text-align: right;"> <td class="hide-amount" style="text-align: right;">
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
</td> </td>
<td class="hide-balance_after" style="text-align: right;"> <td class="hide-balance_after" style="text-align: right;">
{{ formatAmountBySymbol(journal.balance_after, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.balance_after, journal.currency_symbol, journal.currency_decimal_places) }}
</td> </td>
<td class="hide-date">{{ journal.date.formatLocalized(monthAndDayFormat) }}</td> <td class="hide-date">{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>

View File

@ -1,19 +1,22 @@
<table class="table table-hover"> <table class="table table-hover">
<tr> <tr>
<td>{{ 'money_flowing_in'|_ }}</td> <th>{{'currency'|_}}</th>
<td style="text-align: right;">{{ incomeSum|formatAmount }}</td> <th>{{ 'money_flowing_in'|_ }}</th>
<th>{{ 'money_flowing_out'|_ }}</th>
<th>{{ 'difference'|_ }}</th>
</tr> </tr>
{% for sum in sums %}
<tr> <tr>
<td>{{ 'money_flowing_out'|_ }}</td> <td>{{ sum.currency_name }} ({{ sum.currency_symbol }})</td>
<td style="text-align: right;">{{ expensesSum|formatAmount }}</td> <td>
</tr> {{ formatAmountBySymbol(sum.in, sum.currency_symbol, sum.currency_decimal_places) }}
<tr> </td>
<td>{{ 'difference'|_ }}</td> <td>
<td style="text-align: right;">{{ (incomeSum + expensesSum)|formatAmount }}</td> {{ formatAmountBySymbol(sum.out, sum.currency_symbol, sum.currency_decimal_places) }}
</tr> </td>
<tr> <td>
<td colspan="2"> {{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}
<small class="text-warning">{{ 'sum_in_default_currency'|_ }}</small>
</td> </td>
</tr> </tr>
{% endfor %}
</table> </table>

View File

@ -20,9 +20,9 @@
<td style="text-align: right;" data-value="{{ transaction.amount}}"><span <td style="text-align: right;" data-value="{{ transaction.amount}}"><span
style="margin-right:5px;"> style="margin-right:5px;">
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
</span></td> </span></td>
</tr> </tr>

View File

@ -300,7 +300,7 @@
</a> </a>
</td> </td>
<td data-value="{{ row.amount }}" style="text-align: right;"> <td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

@ -43,21 +43,21 @@
{{ journal.description }}</a></td> {{ journal.description }}</a></td>
<td> <td>
{% if journal.transaction_type_type == 'Deposit' %} {% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %} {% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info"> <span class="text-info">
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }} {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %} {% endif %}
</span> </span>
{% else %} {% else %}
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -254,19 +254,19 @@
</td> </td>
<td> <td>
{% if transaction.transaction_type_type == 'Deposit' %} {% if transaction.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% elseif transaction.transaction_type_type == 'Transfer' %} {% elseif transaction.transaction_type_type == 'Transfer' %}
<span class="text-info">{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_symbol_decimal_places, false) }} <span class="text-info">{{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places, false) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places, false) }})
{% endif %}</span> {% endif %}</span>
{% else %} {% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %} {% if null != transaction.foreign_amount %}
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% endif %} {% endif %}
</td> </td>

View File

@ -65,20 +65,20 @@
</td> </td>
<td> <td>
{% if journal.transaction_type_type == 'Deposit' %} {% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %} {% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info">{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }} <span class="text-info">{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %} {% endif %}
</span> </span>
{% else %} {% else %}
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% endif %} {% endif %}
</td> </td>

View File

@ -69,21 +69,21 @@
<span class="text-sm"> <span class="text-sm">
{% if journal.reconciled != false %} {% if journal.reconciled != false %}
{% if journal.transaction_type_type == 'Deposit' %} {% if journal.transaction_type_type == 'Deposit' %}
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% elseif journal.transaction_type_type == 'Transfer' %} {% elseif journal.transaction_type_type == 'Transfer' %}
<span class="text-info"> <span class="text-info">
{{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_symbol_decimal_places, false) }} {{ formatAmountBySymbol(journal.amount*-1, journal.currency_symbol, journal.currency_decimal_places, false) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places, false) }}) ({{ formatAmountBySymbol(journal.foreign_amount*-1, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places, false) }})
{% endif %} {% endif %}
</span> </span>
{% else %} {% else %}
{{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_symbol_decimal_places) }} {{ formatAmountBySymbol(journal.amount, journal.currency_symbol, journal.currency_decimal_places) }}
{% if null != journal.foreign_amount %} {% if null != journal.foreign_amount %}
({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_symbol_decimal_places) }}) ({{ formatAmountBySymbol(journal.foreign_amount, journal.foreign_currency_symbol, journal.foreign_currency_decimal_places) }})
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}