Fix issue with reconciliation displayed amount.

This commit is contained in:
James Cole
2020-07-18 04:45:12 +02:00
parent 1282009257
commit d55cc03edf
2 changed files with 18 additions and 0 deletions

View File

@@ -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;
}