Files
schedule/src/schedule-2.0/templates/Report/planning.html.twig

192 lines
6.5 KiB
Twig

{% extends "base.html.twig" %}
{% block localstyle %}
.card {
margin: 20px 20px 0px 0px;
}
.card-body .month {
margin: 20px 0px 0px 0px;
}
.card-body .month:first-child {
margin: 0px;
}
.card-header h2 {
float:left;
}
.card-header .synthese {
float:right;
font-size:12px;
text-align: right;
}
th,td {
border: 1px solid #37474F;
color: #000000;
background-color:#cccccc;
}
.intervenant {
width:200px;
padding-left:5px;
}
.total {
text-align:center;
width:70px;
background-color:#888888;
}
.day {
text-align:center;
width: 40px;
height:40px;
}
.astreinte {
height: 12px;
font-size: 10px;
}
{% if fgprint is defined and fgprint %}
h2, h3 {
display:block !important;
float:none !important;
}
table { width:100%; font-size:10px;}
.card-header .synthese {
float:none !important;
text-align:left !important;
}
.day {
height:auto !important;
}
{% endif %}
{% endblock %}
{% block body %}
{% if fgprint is defined and fgprint %}<h1>Planning</h1>{%endif%}
{% if access=="customer" and not app.user %}
<div class="no-print" style="margin-top:10px;">
<style> .select2-container { display:inline-block} </style>
<a class="btn btn-info" href="{{ path("app_customer_report",{"key":key})}}">Rapport</a>
<a class="btn btn-success" href="{{ path("app_customer_planning",{"key":key})}}">Planning</a>
&nbsp;&nbsp;Nombre de mois
<select class="form-control select2entity" id="sidemonth" name="sidemonth" style="width:auto; display:inline-block">
{% set selected="" %}
{% for i in 1..48 %}
{% set selected="" %}
{%if i==app.session.get('nbmonth') %}
{% set selected="selected" %}
{% endif %}
<option value="{{i}}" {{selected}}>{{i}}</option>
{% endfor %}
</select>
</div>
{% endif %}
{% for project in projects %}
{% if not project.months is empty %}
<div class="card">
<div class="card-header">
<h2>{{ project.displayname }}</h2>
<div class="synthese">
Estimé = {{ project.estimate }}<br>
Commandé = {{ project.proposed }}<br>
Validé = {{ project.validate }}<br>
Planifié = {{ project.planified }}<br>
<b>RESTE = {{ ( project.proposed - project.validate - project.planified) }}</b>
</div>
</div>
<div class="card-body">
{% set month="" %}
{% for month in project.months %}
<h3 class="month">{{ month.monthlabel }}</h3>
<table>
<thead>
<th class="intervenant">Intervenant</th>
{% for day in month.days %}
<th class="day" style="background-color: {{ day.daycolor }}">
{{ day.daylabel }}<br>
{{ day.daynumber }}
</th>
{% endfor %}
<th class="total">Total</th>
</thead>
{% for user in month.users %}
<tr>
<td class="intervenant">{{ user.displayname }}</td>
{% for day in user.days %}
<td class="day" style="background-color: {{ day.daycolor }}">
{% if day.duration > 0 %}
{{ day.duration }}
{% endif %}
{% if day.astreinte > 0 %}
<div class="astreinte">A</div>
{% endif %}
</td>
{% endfor %}
<td class="total">{{user.total}}</td>
</tr>
{% endfor %}
</table>
{% if month.total > 0 %}
<br>
<table class="recaptask small">
{% for task in month.tasks %}
<tr>
<td>{{ task.displayname }}</td>
<td class="text-right">{{ task.duration|number_format(2, '.', ' ') }}</td>
</tr>
{% endfor %}
{% if month.totala > 0 %}
<tr>
<td>Astreinte</td>
<td class="text-right">{{ month.totala|number_format(2, '.', ' ') }}</td>
</tr>
{% endif %}
<tfoot>
<tr>
<td style="min-width:200px">TOTAL</td>
<td class="text-right" style="min-width:100px">{{ (month.total + month.totala)|number_format(2, '.', ' ') }}</td>
</tr>
</tfoot>
</table>
{% endif %}
{% if month.total > 0 %}
<i>Total = {{ month.total }}</i>
{% endif %}
{% if month.totala > 0 %}
<i>Total Astreinte = {{ month.totala }}</i>
{% endif %}
<div class="new-page">&nbsp;</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
<br>
{% endblock %}
{% block localjavascript %}
function myprint() {
href=document.location.href;
document.location.href=href+"?fgprint=true";
}
{% endblock %}