mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-03 20:56:21 +00:00
Better call to date.
This commit is contained in:
@@ -101,7 +101,7 @@ trait ModifiesPiggyBanks
|
||||
*/
|
||||
public function canAddAmount(PiggyBank $piggyBank, string $amount): bool
|
||||
{
|
||||
$leftOnAccount = $this->leftOnAccount($piggyBank, new Carbon);
|
||||
$leftOnAccount = $this->leftOnAccount($piggyBank, today(config('app.timezone')));
|
||||
$savedSoFar = (string) $this->getRepetition($piggyBank)->currentamount;
|
||||
$leftToSave = bcsub($piggyBank->targetamount, $savedSoFar);
|
||||
$maxAmount = (string) min(round($leftOnAccount, 12), round($leftToSave, 12));
|
||||
|
||||
Reference in New Issue
Block a user