$db->commit(); Header("Location: fiche.php?id=" . $object->id); exit; } else { $db->rollback(); $mesg = '<div class="error">' . $object->error . '</div>'; $_GET["commande_id"] = $_POST["commande_id"]; $action = 'create'; } } /* * Build a receiving receipt */ if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer) { $object->fetch($id); $result = $object->create_delivery($user); if ($result > 0) { Header("Location: " . DOL_URL_ROOT . '/livraison/fiche.php?id=' . $result); exit; } else { $mesg = $object->error; } } if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition->valider) { $object->fetch($id); $object->fetch_thirdparty(); $result = $object->valid($user); // Define output language $outputlangs = $langs; $newlang = ''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && !empty($_REQUEST['lang_id'])) {