Merge pull request #562 from simnandez/3.3
Fix: Supplier is mandatory into adding invoice suppliers
This commit is contained in:
commit
df43d477fc
@ -198,6 +198,15 @@ else if ($action == 'add' && $user->rights->commande->creer)
|
|||||||
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
||||||
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'),GETPOST('liv_day'),GETPOST('liv_year'));
|
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'),GETPOST('liv_day'),GETPOST('liv_year'));
|
||||||
|
|
||||||
|
if ($datecommande == '')
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Date')).'</div>';
|
||||||
|
$action='create';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
$object->socid=$socid;
|
$object->socid=$socid;
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
@ -393,6 +402,7 @@ else if ($action == 'add' && $user->rights->commande->creer)
|
|||||||
if (! $mesg) $mesg='<div class="error">'.$object->error.'</div>';
|
if (! $mesg) $mesg='<div class="error">'.$object->error.'</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else if ($action == 'classifybilled' && $user->rights->commande->creer)
|
else if ($action == 'classifybilled' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -230,6 +230,13 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer)
|
|||||||
$datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
|
$datefacture=dol_mktime(12,0,0,$_POST['remonth'],$_POST['reday'],$_POST['reyear']);
|
||||||
$datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
|
$datedue=dol_mktime(12,0,0,$_POST['echmonth'],$_POST['echday'],$_POST['echyear']);
|
||||||
|
|
||||||
|
if (GETPOST('socid','int')<1)
|
||||||
|
{
|
||||||
|
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('Supplier')).'</div>';
|
||||||
|
$action='create';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
if ($datefacture == '')
|
if ($datefacture == '')
|
||||||
{
|
{
|
||||||
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>';
|
$mesg='<div class="error">'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'</div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user