|
{{ 'label.customer'|trans }}
|
{{ widgets.label_customer(entry.project.customer) }}
|
|
{{ 'stats.durationTotal'|trans }}
|
{{ entry.durationTotal|duration }} |
{% if view_revenue_tab %}
|
{{ 'stats.amountTotal'|trans }}
|
{{ entry.rateTotal|money(currency) }} |
{% endif %}
{% if view_revenue_tab and (project.timeBudget > 0 or project.budget > 0) %}
{% if project.timeBudget > 0 %}
|
{{ 'label.timeBudget'|trans }}
|
{% set timeBudgetLeft = project.timeBudget - entry.billableDuration %}
{% set options = {
'max': project.timeBudget|default(0),
'current': entry.billableDuration|default(0),
'open': timeBudgetLeft,
'format': 'duration'
} %}
{{ progress.progressbar_full(options) }}
|
{% endif %}
{% if project.budget > 0 %}
|
{{ 'label.budget'|trans }}
|
{% set budgetLeft = project.budget - entry.billableRate %}
{% set options = {
'max': project.budget|default(0),
'current': entry.billableRate|default(0),
'open': budgetLeft,
'format': 'money',
'currency': currency
} %}
{{ progress.progressbar_full(options) }}
|
{% endif %}
{% endif %}
{% if view_revenue_tab %}
{{ charts.bar_chart(chartPrefix ~ 'Rate', labels, [rates], {'height': '300px', 'renderEvent': 'render.' ~ chartPrefix ~ 'Rate'}) }}
{% endif %}
{{ charts.bar_chart(chartPrefix ~ 'Duration', labels, [durations], {'height': '300px', 'renderEvent': 'render.' ~ chartPrefix ~ 'Duration'}) }}
{{ _self.activity_tab(activities, entry.durationTotal, project.customer.currency, chartPrefix, view_revenue_tab) }}
{% if see_users %}
{% set rateTotal = 0 %}
{% set totalDuration = 0 %}
{% set datasets = [] %}
{% set labels = [] %}
{% for userStat in project_details.userStats|sort((a, b) => a.duration <= b.duration) %}
{% set user = userStat.user %}
{% set color = user.color|colorize(user.displayName) %}
{% set rateTotal = rateTotal + userStat.rate %}
{% set totalDuration = totalDuration + userStat.duration %}
{% set datasets = datasets|merge([{'name': user.displayName, 'duration': userStat.duration|duration, 'value': userStat.duration, 'color': color, 'rate': userStat.rate|money(currency)}]) %}
{% set percentage = 0 %}
{% if entry.durationTotal > 0 and userStat.duration > 0 %}
{% set percentage = (100 / (entry.durationTotal / userStat.duration)) %}
{% endif %}
|
{{ widgets.label_dot(user.displayName, user.color) }}
|
{{ userStat.duration|duration }}
|
{% if view_revenue_user %}
{{ userStat.rate|money(currency) }}
|
{% endif %}
{{ percentage|number_format(1) }} %
|
{% endfor %}
|
{{ totalDuration|duration }} |
{% if view_revenue_user %}
{{ rateTotal|money(currency) }} |
{% endif %}
|
{% set chartOptions = {'height': (datasets|length > 12 ? '600px' : '300px'), 'legend': {'position': (datasets|length > 12 ? 'top' : 'right')}, 'renderEvent': 'render.' ~ chartPrefix ~ 'User'} %}
{{ charts.doughnut_chart(chartPrefix ~ 'User', labels, datasets, chartOptions) }}
{% endif %}