From aebf45697fa92b4e9ca1ae2293006f34c14f3a2e Mon Sep 17 00:00:00 2001 From: Florian Dupret Date: Thu, 28 May 2020 19:08:34 +0200 Subject: [PATCH] fix #3407 --- resources/views/v1/transactions/show.twig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/views/v1/transactions/show.twig b/resources/views/v1/transactions/show.twig index c0b3c81da9..cb34544955 100644 --- a/resources/views/v1/transactions/show.twig +++ b/resources/views/v1/transactions/show.twig @@ -131,6 +131,13 @@ {{ formatAmountBySymbol(amount.amount, amount.symbol, amount.decimal_places, false) }}{% if loop.index0 != amounts|length -1 %}, {% endif %} + {% elseif first.transactiontype.type == 'Opening balance' %} + {# Opening balance stored amount is always negative: find out which way the money goes #} + {% if groupArray.transactions[0].source_type == 'Initial balance account' %} + {{ formatAmountBySymbol(amount.amount*-1,amount.symbol, amount.decimal_places) }} + {% else %} + {{ formatAmountBySymbol(amount.amount,amount.symbol, amount.decimal_places) }} + {% endif %} {% endif %} {% endfor %}