fix(logistique) : bon de pesée — cartouche tiers + filtrage des listes contrepartie par site (ERP-208)
- 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user