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