diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 4764b53a5c9..a24e62cde97 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -557,14 +557,17 @@ if (empty($reshook)) } } - elseif ($action == 'setdate_livraison' && $usercancreate) { - // print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; - $datelivraison = dol_mktime(0, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + elseif ($action == 'setdate_livraison' && $usercancreate) + { + //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; + $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); - $result = $object->set_date_livraison($user, $datelivraison); - if ($result < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } + $object->fetch($id); + $result = $object->set_date_livraison($user, $datedelivery); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + } } elseif ($action == 'setmode' && $usercancreate) { @@ -1681,15 +1684,14 @@ if ($action == 'create' && $usercancreate) print $form->selectDate('', 're', '', '', '', "crea_commande", 1, 1); // Always autofill date with current date print ''; - // Delivery date planed - print "