mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Implemented #264
This commit is contained in:
parent
c14ec8b006
commit
c619b8730b
@ -164,6 +164,8 @@ class BudgetController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(BudgetRepositoryInterface $repository, AccountCrudInterface $crud)
|
public function index(BudgetRepositoryInterface $repository, AccountCrudInterface $crud)
|
||||||
{
|
{
|
||||||
|
$repository->cleanupBudgets();
|
||||||
|
|
||||||
$budgets = $repository->getActiveBudgets();
|
$budgets = $repository->getActiveBudgets();
|
||||||
$inactive = $repository->getInactiveBudgets();
|
$inactive = $repository->getInactiveBudgets();
|
||||||
$spent = '0';
|
$spent = '0';
|
||||||
|
@ -156,6 +156,18 @@ class BudgetRepository implements BudgetRepositoryInterface
|
|||||||
return $set;
|
return $set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function cleanupBudgets(): bool
|
||||||
|
{
|
||||||
|
// delete limits with amount 0:
|
||||||
|
BudgetLimit::where('amount', 0)->delete();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
|
@ -111,6 +111,11 @@ interface BudgetRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) : string;
|
public function spentInPeriod(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) : string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function cleanupBudgets(): bool;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $data
|
* @param array $data
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user