mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 20:11:22 +00:00
Various code cleanup.
This commit is contained in:
@@ -282,7 +282,7 @@ class AccountController extends Controller
|
||||
$currencyId = intval($account->getMeta('currency_id'));
|
||||
$currency = $currencyRepos->find($currencyId);
|
||||
if ($currencyId === 0) {
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ class BudgetController extends Controller
|
||||
$cache->addProperty('chart.budget.budget');
|
||||
|
||||
if ($cache->has()) {
|
||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
||||
return Response::json($cache->get()); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
$final = clone $last;
|
||||
|
||||
@@ -217,13 +217,13 @@ class CurrencyController extends Controller
|
||||
{
|
||||
$currencies = $this->repository->get();
|
||||
$defaultCurrency = $this->repository->getCurrencyByPreference(Preferences::get('currencyPreference', config('firefly.default_currency', 'EUR')));
|
||||
$isOwner = true;
|
||||
$isOwner = true;
|
||||
if (!$this->userRepository->hasRole(auth()->user(), 'owner')) {
|
||||
$request->session()->flash('info', trans('firefly.ask_site_owner', ['owner' => env('SITE_OWNER')]));
|
||||
$isOwner = false;
|
||||
}
|
||||
|
||||
return view('currencies.index', compact('currencies', 'defaultCurrency','isOwner'));
|
||||
return view('currencies.index', compact('currencies', 'defaultCurrency', 'isOwner'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -116,7 +116,7 @@ class HomeController extends Controller
|
||||
}
|
||||
}
|
||||
// last few lines
|
||||
$logContent = 'Truncated from this point <----|'.substr($logContent, -4096);
|
||||
$logContent = 'Truncated from this point <----|' . substr($logContent, -4096);
|
||||
|
||||
return view('debug', compact('phpVersion', 'extensions', 'carbon', 'now', 'drivers', 'currentDriver', 'userAgent', 'phpOs', 'interface', 'logContent'));
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
|
||||
@@ -93,7 +93,7 @@ class NewUserController extends Controller
|
||||
// also store currency preference from input:
|
||||
$currency = $currencyRepository->find(intval($request->input('amount_currency_id_bank_balance')));
|
||||
|
||||
if(!is_null($currency->id)) {
|
||||
if (!is_null($currency->id)) {
|
||||
// store currency preference:
|
||||
Preferences::set('currencyPreference', $currency->code);
|
||||
Preferences::mark();
|
||||
|
||||
@@ -232,13 +232,13 @@ class SplitController extends Controller
|
||||
{
|
||||
$sourceAccounts = $journal->sourceAccountList();
|
||||
$destinationAccounts = $journal->destinationAccountList();
|
||||
$notes = '';
|
||||
$notes = '';
|
||||
/** @var Note $note */
|
||||
$note = $journal->notes()->first();
|
||||
if (!is_null($note)) {
|
||||
$notes = $note->text;
|
||||
}
|
||||
$array = [
|
||||
$array = [
|
||||
'journal_description' => $request->old('journal_description', $journal->description),
|
||||
'journal_amount' => $journal->amountPositive(),
|
||||
'sourceAccounts' => $sourceAccounts,
|
||||
|
||||
Reference in New Issue
Block a user