{{ 'label.customer'|trans }}
|
{{ widgets.label_customer(project.customer) }}
|
{{ 'stats.durationTotal'|trans }}
|
{{ project_view.durationTotal|duration }} |
{% if view_revenue %}
{{ 'stats.amountTotal'|trans }}
|
{{ project_view.rateTotal|money(currency) }} |
{% endif %}
{% if view_budget and (project.timeBudget > 0 or project.budget > 0) %}
{% set budgetStats = project_details.budgetStatisticModel %}
{% if project.timeBudget > 0 %}
{{ 'label.timeBudget'|trans }}
{% if budgetStats.isMonthlyBudget() %}
({{ 'label.budgetType_month'|trans }})
{% endif %}
|
{{ progress.progressbar_timebudget(budgetStats) }}
|
{% endif %}
{% if project.budget > 0 %}
{{ 'label.budget'|trans }}
{% if budgetStats.isMonthlyBudget() %}
({{ 'label.budgetType_month'|trans }})
{% endif %}
|
{{ progress.progressbar_budget(budgetStats, project.customer.currency) }}
|
{% endif %}
{% endif %}
{% if view_revenue and project_view.rateTotal > 0 %}
{{ charts.bar_chart(chartPrefix ~ 'Rate', labels, [rates], {'height': '300px', 'renderEvent': 'render.' ~ chartPrefix ~ 'Rate'}) }}
{% endif %}
{% if project_view.durationTotal > 0 %}
{{ charts.bar_chart(chartPrefix ~ 'Duration', labels, [durations], {'height': '300px', 'renderEvent': 'render.' ~ chartPrefix ~ 'Duration'}) }}
{% endif %}
{% if activities is not empty %}
{{ _self.activity_tab(activities, project_view.durationTotal, project.customer.currency, chartPrefix, view_revenue) }}
{% endif %}
{% if see_users and project_details.userStats|length > 0 %}
{% set rateTotal = 0 %}
{% set totalDuration = 0 %}
{% set datasets = [] %}
{% set labels = [] %}
{% for userStat in project_details.userStats|sort((a, b) => b.duration <=> a.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 project_view.durationTotal > 0 and userStat.duration > 0 %}
{% set percentage = (100 / (project_view.durationTotal / userStat.duration)) %}
{% endif %}
{{ widgets.label_dot(user.displayName, user.color) }}
|
{{ userStat.duration|duration }}
|
{% if view_revenue %}
{{ userStat.rate|money(currency) }}
|
{% endif %}
{{ percentage|number_format(1) }} %
|
{% endfor %}
|
{{ totalDuration|duration }} |
{% if view_revenue %}
{{ 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 %}