fix(logistique) : corrections review ticket de pesée (ERP-208)
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 1m59s
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 2m32s

- Édition : listes contrepartie filtrées sur le site DU TICKET (immuable), chargées après hydrate, sans purge de la contrepartie persistée (injection de l'option si absente) → corrige la perte silencieuse / race.
- Entité : constantes COUNTERPARTY_* (Assert\Choice + validation + getCounterpartyName) ; libellé FR du type déplacé du Domain vers le template.
- PDF : cartouche conditionné sur le type (nom à l'intérieur), layout Dompdf-safe (largeurs de cellules, cartouche en bloc, nom long renvoyé à la ligne).
This commit is contained in:
2026-06-25 14:55:35 +02:00
parent 527e47d822
commit 2b03c4ae15
5 changed files with 65 additions and 63 deletions
@@ -28,12 +28,17 @@
.company-line { font-size: 12px; }
/* En-tête 2 colonnes (Dompdf = CSS 2.1, pas de flex/grid) : identité
société à gauche, cartouche du tiers à droite (ERP-208). */
société à gauche, cartouche du tiers à droite (ERP-208). Largeurs
fixes par cellule + cartouche en bloc (pas d'inline-block/min-width,
mal supportés par Dompdf) : le cartouche occupe la colonne de droite
et un nom long passe à la ligne au lieu de déborder. */
.header { width: 100%; border-collapse: collapse; }
.header td { vertical-align: top; }
.header .h-right { text-align: right; }
.party-box { display: inline-block; border: 1px solid #000; padding: 8px 12px; min-width: 160px; text-align: left; font-weight: normal; font-size: 11px; }
.header .h-left { width: 62%; }
.header .h-right { width: 38%; }
.party-box { border: 1px solid #000; padding: 8px 12px; }
.party-label { font-weight: bold; font-size: 14px; margin-bottom: 4px; }
.party-name { font-size: 11px; word-wrap: break-word; }
.title { font-size: 22px; font-weight: bold; margin: 22px 0 18px; }
@@ -49,9 +54,12 @@
</style>
</head>
<body>
{# Libellé FR du type de contrepartie (couche de rendu, pas le Domain — ERP-208). #}
{% set counterpartyLabels = { 'CLIENT': 'Client', 'FOURNISSEUR': 'Fournisseur', 'AUTRE': 'Autre' } %}
<table class="header">
<tr>
<td>
<td class="h-left">
{% if logoSrc %}
<div class="logo"><img src="{{ logoSrc }}" alt="LPC LIOT"></div>
{% endif %}
@@ -59,12 +67,16 @@
<div class="company-line">Email : lpc.contacts@lpc-liot.fr</div>
<div class="company-line">RCS Châtellerault B 339 505 612</div>
</td>
{# Cartouche tiers (ERP-208) : nom du client / fournisseur / « autre ». #}
{# Cartouche tiers (ERP-208) : type (libellé) + nom du client / fournisseur /
« autre ». Conditionné sur le TYPE : un brouillon sans type n'affiche rien ;
un type sans nom (cas limite) affiche au moins le libellé. #}
<td class="h-right">
{% if ticket.counterpartyName %}
{% if ticket.counterpartyType %}
<div class="party-box">
<div class="party-label">{{ ticket.counterpartyTypeLabel }} :</div>
{{ ticket.counterpartyName }}
<div class="party-label">{{ counterpartyLabels[ticket.counterpartyType] ?? ticket.counterpartyType }} :</div>
{% if ticket.counterpartyName %}
<div class="party-name">{{ ticket.counterpartyName }}</div>
{% endif %}
</div>
{% endif %}
</td>