Ajout sélection du modèle pdf à la création
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 = 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>';
|
||||||
@ -2135,8 +2145,8 @@ else
|
|||||||
$filename=sanitize_string($fac->ref);
|
$filename=sanitize_string($fac->ref);
|
||||||
$filedir=$conf->facture->dir_output . '/' . sanitize_string($fac->ref);
|
$filedir=$conf->facture->dir_output . '/' . sanitize_string($fac->ref);
|
||||||
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$fac->id;
|
||||||
$genallowed=($fac->statut == 1 && $user->rights->facture->creer);
|
$genallowed=($fac->statut == 1 && $user->rights->facture->creer);
|
||||||
$delallowed=$user->rights->facture->supprimer;
|
$delallowed=$user->rights->facture->supprimer;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
|||||||
@ -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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user