diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index f15e51b1f1e..3871a98b97c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -424,7 +424,7 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } - $result=commande_pdf_create($db, $commande->id,$commande->modelpdf;,$outputlangs); + $result=commande_pdf_create($db, $commande->id,$commande->modelpdf,$outputlangs); if ($result <= 0) { dolibarr_print_error($db,$result); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7fa0705c223..bc9cbc256e3 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -690,12 +690,18 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post { $facture = new Facture($db, 0, $_GET['facid']); $facture->fetch($_GET['facid']); - if ($_REQUEST['modelpdf']) $facture->set_pdf_model($user, $_REQUEST['modelpdf']); + + if ($_REQUEST['modelpdf']) + { + $facture->set_pdf_model($user, $_REQUEST['modelpdf']); + } + if ($_REQUEST['lang_id']) { $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } + $result=facture_pdf_create($db, $facture->id, '', $facture->modelpdf, $outputlangs); if ($result <= 0) {