Fix old reference.

This commit is contained in:
James Cole
2024-12-15 16:11:48 +01:00
parent 6bb297e76f
commit 48a999cf91

View File

@@ -270,14 +270,11 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
*/ */
public function getPiggyBanksWithAmount(): Collection public function getPiggyBanksWithAmount(): Collection
{ {
$currency = app('amount')->getDefaultCurrency();
$set = $this->getPiggyBanks(); $set = $this->getPiggyBanks();
/** @var PiggyBank $piggy */ /** @var PiggyBank $piggy */
foreach ($set as $piggy) { foreach ($set as $piggy) {
$currentAmount = $this->getRepetition($piggy)->current_amount ?? '0'; $currentAmount = $this->getCurrentAmount($piggy);
$piggy->name = $piggy->name.' ('.app('amount')->formatAnything($currency, $currentAmount, false).')'; $piggy->name = $piggy->name.' ('.app('amount')->formatAnything($piggy->transactionCurrency, $currentAmount, false).')';
} }
return $set; return $set;