mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Build edit split transactions.
This commit is contained in:
@@ -72,13 +72,10 @@ class TransactionJournalSupport extends Model
|
||||
return $cache->get();
|
||||
}
|
||||
|
||||
$amount = '0';
|
||||
/** @var Transaction $t */
|
||||
foreach ($journal->transactions as $t) {
|
||||
if ($t->amount > 0) {
|
||||
$amount = $t->amount;
|
||||
}
|
||||
}
|
||||
// saves on queries:
|
||||
$amount = $journal->transactions()->where('amount', '>', 0)->get()->sum('amount');
|
||||
|
||||
$amount = strval($amount);
|
||||
$cache->store($amount);
|
||||
|
||||
return $amount;
|
||||
|
Reference in New Issue
Block a user