Ajout divers champs pour facture/devis

This commit is contained in:
Jean-Christophe Engel 2025-03-23 18:27:47 +01:00
parent 950a6b8b2c
commit aff20099aa
7 changed files with 93 additions and 28 deletions

View file

@ -30,7 +30,10 @@ class Facture
'archivee',
'moyen_paiement',
'contenu',
'total'
'total',
'nom_contact',
'numero_commande',
'reference_acheteur'
];
public $types = [
@ -65,7 +68,7 @@ class Facture
if(!is_array($data) && null !== $data){
$datas[$k] = trim($data);
}
if ($datas[$k] === '' && $k != 'numero')
if ($datas[$k] === '' && ! in_array($k, ['numero', 'nom_contact', 'numero_commande', 'reference_acheteur']))
{
throw new UserException("La valeur de $k est vide");
}