mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Fixed a sum.
This commit is contained in:
@@ -187,8 +187,8 @@ class PiggyBankController extends Controller
|
|||||||
'name' => $account->name,
|
'name' => $account->name,
|
||||||
'balance' => Steam::balance($account, $end, true),
|
'balance' => Steam::balance($account, $end, true),
|
||||||
'leftForPiggyBanks' => $repository->leftOnAccount($account, $end),
|
'leftForPiggyBanks' => $repository->leftOnAccount($account, $end),
|
||||||
'sumOfSaved' => $piggyBank->savedSoFar,
|
'sumOfSaved' => strval($piggyBank->savedSoFar),
|
||||||
'sumOfTargets' => round($piggyBank->targetamount, 2),
|
'sumOfTargets' => strval(round($piggyBank->targetamount, 2)),
|
||||||
'leftToSave' => $piggyBank->leftToSave,
|
'leftToSave' => $piggyBank->leftToSave,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ class AccountRepository implements AccountRepositoryInterface
|
|||||||
$balance = Steam::balance($account, $date, true);
|
$balance = Steam::balance($account, $date, true);
|
||||||
/** @var PiggyBank $p */
|
/** @var PiggyBank $p */
|
||||||
foreach ($account->piggyBanks()->get() as $p) {
|
foreach ($account->piggyBanks()->get() as $p) {
|
||||||
$balance = bcsub($p->currentRelevantRep()->currentamount, $balance);
|
$balance = bcsub($balance, $p->currentRelevantRep()->currentamount);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $balance;
|
return $balance;
|
||||||
|
|||||||
Reference in New Issue
Block a user