show total hourly rate in detail pages (#3441)
This commit is contained in:
@@ -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' %}
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<table class="table table-hover dataTable">
|
||||
@@ -130,8 +131,16 @@
|
||||
<td class="text-nowrap text-right">{{ stats.internalRate|money(currency) }}</td>
|
||||
<td class="text-nowrap text-right">{{ percentReached|number_format(2) }}%</td>
|
||||
</tr>
|
||||
{% if entity.budget > 0 %}
|
||||
{% if not entity.isMonthlyBudget() and timeBudgetVisible and stats.duration > 0 %}
|
||||
{% set realHourlyRate = stats.rateBillable / stats.duration|chart_duration %}
|
||||
<tr>
|
||||
<td>{{ 'label.hourlyRate'|trans }} ({{ 'label.billable'|trans }} / {{ durationTrans|trans }})</td>
|
||||
<td class="text-nowrap text-right">{{ realHourlyRate|money(currency) }}</td>
|
||||
<td class="text-nowrap text-right">-</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if entity.budget > 0 %}
|
||||
<tr>
|
||||
<th colspan="3" class="text-nowrap text-right">
|
||||
{% if totalPercentReached < 100 %}
|
||||
{{ 'stats.percentUsedLeft'|trans({'%percent%': totalPercentReached|number_format(2), '%left%': (entity.budget - stats.rateBillable)|money(currency)}) }}
|
||||
|
||||
Reference in New Issue
Block a user