mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Some code cleanup [skip ci]
This commit is contained in:
parent
48b169c026
commit
89ac27ad10
@ -115,7 +115,7 @@ class CategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(CRI $repository, SCRI $singleRepository)
|
public function index(CRI $repository, SCRI $singleRepository)
|
||||||
{
|
{
|
||||||
$categories = $repository->listCategories();
|
$categories = $repository->getCategories();
|
||||||
|
|
||||||
$categories->each(
|
$categories->each(
|
||||||
function (Category $category) use ($singleRepository) {
|
function (Category $category) use ($singleRepository) {
|
||||||
|
@ -165,7 +165,7 @@ class JsonController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function categories(CRI $repository)
|
public function categories(CRI $repository)
|
||||||
{
|
{
|
||||||
$list = $repository->listCategories();
|
$list = $repository->getCategories();
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($list as $entry) {
|
foreach ($list as $entry) {
|
||||||
$return[] = $entry->name;
|
$return[] = $entry->name;
|
||||||
|
@ -9,6 +9,8 @@ use FireflyIII\Helpers\Report\ReportHelperInterface;
|
|||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI;
|
||||||
|
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
|
||||||
|
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Log;
|
use Log;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
@ -132,10 +134,6 @@ class ReportController extends Controller
|
|||||||
case 'audit':
|
case 'audit':
|
||||||
// always default
|
// always default
|
||||||
return $this->auditReport($start, $end, $accounts);
|
return $this->auditReport($start, $end, $accounts);
|
||||||
case 'meta-history':
|
|
||||||
// always default
|
|
||||||
return $this->metaHistoryReport($start, $end, $accounts);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -274,7 +272,7 @@ class ReportController extends Controller
|
|||||||
$expenseTopLength = 8;
|
$expenseTopLength = 8;
|
||||||
// list of users stuff:
|
// list of users stuff:
|
||||||
$budgets = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface')->getActiveBudgets();
|
$budgets = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface')->getActiveBudgets();
|
||||||
$categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->listCategories();
|
$categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->getCategories();
|
||||||
$accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts);
|
$accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts);
|
||||||
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
|
$incomes = $this->helper->getIncomeReport($start, $end, $accounts);
|
||||||
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
|
$expenses = $this->helper->getExpenseReport($start, $end, $accounts);
|
||||||
@ -335,6 +333,4 @@ class ReportController extends Controller
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ class CategoryRepository implements CategoryRepositoryInterface
|
|||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function listCategories(): Collection
|
public function getCategories(): Collection
|
||||||
{
|
{
|
||||||
/** @var Collection $set */
|
/** @var Collection $set */
|
||||||
$set = $this->user->categories()->orderBy('name', 'ASC')->get();
|
$set = $this->user->categories()->orderBy('name', 'ASC')->get();
|
||||||
|
@ -33,7 +33,7 @@ interface CategoryRepositoryInterface
|
|||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*/
|
*/
|
||||||
public function listCategories(): Collection;
|
public function getCategories(): Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns a very special collection for each category:
|
* This method returns a very special collection for each category:
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
<select name="report_type" class="form-control" id="inputReportType">
|
<select name="report_type" class="form-control" id="inputReportType">
|
||||||
<option selected label="{{ 'report_type_default'|_ }}" value="default">{{ 'report_type_default'|_ }}</option>
|
<option selected label="{{ 'report_type_default'|_ }}" value="default">{{ 'report_type_default'|_ }}</option>
|
||||||
<option label="{{ 'report_type_audit'|_ }}" value="audit">{{ 'report_type_audit'|_ }}</option>
|
<option label="{{ 'report_type_audit'|_ }}" value="audit">{{ 'report_type_audit'|_ }}</option>
|
||||||
<option label="{{ 'report_type_meta-history'|_ }}" value="meta-history">{{ 'report_type_meta-history'|_ }}</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user