From 2eff7ee50adaacb9136dcc1a6cd7ab9c57d4d5bb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 30 May 2006 15:22:01 +0000 Subject: [PATCH] =?UTF-8?q?D=E9but=20ajout=20bon=20de=20livraison?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/expedition/fiche.php | 4 ++-- htdocs/livraison/livraison.class.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 8d7ab7e8ef8..b0bc197b5e0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -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) diff --git a/htdocs/livraison/livraison.class.php b/htdocs/livraison/livraison.class.php index 45d7f3313c0..790fb04af62 100644 --- a/htdocs/livraison/livraison.class.php +++ b/htdocs/livraison/livraison.class.php @@ -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)