// Positionne ref commande client if ($_POST['action'] == 'setrefcustomer' && $user->rights->commande->creer) { $commande = new Commande($db); $commande->fetch($_GET['id']); $commande->set_ref_client($user, $_POST['ref_customer']); } if ($_POST['action'] == 'setdatedelivery' && $user->rights->commande->creer) { //print "x ".$_POST['liv_month'].", ".$_POST['liv_day'].", ".$_POST['liv_year']; $datelivraison=dol_mktime(0, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year']); $commande = new Commande($db); $commande->fetch($_GET['id']); $result=$commande->set_date_livraison($user,$datelivraison); if ($result < 0) { $mesg='<div class="error">'.$commande->error.'</div>'; } } if ($_POST['action'] == 'setdeliveryaddress' && $user->rights->commande->creer) { $commande = new Commande($db); $commande->fetch($_GET['id']); $commande->set_adresse_livraison($user,$_POST['delivery_address_id']); } if ($_POST['action'] == 'setmode' && $user->rights->commande->creer) {