mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix #10441
This commit is contained in:
@@ -137,7 +137,6 @@ class IndexController extends Controller
|
|||||||
// get all inactive budgets, and simply list them:
|
// get all inactive budgets, and simply list them:
|
||||||
$inactive = $this->repository->getInactiveBudgets();
|
$inactive = $this->repository->getInactiveBudgets();
|
||||||
$defaultCurrency = $this->defaultCurrency;
|
$defaultCurrency = $this->defaultCurrency;
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
'budgets.index',
|
'budgets.index',
|
||||||
compact(
|
compact(
|
||||||
@@ -225,6 +224,7 @@ class IndexController extends Controller
|
|||||||
'start_date' => $limit->start_date->isoFormat($this->monthAndDayFormat),
|
'start_date' => $limit->start_date->isoFormat($this->monthAndDayFormat),
|
||||||
'end_date' => $limit->end_date->isoFormat($this->monthAndDayFormat),
|
'end_date' => $limit->end_date->isoFormat($this->monthAndDayFormat),
|
||||||
'in_range' => $limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end),
|
'in_range' => $limit->start_date->isSameDay($start) && $limit->end_date->isSameDay($end),
|
||||||
|
'total_days' => $limit->start_date->diffInDays($limit->end_date) + 1,
|
||||||
'currency_id' => $currency->id,
|
'currency_id' => $currency->id,
|
||||||
'currency_symbol' => $currency->symbol,
|
'currency_symbol' => $currency->symbol,
|
||||||
'currency_name' => $currency->name,
|
'currency_name' => $currency->name,
|
||||||
|
@@ -339,6 +339,7 @@
|
|||||||
{% if spentInfo.currency_id == budgetLimit.currency_id and budgetLimit.in_range %}
|
{% if spentInfo.currency_id == budgetLimit.currency_id and budgetLimit.in_range %}
|
||||||
{# the code below is used for budget limits INSIDE the current view range. #}
|
{# the code below is used for budget limits INSIDE the current view range. #}
|
||||||
{% set countLimit = countLimit + 1 %}
|
{% set countLimit = countLimit + 1 %}
|
||||||
|
|
||||||
<span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
|
<span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
|
||||||
data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
|
data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
|
||||||
{# the amount left is automatically calculated. #}
|
{# the amount left is automatically calculated. #}
|
||||||
@@ -356,7 +357,9 @@
|
|||||||
<br/>
|
<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if countLimit == 0 %}
|
{% if countLimit == 0 %}
|
||||||
|
|
||||||
{# this code is used for budget limits OUTSIDE the current view range. #}
|
{# this code is used for budget limits OUTSIDE the current view range. #}
|
||||||
<span class="left_span" data-id="{{ budget.id }}" data-currency="{{ spentInfo.currency_id }}" data-limit="0"
|
<span class="left_span" data-id="{{ budget.id }}" data-currency="{{ spentInfo.currency_id }}" data-limit="0"
|
||||||
class="amount_left" data-value="{{ spentInfo.spent }}">
|
class="amount_left" data-value="{{ spentInfo.spent }}">
|
||||||
@@ -366,7 +369,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for budgetLimit in budget.budgeted %}
|
{% for budgetLimit in budget.budgeted %}
|
||||||
|
D
|
||||||
{% if null == budget.spent[budgetLimit.currency_id] %}
|
{% if null == budget.spent[budgetLimit.currency_id] %}
|
||||||
|
E
|
||||||
<span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
|
<span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
|
||||||
data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
|
data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
|
||||||
{{ formatAmountBySymbol(budgetLimit.amount, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}
|
{{ formatAmountBySymbol(budgetLimit.amount, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}
|
||||||
@@ -377,6 +382,10 @@
|
|||||||
({{ formatAmountBySymbol(budgetLimit.amount / activeDaysLeft, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }})
|
({{ formatAmountBySymbol(budgetLimit.amount / activeDaysLeft, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }})
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if not budgetLimit.in_range %}
|
||||||
|
{# For issue #10441, add per day if the budget limit is out of range. #}
|
||||||
|
({{ formatAmountBySymbol(budgetLimit.amount / budgetLimit.total_days, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }})
|
||||||
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
<br/>
|
<br/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Reference in New Issue
Block a user