mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
use journal repository instead of direct calls.
This commit is contained in:
@@ -103,24 +103,6 @@ class Tag extends Model
|
||||
throw new NotFoundHttpException;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public static function tagSum(Tag $tag): string
|
||||
{
|
||||
$sum = '0';
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($tag->transactionjournals as $journal) {
|
||||
bcadd($sum, $journal->amount());
|
||||
}
|
||||
|
||||
return $sum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
|
Reference in New Issue
Block a user