{% extends './layout/default' %} {% block breadcrumbs %} {{ Breadcrumbs.render(Route.getCurrentRoute.getName) }} {% endblock %} {% block content %}
{{ 'budget'|_ }} | {{ 'budgeted'|_ }} | {{ 'left'|_ }} ({{ 'per_day'|_|lower }}) |
---|---|---|
{% if 0 == budget.budgeted|length %}
{{ budget.name }}
{% endif %}
{% if 1 == budget.budgeted|length %}
{% for budgetLimit in budget.budgeted %}
{{ budget.name }}
{% endfor %}
{% endif %}
{% if budget.budgeted|length > 1 %}
{% for budgetLimit in budget.budgeted %}
{{ budget.name }} ({{ budgetLimit.currency_name }}) {% endfor %} {% endif %} {% if budget.auto_budget %} {% if 1 == budget.auto_budget.auto_budget_type %} {% endif %} {% if 2 == budget.auto_budget.auto_budget_type %} {% endif %} {% if 3 == budget.auto_budget.auto_budget_type %} {% endif %} {% endif %} {% if budget.attachments.count() > 0 %} {% endif %} |
{% if 0==budget.budgeted|length %}
{{ primaryCurrency.symbol }}
{% endif %} {% endfor %} {% endif %} {% if budget.budgeted|length < currencies.count() %} {% endif %} |
{# this cell displays the amount left in the budget, per budget limit. #}
{% for spentInfo in budget.spent %}
{% set countLimit = 0 %}
{% for budgetLimit in budget.budgeted %}
{# now looping a single budget limit. #}
{% if spentInfo.currency_id == budgetLimit.currency_id and budgetLimit.in_range %}
{# the code below is used for budget limits INSIDE the current view range. #}
{% set countLimit = countLimit + 1 %}
{# the amount left is automatically calculated. #}
{{ formatAmountBySymbol(spentInfo.spent + budgetLimit.amount, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }}
{% if spentInfo.spent + budgetLimit.amount > 0 %}
{% if 0 == activeDaysLeft %}
({{ formatAmountBySymbol(spentInfo.spent + budgetLimit.amount, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% else %}
({{ formatAmountBySymbol((spentInfo.spent + budgetLimit.amount) / activeDaysLeft, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% endif %}
{% else %}
({{ formatAmountBySymbol(0, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% endif %}
{% endif %} {% if spentInfo.currency_id == budgetLimit.currency_id and not budgetLimit.in_range %} {{ formatAmountBySymbol(spentInfo.spent + budgetLimit.amount, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }} ({{ 'unknown'|_ }}) {% endif %} {% endfor %} {% if countLimit == 0 %} {# display nothing #} {% endif %} {% endfor %} {% for budgetLimit in budget.budgeted %} {% if null == budget.spent[budgetLimit.currency_id] %} {{ formatAmountBySymbol(budgetLimit.amount, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }} {% if budgetLimit.in_range %} {% if 0 == activeDaysLeft %} ({{ formatAmountBySymbol(budgetLimit.amount, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}) {% else %} ({{ formatAmountBySymbol(budgetLimit.amount / activeDaysLeft, budgetLimit.currency_symbol, budgetLimit.currency_decimal_places) }}) {% 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 %} {% endif %} {% endfor %} |