{# ══════════════════════════════════════════════════════════════════ Template PDF — Feuille de présence mensuelle ══════════════════════════════════════════════════════════════════ Généré par dompdf via PdfService::generateFromTemplate(). Ce template est autonome (pas d'héritage Twig, pas d'assets externes) car dompdf ne supporte pas les ressources distantes. Variables attendues : targetUser : User — employé concerné feuille : Pointage[]— lignes du mois (une par jour) year : int — année de la feuille month : int — mois de la feuille (1-12) totaux : array — cumuls mensuels (hj, hn, repas…) weeklyTotals: array — sous-totaux par semaine ISO tarifs : array — tarifs d'indemnités indexés par code totalAPayer : float — total monétaire calculé feuilleM : FeuilleMensuelle|null — km véhicule + observations Couleurs utilisées : Fond tableau : #0f2d52 (bleu nuit) pour les en-têtes PDF Statuts : identiques à app.css (synchronisés) Marges : 12mm (haut/bas) × 14mm (gauche/droite) via body ══════════════════════════════════════════════════════════════════ #} Feuille de présence — {{ targetUser.nomComplet }} — {{ month|mois_nom }} {{ year }} {% set jourNomsFr = {'1':'lundi','2':'mardi','3':'mercredi','4':'jeudi','5':'vendredi','6':'samedi','7':'dimanche'} %} {# ── En-tête ── #} {# ── Info employé ── #}
Employé : {{ targetUser.nomComplet }} Matricule : {{ targetUser.matricule ?? '—' }} Poste : {{ targetUser.poste ?? '—' }}
{# ── Tableau principal ── #} {% for p in feuille %} {% set isOff = p.statut.jourOff %} {% set dowN = p.date|date('N') %} {# Sous-total semaine #} {% if dowN == '7' or loop.last %} {% set wk = weeklyTotals[p.date|date('o') ~ '-' ~ p.date|date('W')] ?? {'hj': 0, 'hn': 0} %} {% endif %} {% endfor %}
JOUR DATE Statut Chantier, client, lieu Observation HORAIRES
Début — Fin
Pause
(min)
Repas HJ
(6h-22h)
HN
(22h-6h)
Stand-by
(en h)
Trajet
KM
Trajet
Heure
Dépl.
NT
Km VP
{{ jourNomsFr[dowN] }} {{ p.date|date('d') }} {{ p.statut.label }} {{ p.chantier ?? '' }} {{ p.notes ? p.notes|nl2br : '' }} {% if not isOff and p.heureArrivee %} {{ p.heureArrivee|date('H:i') }} — {{ p.heureDepart ? p.heureDepart|date('H:i') : '?' }} {% else %}—{% endif %} {{ not isOff ? (p.pauseMinutes is not null ? p.pauseMinutes : 30) : '' }} {{ (not isOff and p.repas is not null) ? p.repas : '' }} {{ (not isOff and p.heuresJour > 0) ? '%.2f'|format(p.heuresJour) : '' }} {{ (not isOff and p.heuresNuit > 0) ? '%.2f'|format(p.heuresNuit) : '' }} {{ (not isOff and p.standByeHeures is not null) ? '%.2f'|format(p.standByeHeures) : '' }} {{ (not isOff and p.trajetKm is not null) ? p.trajetKm : '' }} {{ (not isOff and p.trajetHeures is not null) ? '%.2f'|format(p.trajetHeures) : '' }} {{ (not isOff and p.deplacementNt is not null) ? p.deplacementNt : '' }} {{ (not isOff and p.kmVp is not null) ? p.kmVp : '' }}
Semaine {{ p.date|date('W') }} — Total : {{ wk['hj'] > 0 ? '%.2f'|format(wk['hj']) : '' }} {{ wk['hn'] > 0 ? '%.2f'|format(wk['hn']) : '' }}
TOTAL {{ totaux.repas }} {{ '%.2f'|format(totaux.hj) }} {{ '%.2f'|format(totaux.hn) }} {{ '%.2f'|format(totaux.standBye) }} {{ totaux.trajetKm }} {{ '%.2f'|format(totaux.trajetHeures) }} {{ totaux.deplacementNt }} {{ totaux.kmVp }}
{# ── Récapitulatif ── #}
Heures Jour (HJ) Heures Nuit (HN) Routes (h) Stand-by (h) Trajet KM Dépl. NT Km VP Repas
{{ '%.2f'|format(totaux.hj) }} {{ '%.2f'|format(totaux.hn) }} {{ '%.2f'|format(totaux.trajetHeures) }} {{ '%.2f'|format(totaux.standBye) }} {{ totaux.trajetKm }} {{ totaux.deplacementNt }} {{ totaux.kmVp }} {{ totaux.repas }}
{# ── Indemnités & Total à payer ── #} {% if tarifs is defined %} {# Tableau indemnités #} {# Kilométrage véhicule #}
{% if isAdmin is defined and isAdmin %} {% endif %} {% set tarifRepas = tarifs.repas ?? 0 %} {% set tarifDepl = tarifs.deplacement ?? 0 %} {% set tarifKm = tarifs.kilometre ?? 0 %} {% if isAdmin is defined and isAdmin %} {% endif %} {% if isAdmin is defined and isAdmin %} {% endif %} {% if isAdmin is defined and isAdmin %} {% endif %}
Indemnité QtéTarifMontant
Repas {{ totaux.repas }}{{ tarifRepas|number_format(2, ',', ' ') }} €{{ (totaux.repas * tarifRepas)|number_format(2, ',', ' ') }} €
Déplacement NT {{ totaux.deplacementNt }}{{ tarifDepl|number_format(2, ',', ' ') }} €{{ (totaux.deplacementNt * tarifDepl)|number_format(2, ',', ' ') }} €
Km VP {{ totaux.kmVp }}{{ tarifKm|number_format(4, ',', ' ') }} €{{ (totaux.kmVp * tarifKm)|number_format(2, ',', ' ') }} €
TOTAL À PAYER : {{ totalAPayer|number_format(2, ',', ' ') }} €
Kilométrage véhicule
Immatriculation {{ feuilleM and feuilleM.immatriculation ? feuilleM.immatriculation : '—' }}
Début de mois {{ feuilleM and feuilleM.kmDebut is not null ? feuilleM.kmDebut : '—' }}
Fin de mois {{ feuilleM and feuilleM.kmFin is not null ? feuilleM.kmFin : '—' }}
Total {{ feuilleM and feuilleM.kmTotal is not null ? feuilleM.kmTotal : '—' }}
{% if feuilleM and feuilleM.observations %}
Observations : {{ feuilleM.observations }}
{% endif %}
{% endif %} {# ── Signatures ── #}
Visa de l'intéressé(e)
Accord Direction
Visa RH / Direction
{# ── Légende ── #}
{% set legende = [ {color:'#ffffff', label:'Travaillé'}, {color:'#bbf7d0', label:'Télétravail'}, {color:'#e9d5ff', label:'Formation'}, {color:'#dbeafe', label:'Congé'}, {color:'#fed7aa', label:'Maladie'}, {color:'#fecaca', label:'Absent'}, {color:'#fef3c7', label:'Jour férié'}, {color:'#e4e6ea', label:'Week-end'}, ] %} {% for item in legende %} {% endfor %}
{{ item.label }}