Skip to content

Firefly III: a personal finances manager

Fix issue with reconciliation displayed amount.

James Coled55cc03edf3e
diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php
index e9313b62df..5c7c09679c 100644
--- a/app/Support/Twig/TransactionGroupTwig.php
+++ b/app/Support/Twig/TransactionGroupTwig.php
@@ -280,10 +280,16 @@ class TransactionGroupTwig extends AbstractExtension
$amount = bcmul($amount, '-1');
}
$destinationType = $array['destination_account_type'] ?? 'invalid';
+ // opening balance and it goes to initial balance? its expense.
if ($type === TransactionType::OPENING_BALANCE && AccountType::INITIAL_BALANCE === $destinationType) {
$amount = bcmul($amount, '-1');
}
+ // reconciliation and it goes to reconciliation?
+ if ($type === TransactionType::RECONCILIATION && AccountType::RECONCILIATION === $destinationType) {
+ $amount = bcmul($amount, '-1');
+ }
+
if ($type === TransactionType::TRANSFER) {
$colored = false;
}
diff --git a/resources/views/v1/list/groups.twig b/resources/views/v1/list/groups.twig
index 4b84c35dcb..d73b576bdf 100644
--- a/resources/views/v1/list/groups.twig
+++ b/resources/views/v1/list/groups.twig
@@ -155,6 +155,18 @@ TODO: hide and show columns
({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
{% endif %}
{% endif %}
+ {% elseif transaction.transaction_type_type == 'Reconciliation' %}
+ {% if transaction.source_account_type == 'Reconciliation account' %}
+ {{ formatAmountBySymbol(transaction.amount*-1, transaction.currency_symbol, transaction.currency_decimal_places) }}
+ {% if null != transaction.foreign_amount %}
+ ({{ formatAmountBySymbol(transaction.foreign_amount*-1, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
+ {% endif %}
+ {% else %}
+ {{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
+ {% if null != transaction.foreign_amount %}
+ ({{ formatAmountBySymbol(transaction.foreign_amount, transaction.foreign_currency_symbol, transaction.foreign_currency_decimal_places) }})
+ {% endif %}
+ {% endif %}
{% else %}
{{ formatAmountBySymbol(transaction.amount, transaction.currency_symbol, transaction.currency_decimal_places) }}
{% if null != transaction.foreign_amount %}