diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 12cfd81ac65..cc6f20e5454 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -70,12 +70,7 @@ if ($action == 'add' && $user->rights->deplacement->creer) { $error=0; - $dated=dol_mktime(12, 0, 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); - - $object->date = $dated; + $object->date = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); $object->km = $_POST["km"]; $object->type = $_POST["type"]; $object->socid = $_POST["socid"]; @@ -105,7 +100,7 @@ if ($action == 'add' && $user->rights->deplacement->creer) if ($id > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=".$id); + Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -132,14 +127,12 @@ if ($action == 'update' && $user->rights->deplacement->creer) { $result = $object->fetch($id); - $object->date = dol_mktime(12, 0 , 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); - $object->km = $_POST["km"]; - $object->type = $_POST["type"]; - $object->fk_user = $_POST["fk_user"]; - $object->socid = $_POST["socid"]; + $object->date = dol_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $object->km = $_POST["km"]; + $object->type = $_POST["type"]; + $object->fk_user = $_POST["fk_user"]; + $object->socid = $_POST["socid"]; + $result = $object->update($user); if ($result > 0) @@ -187,10 +180,7 @@ if ($action == 'create') dol_htmloutput_errors($mesg); - $datec = dol_mktime(12, 0, 0, - $_POST["remonth"], - $_POST["reday"], - $_POST["reyear"]); + $datec = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); print '