From f0fe8bf5c7350afeb001a634c6727967bd569c2f Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 3 Sep 2020 06:34:48 +0200 Subject: [PATCH] Fix #3759 --- app/Http/Controllers/Budget/IndexController.php | 15 +++++---------- resources/views/v1/budgets/index.twig | 8 ++++++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php index 5d80e1432b..f5c0ab3cfb 100644 --- a/app/Http/Controllers/Budget/IndexController.php +++ b/app/Http/Controllers/Budget/IndexController.php @@ -49,16 +49,11 @@ use Log; class IndexController extends Controller { use DateCalculation; - /** @var AvailableBudgetRepositoryInterface */ - private $abRepository; - /** @var BudgetLimitRepositoryInterface */ - private $blRepository; - /** @var CurrencyRepositoryInterface */ - private $currencyRepository; - /** @var OperationsRepositoryInterface */ - private $opsRepository; - /** @var BudgetRepositoryInterface The budget repository */ - private $repository; + private AvailableBudgetRepositoryInterface $abRepository; + private BudgetLimitRepositoryInterface $blRepository; + private CurrencyRepositoryInterface $currencyRepository; + private OperationsRepositoryInterface $opsRepository; + private BudgetRepositoryInterface $repository; /** * IndexController constructor. diff --git a/resources/views/v1/budgets/index.twig b/resources/views/v1/budgets/index.twig index 0686d06780..236452ebf2 100644 --- a/resources/views/v1/budgets/index.twig +++ b/resources/views/v1/budgets/index.twig @@ -306,7 +306,7 @@ {% for spentInfo in budget.spent %} {% set countLimit = 0 %} {% for budgetLimit in budget.budgeted %} - {% if spentInfo.currency_id == budgetLimit.currency_id %} + {% if spentInfo.currency_id == budgetLimit.currency_id and budgetLimit.in_range %} {% set countLimit = countLimit + 1 %} @@ -333,7 +333,11 @@ {{ formatAmountBySymbol(budgetLimit.amount, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }} - ({{ formatAmountBySymbol(budgetLimit.amount / activeDaysLeft, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}) + {% if budgetLimit.in_range %} + ({{ formatAmountBySymbol(budgetLimit.amount / activeDaysLeft, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}) + {% else %} + X + {% endif %}
{% endif %}