Code cleanup

This commit is contained in:
James Cole
2024-12-22 08:43:12 +01:00
parent 5751f7e5a3
commit 565bd87959
574 changed files with 4600 additions and 4604 deletions

View File

@@ -59,7 +59,7 @@ class ReconcileController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('mainTitleIcon', 'fa-credit-card');
app('view')->share('title', (string)trans('firefly.accounts'));
app('view')->share('title', (string) trans('firefly.accounts'));
$this->repository = app(JournalRepositoryInterface::class);
$this->accountRepos = app(AccountRepositoryInterface::class);
@@ -81,7 +81,7 @@ class ReconcileController extends Controller
return $this->redirectAccountToAccount($account);
}
if (AccountType::ASSET !== $account->accountType->type) {
session()->flash('error', (string)trans('firefly.must_be_asset_account'));
session()->flash('error', (string) trans('firefly.must_be_asset_account'));
return redirect(route('accounts.index', [config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type))]));
}
@@ -113,7 +113,7 @@ class ReconcileController extends Controller
$startBalance = app('steam')->bcround(app('steam')->balance($account, $startDate), $currency->decimal_places);
$endBalance = app('steam')->bcround(app('steam')->balance($account, $end), $currency->decimal_places);
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
$subTitle = (string)trans('firefly.reconcile_account', ['account' => $account->name]);
$subTitle = (string) trans('firefly.reconcile_account', ['account' => $account->name]);
// various links
$transactionsUrl = route('accounts.reconcile.transactions', [$account->id, '%start%', '%end%']);
@@ -158,7 +158,7 @@ class ReconcileController extends Controller
/** @var string $journalId */
foreach ($data['journals'] as $journalId) {
$this->repository->reconcileById((int)$journalId);
$this->repository->reconcileById((int) $journalId);
}
app('log')->debug('Reconciled all transactions.');
@@ -175,10 +175,10 @@ class ReconcileController extends Controller
app('log')->debug('End of routine.');
app('preferences')->mark();
if ('' === $result) {
session()->flash('success', (string)trans('firefly.reconciliation_stored'));
session()->flash('success', (string) trans('firefly.reconciliation_stored'));
}
if ('' !== $result) {
session()->flash('error', (string)trans('firefly.reconciliation_error', ['error' => $result]));
session()->flash('error', (string) trans('firefly.reconciliation_error', ['error' => $result]));
}
return redirect(route('accounts.show', [$account->id]));