mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Better call to date.
This commit is contained in:
@@ -307,7 +307,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
$autoBudget->save();
|
||||
|
||||
// create initial budget limit.
|
||||
$today = new Carbon;
|
||||
$today = today(config('app.timezone'));
|
||||
$start = app('navigation')->startOfPeriod($today, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
|
@@ -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