diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 61193fd2ee9..092d62b8d0c 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -435,10 +435,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST */ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer) { + $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); + $outputlangs->setDefaultLang($_REQUEST['lang_id']); $propal = new Propal($db); $propal->fetch($_GET['propalid']); if ($_POST['model']) $propal->set_pdf_model($user, $_POST['model']); - propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf); + propale_pdf_create($db, $_GET['propalid'], $propal->modelpdf, $outputlangs); } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 470bc069c46..58c0a448f21 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -666,8 +666,9 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs->setDefaultLang($_REQUEST['lang_id']); $facture = new Facture($db, 0, $_GET['facid']); - $facture->set_pdf_model($user, $_POST['model']); - $result=facture_pdf_create($db, $_REQUEST['facid'], '', $_REQUEST['model'], $outputlangs); + $facture->fetch($_GET['facid']); + if ($_REQUEST['model']) $facture->set_pdf_model($user, $_REQUEST['model']); + $result=facture_pdf_create($db, $_REQUEST['facid'], '', $facture->modelpdf, $outputlangs); if ($result <= 0) { dolibarr_print_error($db,$result);