More moving stuff around.

This commit is contained in:
James Cole
2016-05-20 11:02:07 +02:00
parent 724f423692
commit 3c3a83330d
30 changed files with 197 additions and 195 deletions

View File

@@ -7,11 +7,12 @@ use Amount;
use Auth;
use Carbon\Carbon;
use Config;
use FireflyIII\Crud\Account\AccountCrudInterface;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Requests\BudgetFormRequest;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Budget;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
@@ -149,12 +150,11 @@ class BudgetController extends Controller
/**
* @param BudgetRepositoryInterface $repository
* @param AccountCrudInterface $crud
*
* @param ARI $accountRepository
*
* @return \Illuminate\View\View
* @return View
*/
public function index(BudgetRepositoryInterface $repository, ARI $accountRepository)
public function index(BudgetRepositoryInterface $repository, AccountCrudInterface $crud)
{
$budgets = $repository->getActiveBudgets();
$inactive = $repository->getInactiveBudgets();
@@ -176,10 +176,10 @@ class BudgetController extends Controller
$period = Navigation::periodShow($start, $range);
$periodStart = $start->formatLocalized($this->monthAndDayFormat);
$periodEnd = $end->formatLocalized($this->monthAndDayFormat);
$accounts = $accountRepository->getAccountsByType(['Default account', 'Asset account', 'Cash account']);
$accounts = $crud->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET, AccountType::CASH]);
$startAsString = $start->format('Y-m-d');
$endAsString = $end->format('Y-m-d');
// loop the budgets:
/** @var Budget $budget */
foreach ($budgets as $budget) {