Skip to content

Firefly III: a personal finances manager

Fix #2536

James Colea29e78ed44d5
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index 94dde17cdd..278fef5e1d 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -164,13 +164,14 @@ class IndexController extends Controller
/** @var BudgetLimit $limit */
foreach ($budgetLimits as $limit) {
+ $currency = $limit->transactionCurrency ?? $defaultCurrency;
$array['budgeted'][] = [
'id' => $limit->id,
'amount' => $limit->amount,
- 'currency_id' => $limit->transactionCurrency->id,
- 'currency_symbol' => $limit->transactionCurrency->symbol,
- 'currency_name' => $limit->transactionCurrency->name,
- 'currency_decimal_places' => $limit->transactionCurrency->decimal_places,
+ 'currency_id' => $currency->id,
+ 'currency_symbol' => $currency->symbol,
+ 'currency_name' => $currency->name,
+ 'currency_decimal_places' => $currency->decimal_places,
];
}
diff --git a/resources/views/v1/budgets/index.twig b/resources/views/v1/budgets/index.twig
index 0a74eb922a..eb35a33234 100644
--- a/resources/views/v1/budgets/index.twig
+++ b/resources/views/v1/budgets/index.twig
@@ -197,7 +197,7 @@
{% endif %}
</div>
{% endif %}
- {% if budgets.count == 0 and inactive.count == 0 %}
+ {% if budgets|length == 0 and inactive.count == 0 %}
{% include 'partials.empty' with {objectType: 'default', type: 'budgets',route: route('budgets.create')} %}
{# make FF ignore demo for now. #}
{% set shownDemo = true %}