Amélioration contrôles saisie facture
This commit is contained in:
parent
6e2ee31670
commit
f63f3b6ecd
2 changed files with 52 additions and 39 deletions
|
|
@ -144,10 +144,13 @@ class Facture
|
|||
unset($datas[$k]['prix']);
|
||||
continue;
|
||||
}
|
||||
elseif (empty($r['prix']))
|
||||
elseif (! is_numeric($r['prix']) && empty($r['prix']))
|
||||
{
|
||||
$datas[$k]['prix'] = 0;
|
||||
}
|
||||
elseif (empty($r['designation'])) {
|
||||
throw new UserException("Une au moins des désignations est absente.");
|
||||
}
|
||||
|
||||
if (!is_int($r['prix']))
|
||||
{
|
||||
|
|
@ -157,7 +160,7 @@ class Facture
|
|||
$total += $r['prix'];
|
||||
}
|
||||
|
||||
if($fac && !$total)
|
||||
if ($fac && count($datas['contenu']) == 0)
|
||||
{
|
||||
throw new UserException("Toutes les désignations/prix sont vides.");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue