Ajout slection du modle pdf la cration
This commit is contained in:
parent
bb0acbcfc6
commit
f8bb4c1e55
@ -147,7 +147,7 @@ if ($_POST['action'] == 'confirm_valid' && $_POST['confirm'] == 'yes' && $user->
|
||||
$outputlangs = new Translate(DOL_DOCUMENT_ROOT ."/langs");
|
||||
$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 = $_POST['note'];
|
||||
$facture->ref_client = $_POST['ref_client'];
|
||||
$facture->modelpdf = $_POST['modelpdf'];
|
||||
|
||||
if ($_POST['fac_rec'] > 0)
|
||||
{
|
||||
@ -896,6 +897,15 @@ if ($_GET['action'] == 'create')
|
||||
$html->select_projects($societe_id, $projetid, 'projetid');
|
||||
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
|
||||
print '<tr>';
|
||||
@ -2135,8 +2145,8 @@ else
|
||||
$filename=sanitize_string($fac->ref);
|
||||
$filedir=$conf->facture->dir_output . '/' . sanitize_string($fac->ref);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
||||
$genallowed=($fac->statut == 1 && $user->rights->facture->creer);
|
||||
$delallowed=$user->rights->facture->supprimer;
|
||||
$genallowed=($fac->statut == 1 && $user->rights->facture->creer);
|
||||
$delallowed=$user->rights->facture->supprimer;
|
||||
|
||||
$var=true;
|
||||
|
||||
|
||||
@ -70,6 +70,7 @@ class Facture extends CommonObject
|
||||
var $cond_reglement_code;
|
||||
var $mode_reglement_id;
|
||||
var $mode_reglement_code;
|
||||
var $modelpdf;
|
||||
|
||||
// Pour board
|
||||
var $nbtodo;
|
||||
@ -165,7 +166,7 @@ class Facture extends CommonObject
|
||||
$sql.= ' note_public,';
|
||||
$sql.= ' ref_client,';
|
||||
$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.= "'$number','$socid', now(), '$totalht', '".$this->remise_absolue."'";
|
||||
$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->cond_reglement_id;
|
||||
$sql.= ",".$this->mode_reglement_id;
|
||||
$sql.= ','.$this->db->idate($datelim).")";
|
||||
$sql.= ",".$this->db->idate($datelim).", '".$this->modelpdf."')";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user