Fix: le modle pdf tait effac en base lorsqu'on cliquait sur le bouton "Gnrer

le PDF"
This commit is contained in:
Regis Houssin 2006-06-27 11:07:26 +00:00
parent ca57c08aa3
commit 03d068478a
2 changed files with 4 additions and 3 deletions

View File

@ -65,6 +65,7 @@ class Commande extends CommonObject
var $date_livraison; // Date livraison souhaitée
var $remise_percent;
var $remise_absolue;
var $modelpdf;
var $lines = array();

View File

@ -414,9 +414,9 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
// Sauvegarde le dernier modèle choisi pour générer un document
$commande = new Commande($db, 0, $_REQUEST['id']);
$commande->fetch($_REQUEST['id']);
if ($_REQUEST['model'])
if ($_REQUEST['modelpdf'])
{
$modelpdf = $_REQUEST['model'];
$modelpdf = $_REQUEST['modelpdf'];
}
else
{
@ -429,7 +429,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, $_REQUEST['id'],$_REQUEST['model'],$outputlangs);
$result=commande_pdf_create($db, $_REQUEST['id'],$modelpdf,$outputlangs);
if ($result <= 0)
{
dolibarr_print_error($db,$result);