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

@@ -6,18 +6,15 @@
{% block main %}
{% set inUse = (stats.recordAmount > 0) %}
{% set inUse = (stats.counter > 0) %}
{% set params = {
'%project%': project.name,
'%customer%': project.customer.name,
'%records%': stats.recordAmount,
'%activities%': stats.activityAmount,
'%duration%': stats.recordDuration|duration
'%records%': stats.counter,
'%duration%': stats.duration|duration
} %}
{{ include(app.request.xmlHttpRequest ? 'default/_form_delete_modal.html.twig' : 'default/_form_delete.html.twig', {
'message': ("admin_project.short_stats"|trans(params) ~ "admin_entity.delete_confirm"|trans),
'message': ("delete_warning.short_stats"|trans(params) ~ "admin_entity.delete_confirm"|trans),
'form': form,
'used': inUse,
'back': path('admin_project')

View File

@@ -49,42 +49,66 @@
</td>
</tr>
{% if is_granted('details', project) %}
{% if project.orderNumber is not empty %}
<tr>
<th>{{ 'label.orderNumber'|trans }}</th>
<td colspan="3">
{{ project.orderNumber }}
</td>
</tr>
{% endif %}
{% if project.orderDate is not empty %}
<tr>
<th>{{ 'label.orderDate'|trans }}</th>
<td colspan="3">
{% if project.orderDate is not empty %}
{{ project.orderDate|date_full }}
{% else %}
&ndash;
{% endif %}
{{ project.orderDate|date_full }}
</td>
</tr>
{% endif %}
{% if project.start is not empty %}
<tr>
<th>{{ 'label.project_start'|trans }}</th>
<td colspan="3">
{% if project.start is not empty %}
{{ project.start|date_full }}
{% else %}
&ndash;
{% endif %}
{{ project.start|date_full }}
</td>
</tr>
{% endif %}
{% if project.end is not empty %}
<tr>
<th>{{ 'label.project_end'|trans }}</th>
<td colspan="3">
{% if project.end is not empty %}
{{ project.end|date_full }}
{% else %}
&ndash;
{% endif %}
{{ project.end|date_full }}
</td>
</tr>
{% endif %}
{% endif %}
{% if is_granted('budget', project) %}
{% if project.hasBudget() %}
<tr>
<th>
{{ 'label.budget'|trans }}
{% if project.isMonthlyBudget() %}
({{ 'label.budgetType_month'|trans }})
{% endif %}
</th>
<td colspan="3">
{{ project.getBudget()|money(project.customer.currency) }}
</td>
</tr>
{% endif %}
{% if project.hasTimeBudget() %}
<tr>
<th>
{{ 'label.timeBudget'|trans }}
{% if project.isMonthlyBudget() %}
({{ 'label.budgetType_month'|trans }})
{% endif %}
</th>
<td colspan="3">
{{ project.getTimeBudget()|duration }}
</td>
</tr>
{% endif %}
{% endif %}
{% for metaField in project.visibleMetaFields|sort((a, b) => a.order <=> b.order) %}
<tr>

View File

@@ -41,12 +41,15 @@
</div>
{% if form.budget is defined %}
<div class="row">
<div class="col-md-6">
<div class="col-md-4">
{{ form_row(form.budget) }}
</div>
<div class="col-md-6">
<div class="col-md-4">
{{ form_row(form.timeBudget) }}
</div>
<div class="col-md-4">
{{ form_row(form.budgetType) }}
</div>
</div>
{% endif %}
{{ form_row(form.visible) }}