diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 85e550770bb..b023da8b137 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -510,7 +510,7 @@ else if ($conf->livraison->enabled && $expedition->statut == 1 && $user->rights->expedition->livraison->creer) { - print ''.$langs->trans("DeliveryOrder").''; + print ''.$langs->trans("DeliveryOrder").''; } print ''.$langs->trans('BuildPDF').''; diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 02ea73b62af..8170cbdc3cb 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -33,6 +33,7 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/livraison/mods/modules_livraison.php"); +require_once(DOL_DOCUMENT_ROOT."/expedition/expedition.class.php"); if (!$conf->expedition->enabled && $conf->stock->enabled) { @@ -140,6 +141,16 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post } } +/* + * Génère un bon de livraison + */ +if ($_POST["action"] == 'create_delivery' && $user->rights->expedition->livraison->creer) +{ + $expedition = new Expedition($db); + $expedition->fetch($_GET["id"]); + $expedition->create_delivery($user); +} + /* *