mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-15 09:53:36 -06:00
Unrelated code cleanup.
This commit is contained in:
parent
8176356509
commit
1d58d519a0
@ -41,7 +41,6 @@ use Navigation;
|
||||
use Preferences;
|
||||
use Response;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class ReconcileController.
|
||||
@ -147,9 +146,14 @@ class ReconcileController extends Controller
|
||||
}
|
||||
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
|
||||
$diffCompare = bccomp($difference, '0');
|
||||
$return = [
|
||||
$return = [
|
||||
'post_uri' => $route,
|
||||
'html' => view('accounts.reconcile.overview', compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedIds', 'transactionIds', 'clearedAmount', 'startBalance', 'endBalance', 'amount', 'route', 'countCleared'))->render(),
|
||||
'html' => view(
|
||||
'accounts.reconcile.overview', compact(
|
||||
'account', 'start', 'diffCompare', 'difference', 'end', 'clearedIds', 'transactionIds', 'clearedAmount', 'startBalance', 'endBalance', 'amount',
|
||||
'route', 'countCleared'
|
||||
)
|
||||
)->render(),
|
||||
];
|
||||
|
||||
return Response::json($return);
|
||||
@ -204,7 +208,11 @@ class ReconcileController extends Controller
|
||||
$overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
|
||||
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
|
||||
|
||||
return view('accounts.reconcile.index', compact('account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', 'overviewUri', 'indexUri'));
|
||||
return view(
|
||||
'accounts.reconcile.index', compact(
|
||||
'account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', 'overviewUri', 'indexUri'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class LinkController extends Controller
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
$this->middleware(IsLimitedUser::class)->except(['index','show']);
|
||||
$this->middleware(IsLimitedUser::class)->except(['index', 'show']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,7 +52,7 @@ class UserController extends Controller
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
$this->middleware(IsLimitedUser::class)->except(['index','show']);
|
||||
$this->middleware(IsLimitedUser::class)->except(['index', 'show']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,7 +118,7 @@ class LoginController extends Controller
|
||||
/**
|
||||
* Show the application's login form.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
|
@ -229,7 +229,7 @@ class BillController extends Controller
|
||||
public function show(Request $request, BillRepositoryInterface $repository, Bill $bill)
|
||||
{
|
||||
/** @var Carbon $date */
|
||||
$date = session('start');
|
||||
$date = session('start');
|
||||
/** @var Carbon $end */
|
||||
$end = session('end');
|
||||
$year = $date->year;
|
||||
|
@ -85,7 +85,7 @@ class BudgetController extends Controller
|
||||
$start = Carbon::createFromFormat('Y-m-d', $request->get('start'));
|
||||
$end = Carbon::createFromFormat('Y-m-d', $request->get('end'));
|
||||
$budgetLimit = $this->repository->updateLimitAmount($budget, $start, $end, $amount);
|
||||
if (bccomp($amount,'0') === 0) {
|
||||
if (bccomp($amount, '0') === 0) {
|
||||
$budgetLimit = null;
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ class CategoryController extends Controller
|
||||
$start = null;
|
||||
$end = null;
|
||||
$periods = new Collection;
|
||||
$path = route('categories.show', [$category->id]);
|
||||
$path = route('categories.show', [$category->id]);
|
||||
|
||||
// prep for "all" view.
|
||||
if ('all' === $moment) {
|
||||
@ -236,7 +236,7 @@ class CategoryController extends Controller
|
||||
/** @var Carbon $start */
|
||||
$start = null === $first ? new Carbon : $first;
|
||||
$end = new Carbon;
|
||||
$path = route('categories.show', [$category->id,'all']);
|
||||
$path = route('categories.show', [$category->id, 'all']);
|
||||
}
|
||||
|
||||
// prep for "specific date" view.
|
||||
@ -249,7 +249,7 @@ class CategoryController extends Controller
|
||||
'start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat),]
|
||||
);
|
||||
$periods = $this->getPeriodOverview($category);
|
||||
$path = route('categories.show', [$category->id, $moment]);
|
||||
$path = route('categories.show', [$category->id, $moment]);
|
||||
}
|
||||
|
||||
// prep for current period
|
||||
|
@ -26,9 +26,6 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Support\Import\Prerequisites\PrerequisitesInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Log;
|
||||
use Session;
|
||||
|
||||
class BankController extends Controller
|
||||
{
|
||||
@ -61,5 +58,4 @@ class BankController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class ConfigurationController extends Controller
|
||||
if ($configurator->isJobConfigured()) {
|
||||
return redirect(route('import.status', [$job->key]));
|
||||
}
|
||||
$data = $request->all();
|
||||
$data = $request->all();
|
||||
$configurator->configureJob($data);
|
||||
|
||||
// get possible warning from configurator:
|
||||
|
@ -29,7 +29,6 @@ use FireflyIII\Import\Configurator\ConfiguratorInterface;
|
||||
use FireflyIII\Import\Routine\ImportRoutine;
|
||||
use FireflyIII\Models\ImportJob;
|
||||
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
|
||||
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response as LaravelResponse;
|
||||
use Log;
|
||||
@ -176,7 +175,6 @@ class FileController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Step 4. Save the configuration.
|
||||
*
|
||||
|
@ -31,6 +31,7 @@ class StatusController extends Controller
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ImportJob $job
|
||||
*
|
||||
@ -89,6 +90,7 @@ class StatusController extends Controller
|
||||
$result['started'] = true;
|
||||
$result['running'] = true;
|
||||
}
|
||||
|
||||
// TODO cannot handle 'errored'
|
||||
|
||||
return Response::json($result);
|
||||
|
@ -62,7 +62,7 @@ class ProfileController extends Controller
|
||||
return $next($request);
|
||||
}
|
||||
);
|
||||
$this->middleware(IsLimitedUser::class)->except(['confirmEmailChange','index', 'undoEmailChange']);
|
||||
$this->middleware(IsLimitedUser::class)->except(['confirmEmailChange', 'index', 'undoEmailChange']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -246,7 +246,6 @@ class ExpenseController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function topIncome(Collection $accounts, Collection $expense, Carbon $start, Carbon $end)
|
||||
{
|
||||
// Properties for cache:
|
||||
|
@ -88,8 +88,9 @@ class ReportController extends Controller
|
||||
|
||||
View::share(
|
||||
'subTitle', trans(
|
||||
'firefly.report_default', ['start' => $start->formatLocalized($this->monthFormat), 'end' => $end->formatLocalized($this->monthFormat),]
|
||||
)
|
||||
'firefly.report_default',
|
||||
['start' => $start->formatLocalized($this->monthFormat), 'end' => $end->formatLocalized($this->monthFormat),]
|
||||
)
|
||||
);
|
||||
|
||||
$generator = ReportGeneratorFactory::reportGenerator('Account', $start, $end);
|
||||
|
@ -32,7 +32,6 @@ use Log;
|
||||
use Preferences;
|
||||
use Session;
|
||||
use URL;
|
||||
use View;
|
||||
|
||||
/**
|
||||
* Class LinkController.
|
||||
|
@ -22,7 +22,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Session\Middleware\StartSession;
|
||||
|
||||
|
@ -22,8 +22,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Requests;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class PiggyBankFormRequest.
|
||||
*/
|
||||
|
@ -45,28 +45,6 @@ class ReportFormRequest extends Request
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExpenseList(): Collection
|
||||
{
|
||||
// fixed
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$set = $this->get('exp_rev');
|
||||
$collection = new Collection;
|
||||
if (is_array($set)) {
|
||||
foreach ($set as $accountId) {
|
||||
$account = $repository->find(intval($accountId));
|
||||
if (null !== $account->id) {
|
||||
$collection->push($account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
@ -152,6 +130,28 @@ class ReportFormRequest extends Request
|
||||
return $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExpenseList(): Collection
|
||||
{
|
||||
// fixed
|
||||
/** @var AccountRepositoryInterface $repository */
|
||||
$repository = app(AccountRepositoryInterface::class);
|
||||
$set = $this->get('exp_rev');
|
||||
$collection = new Collection;
|
||||
if (is_array($set)) {
|
||||
foreach ($set as $accountId) {
|
||||
$account = $repository->find(intval($accountId));
|
||||
if (null !== $account->id) {
|
||||
$collection->push($account);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Carbon
|
||||
*
|
||||
|
@ -882,7 +882,9 @@ Breadcrumbs::register(
|
||||
'accounts.reconcile.edit',
|
||||
function (BreadCrumbGenerator $breadcrumbs, TransactionJournal $journal) {
|
||||
$breadcrumbs->parent('transactions.show', $journal);
|
||||
$breadcrumbs->push(trans('breadcrumbs.edit_reconciliation', ['description' => $journal->description]), route('accounts.reconcile.edit', [$journal->id]));
|
||||
$breadcrumbs->push(
|
||||
trans('breadcrumbs.edit_reconciliation', ['description' => $journal->description]), route('accounts.reconcile.edit', [$journal->id])
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user