From f0f45b70daae536aa65e3b19d40d230bdcf56b68 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sun, 30 Dec 2012 10:24:20 +0100 Subject: [PATCH] Fix: Supplier is mandatory into adding invoice suppliers --- htdocs/fourn/facture/fiche.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6fcbc3779ba..7cf02e2f0da 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -230,6 +230,13 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) $datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']); $datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']); + if (! GETPOST('socid','int')<1) + { + $mesg='
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'
'; + $action='create'; + $error++; + } + if ($datefacture == '') { $mesg='
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'
';