mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-20 11:48:27 -06:00
Optimize again for account name [skip ci]
This commit is contained in:
parent
750b9d8038
commit
eecb6c6679
@ -189,9 +189,18 @@ class Transaction extends Twig_Extension
|
||||
$name = intval($transaction->account_encrypted) === 1 ? Crypt::decrypt($transaction->account_name) : $transaction->account_name;
|
||||
$id = intval($transaction->account_id);
|
||||
$type = $transaction->account_type;
|
||||
// if the amount is positive, assume that the current account (the one in $transaction) is indeed the destination account.
|
||||
|
||||
if (bccomp($transaction->transaction_amount, '0') === -1) {
|
||||
// name is present in object, use that one:
|
||||
if (bccomp($transaction->transaction_amount, '0') === -1 && !is_null($transaction->opposing_account_id)) {
|
||||
|
||||
$name = intval($transaction->opposing_account_encrypted) === 1 ? Crypt::decrypt($transaction->opposing_account_name)
|
||||
: $transaction->opposing_account_name;
|
||||
$id = intval($transaction->opposing_account_id);
|
||||
$type = intval($transaction->opposing_account_type);
|
||||
}
|
||||
|
||||
// Find the opposing account and use that one:
|
||||
if (bccomp($transaction->transaction_amount, '0') === -1 && is_null($transaction->opposing_account_id)) {
|
||||
// if the amount is negative, find the opposing account and use that one:
|
||||
$journalId = $transaction->journal_id;
|
||||
/** @var TransactionModel $other */
|
||||
|
Loading…
Reference in New Issue
Block a user