diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index d2d34cd523a..d5c40c17ad0 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -47,11 +47,21 @@ if ($action == 'print_file' && $user->rights->printing->read) { { $printerfound++; - $subdir=(GETPOST('printer', 'alpha')=='expedition'?'sending':''); + $subdir=''; $module = GETPOST('printer', 'alpha'); - if ($module =='commande_fournisseur') { - $module = 'fournisseur'; - $subdir = 'commande'; + switch ($module ) + { + case 'livraison' : + $subdir = 'receipt'; + $module = 'expedition'; + break; + case 'expedition' : + $subdir = 'sending'; + break; + case 'commande_fournisseur' : + $module = 'fournisseur'; + $subdir = 'commande'; + break; } try { $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index e4c5b9a84b5..bfc67880a96 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -310,7 +310,7 @@ class FormFile $param.= 'entity='.(!empty($object->entity)?$object->entity:$conf->entity); $printer=0; - if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport'))) // The direct print feature is implemented only for such elements + if (in_array($modulepart,array('facture','supplier_proposal','propal','proposal','order','commande','expedition', 'commande_fournisseur', 'expensereport','livraison'))) // The direct print feature is implemented only for such elements { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled))?true:false; } diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 44eb12299d9..2fee2e100ba 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -292,6 +292,7 @@ elseif ($action == 'remove_file') } */ +include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; /* * View