mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-07 14:41:20 +00:00
New cron job for bills.
This commit is contained in:
@@ -130,7 +130,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
// find budget limit:
|
||||
$budgetLimit = $this->findBudgetLimit($autoBudget->budget, $start, $end);
|
||||
|
||||
if (null === $budgetLimit && AutoBudget::AUTO_BUDGET_RESET === (int)$autoBudget->auto_budget_type) {
|
||||
if (null === $budgetLimit && AutoBudget::AUTO_BUDGET_RESET === (int) $autoBudget->auto_budget_type) {
|
||||
// that's easy: create one.
|
||||
// do nothing else.
|
||||
$this->createBudgetLimit($autoBudget, $start, $end);
|
||||
@@ -139,7 +139,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
return;
|
||||
}
|
||||
|
||||
if (null === $budgetLimit && AutoBudget::AUTO_BUDGET_ROLLOVER === (int)$autoBudget->auto_budget_type) {
|
||||
if (null === $budgetLimit && AutoBudget::AUTO_BUDGET_ROLLOVER === (int) $autoBudget->auto_budget_type) {
|
||||
// budget limit exists already,
|
||||
$this->createRollover($autoBudget);
|
||||
Log::debug(sprintf('Done with auto budget #%d', $autoBudget->id));
|
||||
@@ -277,7 +277,7 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
$repository = app(OperationsRepositoryInterface::class);
|
||||
$repository->setUser($autoBudget->budget->user);
|
||||
$spent = $repository->sumExpenses($previousStart, $previousEnd, null, new Collection([$autoBudget->budget]), $autoBudget->transactionCurrency);
|
||||
$currencyId = (int)$autoBudget->transaction_currency_id;
|
||||
$currencyId = (int) $autoBudget->transaction_currency_id;
|
||||
$spentAmount = $spent[$currencyId]['sum'] ?? '0';
|
||||
Log::debug(sprintf('Spent in previous budget period (%s-%s) is %s', $previousStart->format('Y-m-d'), $previousEnd->format('Y-m-d'), $spentAmount));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user