Skip to content

Firefly III: a personal finances manager

Remove word "neg", fix install routine.

James Cole4c1c55c17493
diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php
index 13085f71f6..514ef5a163 100644
--- a/app/Http/Controllers/System/InstallController.php
+++ b/app/Http/Controllers/System/InstallController.php
@@ -34,6 +34,7 @@ use FireflyIII\Support\System\IsOldVersion;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\JsonResponse;
+use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Cache;
@@ -74,23 +75,15 @@ final class InstallController extends Controller
*
* @return Factory|View
*/
- public function index(): Factory|\Illuminate\Contracts\View\View
+ public function index(): Factory|\Illuminate\Contracts\View\View|RedirectResponse
{
+ Log::debug('Now in installer index.');
if ($this->hasNoTables() || $this->isOldVersionInstalled()) {
app('view')->share('FF_VERSION', config('firefly.version'));
- // index will set FF3 version.
- try {
- AppConfiguration::set('ff3_version', (string) config('firefly.version'));
- AppConfiguration::set('ff3_build_time', (int) config('firefly.build_time'));
- } catch (FireflyException $e) {
- Log::warning($e->getMessage());
- }
-
return view('install.index');
}
-
- throw new AuthorizationException('No access to this page.');
+ return response()->redirectToRoute('home');
}
/**
@@ -144,6 +137,16 @@ final class InstallController extends Controller
}
$response['hasNextCommand'] = array_key_exists($requestIndex + 1, $indexes);
$response['previous'] = $command;
+
+ if(false === $response['hasNextCommand']) {
+ // if no next command, set the things
+ try {
+ AppConfiguration::set('ff3_version', (string) config('firefly.version'));
+ AppConfiguration::set('ff3_build_time', (int) config('firefly.build_time'));
+ } catch (FireflyException $e) {
+ Log::warning($e->getMessage());
+ }
+ }
}
return response()->json($response);
diff --git a/app/Http/Middleware/Installer.php b/app/Http/Middleware/Installer.php
index 39507685a5..76c29da85b 100644
--- a/app/Http/Middleware/Installer.php
+++ b/app/Http/Middleware/Installer.php
@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Support\System\IsOldVersion;
use FireflyIII\Support\System\OAuthKeys;
use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Log;
/**
* Class Installer
@@ -66,6 +67,7 @@ class Installer
// or when old scheme version
// or when old firefly version
if ($this->hasNoTables() || $this->isOldVersionInstalled()) {
+ Log::debug('Will redirect to installer.');
return response()->redirectTo(route('installer.index'));
}
OAuthKeys::verifyKeysRoutine();
diff --git a/app/Support/System/IsOldVersion.php b/app/Support/System/IsOldVersion.php
index dd60451d3e..ad45b53063 100644
--- a/app/Support/System/IsOldVersion.php
+++ b/app/Support/System/IsOldVersion.php
@@ -77,7 +77,7 @@ trait IsOldVersion
$dbTime = Carbon::createFromTimestamp($dbBuildTime, config('app.timezone'));
if ($dbBuildTime < $configBuildTime) {
Log::warning(sprintf(
- 'Your database was last managed by an older version of Firefly III (I see %s, I expect %s). Redirect to migrate routine.',
+ 'Your database was last managed by an older version of Firefly III (I see %s, I expect %s).',
$dbTime->format('Y-m-d H:i:s'),
$configTime->format('Y-m-d H:i:s')
));
diff --git a/resources/views/components/elements/transaction-amount.blade.php b/resources/views/components/elements/transaction-amount.blade.php
index 14e5ccd0b4..35aa503504 100644
--- a/resources/views/components/elements/transaction-amount.blade.php
+++ b/resources/views/components/elements/transaction-amount.blade.php
@@ -15,9 +15,9 @@
@elseif('Transfer' === $type)
{{-- amount of transfer --}}
<span class="text-info money-transfer">
- {{-- present as negative. --}}
+ {{-- present as negative. --}}
@if($sourceAccount['id'] === $account?->id)
- neg {!! format_amount_by_symbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places'], false) !!}
+ {!! format_amount_by_symbol($amount['amount'], $amount['currency_symbol'], $amount['currency_decimal_places'], false) !!}
@endif
{{-- present as positive --}}
@if($sourceAccount['id'] !== $account?->id)
@@ -25,7 +25,7 @@
@endif
{{-- foreign amount of transfer (negative) --}}
@if(null !== $foreign['amount'] && $sourceAccount['id'] === $account?->id)
- neg ({!! format_amount_by_symbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places'], false) !!})
+ ({!! format_amount_by_symbol($foreign['amount'], $foreign['currency_symbol'], $foreign['currency_decimal_places'], false) !!})
@endif
{{-- foreign amount of transfer (positive) --}}
@if(null !== $foreign['amount'] && $sourceAccount['id'] !== $account?->id)