diff --git a/templates/embeds/budgets.html.twig b/templates/embeds/budgets.html.twig index 0dfbab8c..779529c0 100644 --- a/templates/embeds/budgets.html.twig +++ b/templates/embeds/budgets.html.twig @@ -1,4 +1,6 @@ -{% if is_granted('time', entity) %} +{% set timeBudgetVisible = is_granted('time', entity) %} +{% set durationTrans = entity.isMonthlyBudget() ? 'stats.durationMonth' : 'stats.durationTotal' %} +{% if timeBudgetVisible %} {% embed '@AdminLTE/Widgets/box-widget.html.twig' %} {% import "macros/progressbar.html.twig" as progress %} {% import "macros/widgets.html.twig" as widgets %} @@ -8,7 +10,6 @@ {% block box_body_class %}no-padding{% endblock %} {% block box_attributes %}id="time_budget_box"{% endblock %} {% block box_body %} - {% set durationTrans = entity.isMonthlyBudget() ? 'stats.durationMonth' : 'stats.durationTotal' %}
@@ -130,8 +131,16 @@ - {% if entity.budget > 0 %} + {% if not entity.isMonthlyBudget() and timeBudgetVisible and stats.duration > 0 %} + {% set realHourlyRate = stats.rateBillable / stats.duration|chart_duration %} + + + + + {% endif %} + {% if entity.budget > 0 %} +
{{ stats.internalRate|money(currency) }} {{ percentReached|number_format(2) }}%
{{ 'label.hourlyRate'|trans }} ({{ 'label.billable'|trans }} / {{ durationTrans|trans }}){{ realHourlyRate|money(currency) }}-
{% if totalPercentReached < 100 %} {{ 'stats.percentUsedLeft'|trans({'%percent%': totalPercentReached|number_format(2), '%left%': (entity.budget - stats.rateBillable)|money(currency)}) }}