Ajout sélection du modèle pdf à la création

This commit is contained in:
Regis Houssin 2006-06-27 11:40:14 +00:00
parent bb0acbcfc6
commit f8bb4c1e55
2 changed files with 16 additions and 5 deletions

View File

@ -147,7 +147,7 @@ if ($_POST['action'] == 'confirm_valid' && $_POST['confirm'] == 'yes' && $user->
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs"); $outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
facture_pdf_create($db, $fac->id, '', $_REQUEST['model'], $outputlangs); facture_pdf_create($db, $fac->id, '', $fac->modelpdf, $outputlangs);
} }
} }
@ -185,6 +185,7 @@ if ($_POST['action'] == 'add')
$facture->note_public = $_POST['note_public']; $facture->note_public = $_POST['note_public'];
$facture->note = $_POST['note']; $facture->note = $_POST['note'];
$facture->ref_client = $_POST['ref_client']; $facture->ref_client = $_POST['ref_client'];
$facture->modelpdf = $_POST['modelpdf'];
if ($_POST['fac_rec'] > 0) if ($_POST['fac_rec'] > 0)
{ {
@ -897,6 +898,15 @@ if ($_GET['action'] == 'create')
print '</td></tr>'; print '</td></tr>';
} }
print '<tr><td>'.$langs->trans("Model").'</td>';
print '<td>';
// pdf
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
$model=new ModelePDFFactures();
$liste=$model->liste_modeles($db);
$html->select_array("modelpdf",$liste,$conf->global->FACTURE_ADDON_PDF);
print "</td></tr>";
// Note publique // Note publique
print '<tr>'; print '<tr>';
print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>'; print '<td class="border" valign="top">'.$langs->trans('NotePublic').'</td>';

View File

@ -70,6 +70,7 @@ class Facture extends CommonObject
var $cond_reglement_code; var $cond_reglement_code;
var $mode_reglement_id; var $mode_reglement_id;
var $mode_reglement_code; var $mode_reglement_code;
var $modelpdf;
// Pour board // Pour board
var $nbtodo; var $nbtodo;
@ -165,7 +166,7 @@ class Facture extends CommonObject
$sql.= ' note_public,'; $sql.= ' note_public,';
$sql.= ' ref_client,'; $sql.= ' ref_client,';
$sql.= ' fk_user_author, fk_projet,'; $sql.= ' fk_user_author, fk_projet,';
$sql.= ' fk_cond_reglement, fk_mode_reglement, date_lim_reglement) '; $sql.= ' fk_cond_reglement, fk_mode_reglement, date_lim_reglement, model_pdf) ';
$sql.= " VALUES ("; $sql.= " VALUES (";
$sql.= "'$number','$socid', now(), '$totalht', '".$this->remise_absolue."'"; $sql.= "'$number','$socid', now(), '$totalht', '".$this->remise_absolue."'";
$sql.= ",'".$this->remise_percent."', ".$this->db->idate($this->date); $sql.= ",'".$this->remise_percent."', ".$this->db->idate($this->date);
@ -176,7 +177,7 @@ class Facture extends CommonObject
$sql.= ",".($this->projetid?$this->projetid:"null"); $sql.= ",".($this->projetid?$this->projetid:"null");
$sql.= ','.$this->cond_reglement_id; $sql.= ','.$this->cond_reglement_id;
$sql.= ",".$this->mode_reglement_id; $sql.= ",".$this->mode_reglement_id;
$sql.= ','.$this->db->idate($datelim).")"; $sql.= ",".$this->db->idate($datelim).", '".$this->modelpdf."')";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)