Files
Starseed/templates/logistique/weighing_ticket_print.html.twig
T
tristan faafd99ef8
Auto Tag Develop / tag (push) Successful in 8s
feat : M5 — Tickets de pesée (ERP-188 → ERP-193) (#144)
MR unique regroupant tout le module M5 « Tickets de pesée » (remplace les MR empilées #140/#141/#142/#143).

## Périmètre
- **ERP-188** — Page liste des tickets de pesée + export XLSX (colonnes Fournisseur/Client/Autre + Statut).
- **ERP-189** — Écran « Ajouter » (4 champs en haut, 2 blocs de pesée, pesée bascule/manuelle, date+heure horodatée à la validation).
- **ERP-190** — Écran « Modifier » + bouton Imprimer.
- **ERP-191** — i18n + libellés + branchement site courant.
- **ERP-192** — Bon de pesée PDF généré côté back (template Twig → Dompdf), endpoint `GET /api/weighing_tickets/{id}/print.pdf`.
- **ERP-193** — Cycle de vie brouillon/validé (status DRAFT/VALIDATED, numéro attribué à la validation), DSD saisi conservé en pesée manuelle, retours métier design.

## Vérifications
- Back : tests Logistique + architecture verts, php-cs-fixer propre, migrations appliquées (dev + test).
- Front : suite Vitest complète verte, ESLint propre.

Base : `develop` — contient les 16 commits du M5 (rien d'autre).
Reviewed-on: #144
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
2026-06-24 14:38:01 +00:00

79 lines
3.2 KiB
Twig

{#
Ticket de pesée (M5 Logistique) — gabarit imprimable hydraté côté serveur puis
converti en PDF par WeighingTicketPdfRenderer (Dompdf). Cf. spec-back M5 § 2.12
/ § 4.6 (RG-5.08). Reproduit fidèlement le modèle fourni (ticket_pesee.pdf).
En-tête FIXE (logo + identité société) : le ticket ne change pas en fonction du
site (décision Tristan, ERP-192). Le logo est injecté en data-URI par le renderer
(logoSrc) ; l'identité société est en dur ci-dessous.
Contraintes Dompdf : CSS2.1 (pas de flexbox/grid), mise en page par tableaux.
Police DejaVu Sans (UTF-8 — accents FR et « ° » rendus correctement).
#}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<style>
@page { margin: 18mm 16mm; }
* { font-family: "DejaVu Sans", sans-serif; }
body { color: #000; font-size: 10px; margin: 0; }
.logo { margin-bottom: 16px; }
.logo img { height: 100px; }
.company-name { font-weight: bold; font-size: 12px; }
.company-line { font-size: 12px; }
.title { font-size: 22px; font-weight: bold; margin: 22px 0 18px; }
/* Lignes des deux pesées : tableau sans bordure, colonnes alignées. */
.weighings { border-collapse: collapse; font-size: 12px; }
.weighings td { vertical-align: top; white-space: nowrap; }
.weighings .c-label { width: 130px; }
.weighings .c-weight { width: 95px; }
.weighings .c-num { width: 175px; }
.weighings .c-dsd { width: auto; }
.net { font-size: 18px; font-weight: bold; margin-top: 26px; }
</style>
</head>
<body>
{% if logoSrc %}
<div class="logo"><img src="{{ logoSrc }}" alt="LPC LIOT"></div>
{% endif %}
<div class="company-name">SA LIOT Châtellerault</div>
<div class="company-line">Email : lpc.contacts@lpc-liot.fr</div>
<div class="company-line">RCS Châtellerault B 339 505 612</div>
<div class="title">Ticket de pesée</div>
{#
DSD de la pesée : valeur du pont en AUTO, valeur saisie par l'opérateur en
MANUAL (ERP-193). Un seul champ `dsd` dans les deux cas.
#}
{% set emptyRef = ticket.emptyDsd %}
{% set fullRef = ticket.fullDsd %}
<table class="weighings">
<tr>
<td class="c-label">Poids à vide</td>
<td class="c-weight">{{ ticket.emptyWeight is not null ? ticket.emptyWeight ~ ' kg' : '' }}</td>
<td class="c-num">N° pesée à vide</td>
<td class="c-dsd">{% if emptyRef is not null %}DSD : {{ emptyRef }}{% endif %}{% if ticket.emptyDate %} {{ ticket.emptyDate|date('d/m/Y H:i:s') }}{% endif %}</td>
</tr>
<tr>
<td class="c-label">Poids à plein</td>
<td class="c-weight">{{ ticket.fullWeight is not null ? ticket.fullWeight ~ ' kg' : '' }}</td>
<td class="c-num">N° pesée à plein</td>
<td class="c-dsd">{% if fullRef is not null %}DSD : {{ fullRef }}{% endif %}{% if ticket.fullDate %} {{ ticket.fullDate|date('d/m/Y H:i:s') }}{% endif %}</td>
</tr>
</table>
<div class="net">Poids : {{ ticket.netWeight is not null ? ticket.netWeight ~ ' kg' : '—' }}</div>
</body>
</html>