Skip to content

Firefly III: a personal finances manager

Fix view of running balance column

James Cole4d2dd1d8f72e
diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php
index 67118821c6..df6b973e92 100644
--- a/app/Http/Controllers/HomeController.php
+++ b/app/Http/Controllers/HomeController.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
+use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php
index 1f53977b15..cbd22d9119 100644
--- a/app/Support/Twig/General.php
+++ b/app/Support/Twig/General.php
@@ -28,6 +28,7 @@ use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
+use FireflyIII\Support\Facades\FireflyConfig;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Search\OperatorQuerySearch;
use Illuminate\Support\Collection;
@@ -72,6 +73,7 @@ class General extends AbstractExtension
$this->hasRole(),
$this->getRootSearchOperator(),
$this->carbonize(),
+ $this->fireflyIIIConfig(),
];
}
@@ -393,4 +395,13 @@ class General extends AbstractExtension
static fn (string $str): string => date($str)
);
}
+
+ private function fireflyIIIConfig() {
+ return new TwigFunction(
+ 'fireflyiiiconfig',
+ static function (string $string, mixed $default): mixed {
+ return FireflyConfig::get($string, $default)->data;
+ }
+ );
+ }
}
diff --git a/config/firefly.php b/config/firefly.php
index 55e3e15307..0767441194 100644
--- a/config/firefly.php
+++ b/config/firefly.php
@@ -75,7 +75,7 @@ return [
'webhooks' => true,
'handle_debts' => true,
'expression_engine' => true,
- 'running_balance_column' => env('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
+ 'running_balance_column' =>(bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2025-12-22',
diff --git a/resources/views/list/groups.twig b/resources/views/list/groups.twig
index 92cfb0b960..9c28b65a85 100644
--- a/resources/views/list/groups.twig
+++ b/resources/views/list/groups.twig
@@ -33,7 +33,7 @@
<th class="hidden-xs">&nbsp;</th>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.amount') }}</th>
- {% if FireflyConfig.get('use_running_balance', config('firefly.feature_flags.running_balance_column')) %}
+ {% if fireflyiiiconfig('use_running_balance', true) %}
<th>{{ trans('list.running_balance') }}</th>
{% endif %}
<th>{{ trans('list.date') }}</th>
@@ -266,7 +266,7 @@
{% endif %}
{% endif %}
</td>
- {% if FireflyConfig.get('use_running_balance', config('firefly.feature_flags.running_balance_column')) %}
+ {% if (fireflyiiiconfig('use_running_balance', true)) %}
<td>
{% if (null == transaction.balance_dirty or false == transaction.balance_dirty) and null != transaction.destination_balance_after and null != transaction.source_balance_after %}
{% if transaction.transaction_type_type == 'Deposit' %}
diff --git a/resources/views/partials/debug-table.twig b/resources/views/partials/debug-table.twig
index 79eeed4364..9b8f605f67 100644
--- a/resources/views/partials/debug-table.twig
+++ b/resources/views/partials/debug-table.twig
@@ -119,11 +119,11 @@
</tr>
<tr>
<td>Exchange rates</td>
- <td>{% if FireflyConfig.get('enable_exchange_rates', config('cer.enabled')) %}Enabled{% else %}Disabled{% endif %}, downloads {% if FireflyConfig.get('enable_external_rates', config('cer.download_enabled')) %}enabled{% else %}disabled{% endif %}</td>
+ <td>{% if fireflyiiiconfig('enable_exchange_rates', true) %}Enabled{% else %}Disabled{% endif %}, downloads {% if FireflyConfig.get('enable_external_rates', config('cer.download_enabled')) %}enabled{% else %}disabled{% endif %}</td>
</tr>
<tr>
<td>RB-column</td>
- <td>{% if FireflyConfig.get('use_running_balance', config('firefly.feature_flags.running_balance_column')) %}Enabled{% else %}Disabled{% endif %}</td>
+ <td>{% if fireflyiiiconfig('use_running_balance', true) %}Enabled{% else %}Disabled{% endif %}</td>
</tr>
</tbody>
</table>
diff --git a/resources/views/partials/menu-sidebar.twig b/resources/views/partials/menu-sidebar.twig
index 8320682e98..97a344edcd 100644
--- a/resources/views/partials/menu-sidebar.twig
+++ b/resources/views/partials/menu-sidebar.twig
@@ -226,7 +226,7 @@
<span>{{ 'currencies'|_ }}</span>
</a>
</li>
- {% if FireflyConfig.get('enable_exchange_rates', config('cer.enabled')) %}
+ {% if (fireflyiiiconfig('enable_exchange_rates', true)) %}
<li class="{{ activeRoutePartial('exchange-rates') }}">
<a class="{{ activeRoutePartial('exchange-rates') }}" href="{{ route('exchange-rates.index') }}">
<span class="fa fa-angle-right fa-fw"></span>
diff --git a/resources/views/preferences/index.twig b/resources/views/preferences/index.twig
index 62ccec7945..4316a7c390 100644
--- a/resources/views/preferences/index.twig
+++ b/resources/views/preferences/index.twig
@@ -101,7 +101,7 @@
</div>
{# conversion back to primary currency #}
- {% if FireflyConfig.get('enable_exchange_rates', config('cer.enabled')) %}
+ {% if fireflyiiiconfig('enable_exchange_rates', true) %}
<div class="preferences-box">
<h3>{{ 'pref_convert_to_primary'|_ }}</h3>
<p class="text-info">