Rollback #3382 part 2

This commit is contained in:
Florian Dupret 2020-08-01 18:53:42 +02:00
parent f4b6a63514
commit 9db79c3142

View File

@ -273,19 +273,19 @@ class TransactionGroupTwig extends AbstractExtension
* *
* @return string * @return string
*/ */
private function normalJournalArrayAmount(array $journal): string private function normalJournalArrayAmount(array $array): string
{ {
$type = $journal['transaction_type_type'] ?? TransactionType::WITHDRAWAL; $type = $array['transaction_type_type'] ?? TransactionType::WITHDRAWAL;
$amount = $journal['amount'] ?? '0'; $amount = $array['amount'] ?? '0';
$colored = true; $colored = true;
$sourceType = $journal['source_account_type'] ?? 'invalid'; $sourceType = $array['source_account_type'] ?? 'invalid';
$amount = $this->signAmount($amount, $type, $sourceType); $amount = $this->signAmount($amount, $type, $sourceType);
if ($type === TransactionType::TRANSFER) { if ($type === TransactionType::TRANSFER) {
$colored = false; $colored = false;
} }
$result = app('amount')->formatFlat($journal['currency_symbol'], (int)$journal['currency_decimal_places'], $amount, $colored); $result = app('amount')->formatFlat($array['currency_symbol'], (int)$array['currency_decimal_places'], $amount, $colored);
if ($type === TransactionType::TRANSFER) { if ($type === TransactionType::TRANSFER) {
$result = sprintf('<span class="text-info">%s</span>', $result); $result = sprintf('<span class="text-info">%s</span>', $result);
} }