Skip to content
Snippets Groups Projects
Commit b3291d1e authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Logo ne s'affiche pas sur model oursin

parent a4e86139
No related branches found
No related tags found
No related merge requests found
...@@ -49,16 +49,18 @@ class pdf_oursin extends ModelePDFFactures ...@@ -49,16 +49,18 @@ class pdf_oursin extends ModelePDFFactures
*/ */
function pdf_oursin($db) function pdf_oursin($db)
{ {
global $langs; global $conf,$langs;
$langs->load("main"); $langs->load("main");
$langs->load("bills"); $langs->load("bills");
$langs->load("products"); $langs->load("products");
$this->db = $db; $this->db = $db;
$this->name = "oursin";
$this->description = $langs->trans('PDFOursinDescription'); $this->description = $langs->trans('PDFOursinDescription');
// Dimension page pour format A4 // Dimension page pour format A4
$this->type = 'pdf';
$this->page_largeur = 210; $this->page_largeur = 210;
$this->page_hauteur = 297; $this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur); $this->format = array($this->page_largeur,$this->page_hauteur);
...@@ -67,24 +69,23 @@ class pdf_oursin extends ModelePDFFactures ...@@ -67,24 +69,23 @@ class pdf_oursin extends ModelePDFFactures
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
$this->option_modereg = 1; // Gere choix mode rglement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER $this->option_modereg = 1; // Gere choix mode rglement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
$this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE $this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE
$this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1; $this->franchise=1;
// Recupere code pays // Recupere code pays de l'emmetteur
$this->code_pays=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays"; $sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE rowid = ".MAIN_INFO_SOCIETE_PAYS; $sql .= " WHERE rowid = '".$conf->global->MAIN_INFO_SOCIETE_PAYS."'";
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) { if ($result) {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
if ($obj->code) $this->code_pays=$obj->code; if ($obj->code) $this->emetteur->code_pays=$obj->code;
} }
else { else {
dolibarr_print_error($this->db); dolibarr_print_error($this->db);
} }
$this->db->free($result); $this->db->free($result);
} }
...@@ -109,7 +110,7 @@ class pdf_oursin extends ModelePDFFactures ...@@ -109,7 +110,7 @@ class pdf_oursin extends ModelePDFFactures
*/ */
function write_pdf_file($facid) function write_pdf_file($facid)
{ {
global $user,$langs,$conf; global $user,$langs,$conf,$mysoc;
$langs->load("main"); $langs->load("main");
$langs->load("bills"); $langs->load("bills");
...@@ -136,7 +137,7 @@ class pdf_oursin extends ModelePDFFactures ...@@ -136,7 +137,7 @@ class pdf_oursin extends ModelePDFFactures
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation facture vierge // Initialisation facture vierge
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();
...@@ -318,6 +319,8 @@ class pdf_oursin extends ModelePDFFactures ...@@ -318,6 +319,8 @@ class pdf_oursin extends ModelePDFFactures
/* /*
* Conditions de rglements * Conditions de rglements
*/ */
if ($fac->cond_reglement_code)
{
$pdf->SetFont('Arial','B',10); $pdf->SetFont('Arial','B',10);
$pdf->SetXY($this->marges['g'], 217); $pdf->SetXY($this->marges['g'], 217);
$titre = $langs->trans("PaymentConditions").':'; $titre = $langs->trans("PaymentConditions").':';
...@@ -325,7 +328,7 @@ class pdf_oursin extends ModelePDFFactures ...@@ -325,7 +328,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetFont('Arial','',10); $pdf->SetFont('Arial','',10);
$pdf->SetXY($this->marges['g']+44, 217); $pdf->SetXY($this->marges['g']+44, 217);
$pdf->MultiCell(80, 5, $fac->cond_reglement_facture,0,'L'); $pdf->MultiCell(80, 5, $fac->cond_reglement_facture,0,'L');
}
/* /*
* Pied de page * Pied de page
...@@ -573,7 +576,7 @@ class pdf_oursin extends ModelePDFFactures ...@@ -573,7 +576,7 @@ class pdf_oursin extends ModelePDFFactures
*/ */
function _pagehead(&$pdf, $fac) function _pagehead(&$pdf, $fac)
{ {
global $langs,$conf; global $langs,$conf,$mysoc;
$langs->load("main"); $langs->load("main");
$langs->load("bills"); $langs->load("bills");
$langs->load("propal"); $langs->load("propal");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment