Dbut ajout bon de livraison
This commit is contained in:
parent
8b4cddef5a
commit
2eff7ee50a
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user