fix(logistique) : bon de pesée — cartouche tiers + filtrage des listes contrepartie par site (ERP-208)
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 2m1s
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m38s

- PDF : cartouche bordé en haut à droite avec le type (Client/Fournisseur/Autre) et le nom du tiers (getCounterpartyName + getCounterpartyTypeLabel).
- Écran ticket : listes Client/Fournisseur filtrées sur le site courant (param siteId[]) et rechargées au changement de site ; reset du tiers sélectionné s'il sort du périmètre du nouveau site.
This commit is contained in:
2026-06-25 14:09:33 +02:00
parent fdd4394e99
commit 527e47d822
11 changed files with 712 additions and 19 deletions
@@ -458,6 +458,35 @@ class WeighingTicket implements TimestampableInterface, BlamableInterface
return $this;
}
/**
* Nom du tiers à afficher (cartouche du bon de pesée PDF, ERP-208) : raison
* sociale du client/fournisseur ou libellé libre selon le type de contrepartie
* (RG-5.03). Null si aucune contrepartie cohérente (brouillon).
*/
public function getCounterpartyName(): ?string
{
return match ($this->counterpartyType) {
'CLIENT' => $this->client?->getCompanyName(),
'FOURNISSEUR' => $this->supplier?->getCompanyName(),
'AUTRE' => $this->otherLabel,
default => null,
};
}
/**
* Libellé FR du type de contrepartie (cartouche du bon de pesée PDF, ERP-208),
* affiché au-dessus du nom. Null si aucun type défini (brouillon).
*/
public function getCounterpartyTypeLabel(): ?string
{
return match ($this->counterpartyType) {
'CLIENT' => 'Client',
'FOURNISSEUR' => 'Fournisseur',
'AUTRE' => 'Autre',
default => null,
};
}
public function getImmatriculation(): ?string
{
return $this->immatriculation;