mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Optimize again for account name [skip ci]
This commit is contained in:
@@ -189,9 +189,18 @@ class Transaction extends Twig_Extension
|
|||||||
$name = intval($transaction->account_encrypted) === 1 ? Crypt::decrypt($transaction->account_name) : $transaction->account_name;
|
$name = intval($transaction->account_encrypted) === 1 ? Crypt::decrypt($transaction->account_name) : $transaction->account_name;
|
||||||
$id = intval($transaction->account_id);
|
$id = intval($transaction->account_id);
|
||||||
$type = $transaction->account_type;
|
$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:
|
// if the amount is negative, find the opposing account and use that one:
|
||||||
$journalId = $transaction->journal_id;
|
$journalId = $transaction->journal_id;
|
||||||
/** @var TransactionModel $other */
|
/** @var TransactionModel $other */
|
||||||
|
Reference in New Issue
Block a user