Dbut ajout bon de livraison

This commit is contained in:
Regis Houssin 2006-05-30 15:22:01 +00:00
parent 8b4cddef5a
commit 2eff7ee50a
2 changed files with 7 additions and 4 deletions

View File

@ -101,12 +101,12 @@ if ($_POST["action"] == 'add')
/*
* Génère un bon de livraison
*/
if ($_POST["action"] == 'create_delivery' && $conf->livraison->enabled && $user->rights->expedition->livraison->creer)
if ($_GET["action"] == 'create_delivery' && $conf->livraison->enabled && $user->rights->expedition->livraison->creer)
{
$expedition = new Expedition($db);
$expedition->fetch($_GET["id"]);
$result = $expedition->create_delivery($user);
Header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result->id);
Header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result);
}
if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes' && $user->rights->expedition->valider)

View File

@ -126,10 +126,13 @@ class Livraison
/*
*
*/
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_statut = 2 WHERE rowid=".$this->commande_id;
if (! $this->db->query($sql))
if (!$conf->expedition->enabled)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."commande SET fk_statut = 2 WHERE rowid=".$this->commande_id;
if (! $this->db->query($sql))
{
$error++;
}
}
if ($error==0)