Fix view of running balance column

This commit is contained in:
James Cole
2025-12-26 20:02:09 +01:00
parent 456e73ac16
commit 4d2dd1d8f7
7 changed files with 19 additions and 7 deletions

View File

@@ -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;

View File

@@ -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;
}
);
}
}

View File

@@ -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',

View File

@@ -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' %}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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">