Merge pull request #11424 from OPEN-DSI/issue-fourn-commande-card-makeorder
NEW The order method in purchase order is now mandatory when registering the order
This commit is contained in:
commit
d405a58999
@ -902,6 +902,16 @@ $result = $object->updateline(
|
||||
}
|
||||
}
|
||||
|
||||
// Force mandatory order method
|
||||
if ($action == 'commande') {
|
||||
$methodecommande = GETPOST('methodecommande');
|
||||
|
||||
if ($methodecommande <= 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors');
|
||||
$action = 'makeorder';
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fournisseur->commande->commander)
|
||||
{
|
||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||
@ -2537,13 +2547,14 @@ elseif (! empty($object->id))
|
||||
print load_fiche_titre($langs->trans("ToOrder"), '', '');
|
||||
print '<table class="noborder centpercent">';
|
||||
//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("OrderDate").'</td><td>';
|
||||
$date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||
if (empty($date_com)) $date_com=dol_now();
|
||||
print $form->selectDate($date_com, '', 1, 1, '', "commande", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
|
||||
// Force mandatory order method
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("OrderMode").'</td><td>';
|
||||
$formorder->selectInputMethod(GETPOST('methodecommande'), "methodecommande", 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user