monthly budget, monthly report, unified report calculation (#2684)

This commit is contained in:
Kevin Papst
2021-08-06 18:38:41 +02:00
committed by GitHub
parent 21f785638c
commit cefd747e91
196 changed files with 5031 additions and 2167 deletions

View File

@@ -16,29 +16,19 @@
{% block box_body %}
<table class="table table-hover dataTable" role="grid">
<tbody>
{% for row in projectStats|sort((a, b) => a.project.name <=> b.project.name) %}
{% set stats = row.stats %}
{% set project = row.project %}
{% for row in projectStats|sort((a, b) => a.entity.name <=> b.entity.name) %}
{% set project = row.entity %}
<tr{% if is_granted('details', project) %} class="alternative-link open-edit" data-href="{{ path('project_details', {'id': project.id}) }}"{% endif %}>
<td>
{{ widgets.label_project(project) }}
<br>
<small>{{ widgets.label_customer(project.customer) }}</small>
</td>
<td class="hidden-xs hidden-sm hidden-md">
{% for team in project.teams %}
{% if app.user.isInTeam(team) %}
{{ team.name }}
{% endif %}
{% endfor %}
</td>
<td style="width:50%">
{% if project.timeBudget is not empty and project.timeBudget > 0 %}
{% set budgetLeft = project.timeBudget - stats.recordDuration %}
{{ progress.progressbar_small(project.timeBudget, stats.durationBillable, budgetLeft, budgetLeft|duration) }}
{% elseif project.budget is not empty and project.budget > 0 %}
{% set budgetLeft = project.budget - stats.recordRate %}
{{ progress.progressbar_small(project.budget, stats.rateBillable, budgetLeft, budgetLeft|money(project.customer.currency)) }}
{% if row.hasTimeBudget() %}
{{ progress.progressbar_timebudget(row) }}
{% elseif row.hasBudget() %}
{{ progress.progressbar_budget(row, row.entity.customer.currency) }}
{% endif %}
</td>
</tr>