mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 02:03:40 +00:00
Code cleanup.
This commit is contained in:
@@ -54,8 +54,6 @@ class ShowController extends Controller
|
||||
|
||||
/**
|
||||
* BillController constructor.
|
||||
*
|
||||
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -77,10 +75,7 @@ class ShowController extends Controller
|
||||
/**
|
||||
* Rescan bills for transactions.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @return Redirector|RedirectResponse
|
||||
*/
|
||||
public function rescan(Request $request, Bill $bill)
|
||||
{
|
||||
@@ -117,10 +112,8 @@ class ShowController extends Controller
|
||||
/**
|
||||
* Show a bill.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return Factory|View
|
||||
*
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
@@ -129,8 +122,10 @@ class ShowController extends Controller
|
||||
// add info about rules:
|
||||
$rules = $this->repository->getRulesForBill($bill);
|
||||
$subTitle = $bill->name;
|
||||
|
||||
/** @var Carbon $start */
|
||||
$start = session('start');
|
||||
|
||||
/** @var Carbon $end */
|
||||
$end = session('end');
|
||||
$year = $start->year;
|
||||
@@ -159,11 +154,11 @@ class ShowController extends Controller
|
||||
$object = $manager->createData($resource)->toArray();
|
||||
$object['data']['currency'] = $bill->transactionCurrency;
|
||||
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setBill($bill)->setLimit($pageSize)->setPage($page)->withBudgetInformation()
|
||||
->withCategoryInformation()->withAccountInformation();
|
||||
->withCategoryInformation()->withAccountInformation()
|
||||
;
|
||||
$groups = $collector->getPaginatedGroups();
|
||||
$groups->setPath(route('bills.show', [$bill->id]));
|
||||
|
||||
@@ -171,7 +166,6 @@ class ShowController extends Controller
|
||||
$collection = $this->repository->getAttachments($bill);
|
||||
$attachments = new Collection();
|
||||
|
||||
|
||||
if ($collection->count() > 0) {
|
||||
/** @var AttachmentTransformer $transformer */
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
@@ -182,7 +176,6 @@ class ShowController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return view('bills.show', compact('attachments', 'groups', 'rules', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user