Modif gestion marges sur modele propales

This commit is contained in:
Laurent Destailleur 2005-11-04 01:07:33 +00:00
parent 0612e02648
commit 09c4f7bb93
13 changed files with 233 additions and 168 deletions

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -42,6 +41,11 @@ class pdf_bernique extends ModelePDFFactures {
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle pour les factures avec plusieurs taux de tva, inclus aussi le numéro de TVA Intracommunautaire"; $this->description = "Modèle pour les factures avec plusieurs taux de tva, inclus aussi le numéro de TVA Intracommunautaire";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
} }
function write_pdf_file($facid) function write_pdf_file($facid)

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/facture/pdf_bigorneau.modules.php /** \file htdocs/includes/modules/facture/pdf_bigorneau.modules.php
@ -40,6 +39,11 @@ class pdf_bigorneau extends ModelePDFFactures {
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle de facture sans boite info réglement"; $this->description = "Modèle de facture sans boite info réglement";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
} }
function write_pdf_file($facid) function write_pdf_file($facid)

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/facture/pdf_bulot.modules.php /** \file htdocs/includes/modules/facture/pdf_bulot.modules.php
@ -43,6 +42,11 @@ class pdf_bulot extends ModelePDFFactures {
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle de facture avec remise et infos réglement"; $this->description = "Modèle de facture avec remise et infos réglement";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
} }

View File

@ -50,7 +50,11 @@ class pdf_crabe extends ModelePDFFactures
$this->db = $db; $this->db = $db;
$this->name = "crabe"; $this->name = "crabe";
$this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)"; $this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)";
$this->format="A4";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
@ -135,7 +139,7 @@ class pdf_crabe 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();
@ -146,7 +150,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname); $pdf->SetAuthor($user->fullname);
$pdf->SetMargins(10, 10, 10); $pdf->SetMargins(10, 8, 10); // Top, Bottom, Left
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);
$this->_pagehead($pdf, $fac); $this->_pagehead($pdf, $fac);
@ -345,7 +349,7 @@ class pdf_crabe extends ModelePDFFactures
/* /*
* Pied de page * Pied de page
*/ */
$this->_pagefoot($pdf, $fac); $this->_pagefoot($pdf);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
@ -646,36 +650,38 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(10,6); $posy=10; // La marge Top est de 10, on commence donc a 10
$pdf->SetXY(10,$posy);
// Logo // Logo
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO)
{ {
if (file_exists(FAC_PDF_LOGO)) if (is_readable(FAC_PDF_LOGO))
{ {
$pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24); $pdf->Image(FAC_PDF_LOGO, 10, $posy, 0, 24);
} }
else else
{ {
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(80, 3, $langs->trans("ErrorLogoFileNotFound",FAC_PDF_LOGO), 0, 'L'); $pdf->MultiCell(100, 3, $langs->trans("ErrorLogoFileNotFound",FAC_PDF_LOGO), 0, 'L');
$pdf->MultiCell(80, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L'); $pdf->MultiCell(100, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L');
} }
} }
else if (defined("FAC_PDF_INTITULE")) else if (defined("FAC_PDF_INTITULE"))
{ {
$pdf->MultiCell(80, 6, FAC_PDF_INTITULE, 0, 'L'); $pdf->MultiCell(100, 4, FAC_PDF_INTITULE, 0, 'L');
} }
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,5); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 10, $langs->trans("Bill")." ".$fac->ref, '' , 'R'); $pdf->MultiCell(100, 4, $langs->trans("Bill")." ".$fac->ref, '' , 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',12);
$pdf->SetXY(100,11); $pdf->SetXY(100,$posy+6);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 10, $langs->trans("Date")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R');
// Emetteur // Emetteur
$posy=42; $posy=42;
@ -764,11 +770,10 @@ class pdf_crabe extends ModelePDFFactures
} }
/* /*
* \brief Affiche le pied de page de la facture * \brief Affiche le pied de page
* \param pdf objet PDF * \param pdf objet PDF
* \param fac objet facture
*/ */
function _pagefoot(&$pdf, $fac) function _pagefoot(&$pdf)
{ {
global $langs, $conf; global $langs, $conf;
$langs->load("main"); $langs->load("main");
@ -777,62 +782,64 @@ class pdf_crabe extends ModelePDFFactures
$html=new Form($this->db); $html=new Form($this->db);
$footy=14;
$pdf->SetY(-$footy);
$pdf->SetDrawColor(224,224,224);
$pdf->line(10, 282, 200, 282);
$footy=13;
$pdf->SetFont('Arial','',8);
// Premiere ligne d'info réglementaires // Premiere ligne d'info réglementaires
$ligne=""; $ligne1="";
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE) if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
{ {
$ligne.=($ligne?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); $ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
} }
if ($conf->global->MAIN_INFO_CAPITAL) if ($conf->global->MAIN_INFO_CAPITAL)
{ {
$ligne.=($ligne?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie); $ligne1.=($ligne1?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie);
} }
if ($conf->global->MAIN_INFO_SIRET) if ($conf->global->MAIN_INFO_SIRET)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET;
} }
if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR')) if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR'))
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
} }
if ($conf->global->MAIN_INFO_APE) if ($conf->global->MAIN_INFO_APE)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
}
if ($ligne)
{
$pdf->SetXY(8,-$footy);
$pdf->MultiCell(200, 2, $ligne, 0, 'C', 0);
} }
// Deuxieme ligne d'info réglementaires // Deuxieme ligne d'info réglementaires
$ligne=""; $ligne2="";
if ($conf->global->MAIN_INFO_RCS) if ($conf->global->MAIN_INFO_RCS)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS; $ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
} }
if ($conf->global->MAIN_INFO_TVAINTRA != '') if ($conf->global->MAIN_INFO_TVAINTRA != '')
{ {
$ligne.=($ligne?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA; $ligne2.=($ligne2?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
} }
if ($ligne) $pdf->SetFont('Arial','',8);
$pdf->SetDrawColor(224,224,224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
$posy=11 + ($ligne1?3:0) + ($ligne2?3:0);
$pdf->SetY(-$posy);
$pdf->line(10, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
$posy--;
if ($ligne1)
{ {
$footy-=3; $pdf->SetXY(8,-$posy);
$pdf->SetXY(8,-$footy); $pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0);
$pdf->MultiCell(200, 2, $ligne , 0, 'C', 0);
} }
$pdf->SetXY(-20,-$footy); if ($ligne2)
{
$posy-=3;
$pdf->SetXY(8,-$posy);
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
}
$pdf->SetXY(-20,-$posy);
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); $pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
} }

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -45,6 +44,11 @@ class pdf_huitre extends ModelePDFFactures {
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle de facture avec remise et infos réglement"; $this->description = "Modèle de facture avec remise et infos réglement";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
} }
function write_pdf_file($facid) function write_pdf_file($facid)

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -51,6 +50,12 @@ class pdf_oursin extends ModelePDFFactures
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle de facture complet (basé sur crabe, gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, les remises, le nom du projet, la reference propal, logo...)"; $this->description = "Modèle de facture complet (basé sur crabe, gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, les remises, le nom du projet, la reference propal, logo...)";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$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 règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER $this->option_modereg = 1; // Gere choix mode règlement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER

View File

@ -39,6 +39,11 @@ class pdf_tourteau extends ModelePDFFactures {
{ {
$this->db = $db; $this->db = $db;
$this->description = "Modèle de facture sans remise"; $this->description = "Modèle de facture sans remise";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
} }
function write_pdf_file($facid) function write_pdf_file($facid)

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/propale/pdf_propale_adytek.modules.php /** \file htdocs/includes/modules/propale/pdf_propale_adytek.modules.php
@ -44,6 +43,12 @@ class pdf_propale_adytek extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "Adytek"; $this->name = "Adytek";
$this->description = "Modèle de proposition Adytek"; $this->description = "Modèle de proposition Adytek";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = ""; $this->error = "";
} }
@ -96,7 +101,7 @@ class pdf_propale_adytek extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->SetTitle($fac->ref); $pdf->SetTitle($fac->ref);

View File

@ -50,7 +50,11 @@ class pdf_propale_azur extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "azur"; $this->name = "azur";
$this->description = "Modèle de propositions commerciales complet (logo...)"; $this->description = "Modèle de propositions commerciales complet (logo...)";
$this->format="A4";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
@ -143,7 +147,7 @@ class pdf_propale_azur extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
// Initialisation propale vierge // Initialisation propale vierge
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();
@ -154,7 +158,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname); $pdf->SetAuthor($user->fullname);
$pdf->SetMargins(10, 10, 10); $pdf->SetMargins(10, 8, 10);
$pdf->SetAutoPageBreak(1,0); $pdf->SetAutoPageBreak(1,0);
$this->_pagehead($pdf, $prop); $this->_pagehead($pdf, $prop);
@ -356,7 +360,7 @@ class pdf_propale_azur extends ModelePDFPropales
/* /*
* Pied de page * Pied de page
*/ */
$this->_pagefoot($pdf, $prop); $this->_pagefoot($pdf);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
@ -562,36 +566,38 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(10,6); $posy=10; // La marge est de 10, on commence donc a 10
$pdf->SetXY(10,$posy);
// Logo // Logo
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO) if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO)
{ {
if (file_exists(FAC_PDF_LOGO)) if (file_exists(FAC_PDF_LOGO))
{ {
$pdf->Image(FAC_PDF_LOGO, 10, 5, 0, 24); $pdf->Image(FAC_PDF_LOGO, 10, $posy, 0, 24);
} }
else else
{ {
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(80, 3, $langs->trans("ErrorLogoFileNotFound",FAC_PDF_LOGO), 0, 'L'); $pdf->MultiCell(100, 3, $langs->trans("ErrorLogoFileNotFound",FAC_PDF_LOGO), 0, 'L');
$pdf->MultiCell(80, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L'); $pdf->MultiCell(100, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L');
} }
} }
else if (defined("FAC_PDF_INTITULE")) else if (defined("FAC_PDF_INTITULE"))
{ {
$pdf->MultiCell(80, 6, FAC_PDF_INTITULE, 0, 'L'); $pdf->MultiCell(100, 4, FAC_PDF_INTITULE, 0, 'L');
} }
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,5); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 10, $langs->trans("Proposal")." ".$prop->ref, '' , 'R'); $pdf->MultiCell(100, 4, $langs->trans("Proposal")." ".$prop->ref, '' , 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',12);
$pdf->SetXY(100,11); $pdf->SetXY(100,$posy+6);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 10, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($prop->date,"%d %b %Y"), '', 'R');
// Emetteur // Emetteur
$posy=42; $posy=42;
@ -681,11 +687,10 @@ class pdf_propale_azur extends ModelePDFPropales
} }
/* /*
* \brief Affiche le pied de page de la propale * \brief Affiche le pied de page
* \param pdf objet PDF * \param pdf objet PDF
* \param prop objet propale
*/ */
function _pagefoot(&$pdf, $prop) function _pagefoot(&$pdf)
{ {
global $langs, $conf; global $langs, $conf;
$langs->load("main"); $langs->load("main");
@ -694,62 +699,64 @@ class pdf_propale_azur extends ModelePDFPropales
$html=new Form($this->db); $html=new Form($this->db);
$footy=14;
$pdf->SetY(-$footy);
$pdf->SetDrawColor(224,224,224);
$pdf->line(10, 282, 200, 282);
$footy=13;
$pdf->SetFont('Arial','',8);
// Premiere ligne d'info réglementaires // Premiere ligne d'info réglementaires
$ligne=""; $ligne1="";
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE) if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
{ {
$ligne.=($ligne?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE); $ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
} }
if ($conf->global->MAIN_INFO_CAPITAL) if ($conf->global->MAIN_INFO_CAPITAL)
{ {
$ligne.=($ligne?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie); $ligne1.=($ligne1?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie);
} }
if ($conf->global->MAIN_INFO_SIRET) if ($conf->global->MAIN_INFO_SIRET)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET;
} }
if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR')) if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR'))
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
} }
if ($conf->global->MAIN_INFO_APE) if ($conf->global->MAIN_INFO_APE)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE; $ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
}
if ($ligne)
{
$pdf->SetXY(8,-$footy);
$pdf->MultiCell(200, 2, $ligne, 0, 'C', 0);
} }
// Deuxieme ligne d'info réglementaires // Deuxieme ligne d'info réglementaires
$ligne=""; $ligne2="";
if ($conf->global->MAIN_INFO_RCS) if ($conf->global->MAIN_INFO_RCS)
{ {
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS; $ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
} }
if ($conf->global->MAIN_INFO_TVAINTRA != '') if ($conf->global->MAIN_INFO_TVAINTRA != '')
{ {
$ligne.=($ligne?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA; $ligne2.=($ligne2?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
} }
if ($ligne) $pdf->SetFont('Arial','',8);
$pdf->SetDrawColor(224,224,224);
// On positionne le debut du bas de page selon nbre de lignes de ce bas de page
$posy=11 + ($ligne1?3:0) + ($ligne2?3:0);
$pdf->SetY(-$posy);
$pdf->line(10, $this->page_hauteur-$posy, 200, $this->page_hauteur-$posy);
$posy--;
if ($ligne1)
{ {
$footy-=3; $pdf->SetXY(8,-$posy);
$pdf->SetXY(8,-$footy); $pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0);
$pdf->MultiCell(200, 2, $ligne , 0, 'C', 0);
} }
$pdf->SetXY(-20,-$footy); if ($ligne2)
{
$posy-=3;
$pdf->SetXY(8,-$posy);
$pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0);
}
$pdf->SetXY(-20,-$posy);
$pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0); $pdf->MultiCell(10, 2, $pdf->PageNo().'/{nb}', 0, 'R', 0);
} }

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/propale/pdf_propale_bleu.modules.php /** \file htdocs/includes/modules/propale/pdf_propale_bleu.modules.php
@ -44,6 +43,12 @@ class pdf_propale_bleu extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "bleu"; $this->name = "bleu";
$this->description = "Modèle de propale sans remise."; $this->description = "Modèle de propale sans remise.";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = ""; $this->error = "";
} }
@ -96,7 +101,7 @@ class pdf_propale_bleu extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/propale/pdf_propale_jaune.modules.php /** \file htdocs/includes/modules/propale/pdf_propale_jaune.modules.php
@ -44,6 +43,12 @@ class pdf_propale_jaune extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "jaune"; $this->name = "jaune";
$this->description = "Modèle de proposition Jaune"; $this->description = "Modèle de proposition Jaune";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = ""; $this->error = "";
} }
@ -95,7 +100,7 @@ class pdf_propale_jaune extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->SetTitle($propale->ref); $pdf->SetTitle($propale->ref);

View File

@ -19,7 +19,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** /**
@ -46,6 +45,12 @@ class pdf_propale_rouge extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "rouge"; $this->name = "rouge";
$this->description = "Modèle de propale par défaut"; $this->description = "Modèle de propale par défaut";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = ""; $this->error = "";
} }
@ -98,7 +103,7 @@ class pdf_propale_rouge extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();

View File

@ -20,7 +20,6 @@
* *
* $Id$ * $Id$
* $Source$ * $Source$
*
*/ */
/** \file htdocs/includes/modules/propale/pdf_propale_vert.modules.php /** \file htdocs/includes/modules/propale/pdf_propale_vert.modules.php
@ -45,6 +44,12 @@ class pdf_propale_vert extends ModelePDFPropales
$this->db = $db; $this->db = $db;
$this->name = "vert"; $this->name = "vert";
$this->description = "Affichage de la remise par produit"; $this->description = "Affichage de la remise par produit";
// Dimension page pour format A4
$this->page_largeur = 210;
$this->page_hauteur = 297;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->error = ""; $this->error = "";
} }
@ -96,7 +101,7 @@ class pdf_propale_vert extends ModelePDFPropales
if (file_exists($dir)) if (file_exists($dir))
{ {
$pdf=new FPDF('P','mm','A4'); $pdf=new FPDF('P','mm',$this->format);
$pdf->Open(); $pdf->Open();
$pdf->AddPage(); $pdf->AddPage();