mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Add some forgotten code to the mobile piggy bank controller things.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
@@ -438,7 +438,9 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
$balance = Steam::balanceIgnoreVirtual($account, $date);
|
||||
/** @var PiggyBank $p */
|
||||
foreach ($account->piggybanks()->get() as $p) {
|
||||
$balance = bcsub($balance, $p->currentRelevantRep()->currentamount);
|
||||
$currentAmount = $p->currentRelevantRep()->currentamount ?? '0';
|
||||
|
||||
$balance = bcsub($balance, $currentAmount);
|
||||
}
|
||||
|
||||
return $balance;
|
||||
|
@@ -118,7 +118,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
{
|
||||
$set = $this->getPiggyBanks();
|
||||
foreach ($set as $piggy) {
|
||||
$piggy->name = $piggy->name . ' (' . Amount::format($piggy->currentRelevantRep()->currentamount, false) . ')';
|
||||
$currentAmount = $piggy->currentRelevantRep()->currentamount ?? '0';
|
||||
$piggy->name = $piggy->name . ' (' . Amount::format($currentAmount, false) . ')';
|
||||
}
|
||||
|
||||
return $set;
|
||||
|
Reference in New Issue
Block a user