Qual: Uniformisation du code des modules generation propales et facture
This commit is contained in:
parent
27715e025b
commit
ed539e0a11
@ -37,7 +37,10 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
|
||||
\brief Classe permettant de générer les factures au modèle Bernique
|
||||
*/
|
||||
|
||||
class pdf_bernique extends ModelePDFFactures {
|
||||
class pdf_bernique extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
function pdf_bernique($db=0)
|
||||
{
|
||||
@ -57,9 +60,9 @@ class pdf_bernique extends ModelePDFFactures {
|
||||
$this->page_hauteur = 297;
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
/**
|
||||
@ -69,7 +72,7 @@ class pdf_bernique extends ModelePDFFactures {
|
||||
*/
|
||||
function write_pdf_file($fac,$outputlangs='')
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
@ -205,7 +208,7 @@ class pdf_bernique extends ModelePDFFactures {
|
||||
|
||||
$pdf->SetFont('Arial','',9);
|
||||
$pdf->SetXY(10, 260);
|
||||
$pdf->MultiCell(190, 5, $langs->trans("IntracommunityVATNumber").' : '.MAIN_INFO_TVAINTRA, 0, 'J');
|
||||
$pdf->MultiCell(190, 5, $langs->trans("IntracommunityVATNumber").' : '.$this->emetteur->tva_intra, 0, 'J');
|
||||
$pdf->MultiCell(190, 5, $langs->trans("PrettyLittleSentence"), 0, 'J');
|
||||
|
||||
$pdf->Close();
|
||||
@ -400,10 +403,10 @@ class pdf_bernique extends ModelePDFFactures {
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(40, 5, $langs->trans('PhoneNumber').' : '.FAC_PDF_TEL);
|
||||
}
|
||||
if (defined("MAIN_INFO_SIREN"))
|
||||
if ($this->emetteur->profid1)
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(40, 5, "SIREN : ".MAIN_INFO_SIREN);
|
||||
$pdf->MultiCell(40, 5, "SIREN : ".$this->emetteur->profid1);
|
||||
}
|
||||
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
|
||||
@ -35,7 +35,10 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
|
||||
\brief Classe permettant de générer les factures au modèle Bulot
|
||||
*/
|
||||
|
||||
class pdf_bulot extends ModelePDFFactures {
|
||||
class pdf_bulot extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
@ -58,9 +61,9 @@ class pdf_bulot extends ModelePDFFactures {
|
||||
$this->page_hauteur = 297;
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +73,7 @@ class pdf_bulot extends ModelePDFFactures {
|
||||
*/
|
||||
function write_pdf_file($fac,$outputlangs='')
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if ($conf->facture->dir_output)
|
||||
{
|
||||
@ -409,10 +412,10 @@ class pdf_bulot extends ModelePDFFactures {
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(40, 5, $langs->trans('PhoneNumber').' : '.FAC_PDF_TEL);
|
||||
}
|
||||
if (defined("MAIN_INFO_SIREN"))
|
||||
if ($this->emetteur->profid1)
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(40, 5, "SIREN : ".MAIN_INFO_SIREN);
|
||||
$pdf->MultiCell(40, 5, "SIREN : ".$this->emetteur->profid1);
|
||||
}
|
||||
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
|
||||
@ -39,6 +39,8 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
|
||||
class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/**
|
||||
\brief Constructeur
|
||||
@ -75,9 +77,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
@ -97,26 +99,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
* \brief Fonction générant la facture sur le disque
|
||||
* \param fac Objet facture à générer (ou id si ancienne methode)
|
||||
* \return int 1=ok, 0=ko
|
||||
* \remarks Variables utilisées
|
||||
* \remarks MAIN_INFO_SOCIETE_NOM
|
||||
* \remarks MAIN_INFO_SOCIETE_ADRESSE
|
||||
* \remarks MAIN_INFO_SOCIETE_CP
|
||||
* \remarks MAIN_INFO_SOCIETE_VILLE
|
||||
* \remarks MAIN_INFO_SOCIETE_TEL
|
||||
* \remarks MAIN_INFO_SOCIETE_FAX
|
||||
* \remarks MAIN_INFO_SOCIETE_WEB
|
||||
* \remarks MAIN_INFO_SOCIETE_LOGO
|
||||
* \remarks MAIN_INFO_SIRET
|
||||
* \remarks MAIN_INFO_SIREN
|
||||
* \remarks MAIN_INFO_RCS
|
||||
* \remarks MAIN_INFO_CAPITAL
|
||||
* \remarks MAIN_INFO_TVAINTRA
|
||||
* \remarks FACTURE_CHQ_NUMBER
|
||||
* \remarks FACTURE_RIB_NUMBER
|
||||
*/
|
||||
function write_pdf_file($fac,$outputlangs='')
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
$outputlangs->load("main");
|
||||
@ -382,10 +368,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
{
|
||||
$pdf->SetXY($this->marge_gauche, 227);
|
||||
$pdf->SetFont('Arial','B',8);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$mysoc->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedToShort').' '.$this->emetteur->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
|
||||
$pdf->SetXY($this->marge_gauche, 231);
|
||||
$pdf->SetFont('Arial','',8);
|
||||
$pdf->MultiCell(80, 3, $mysoc->adresse_full, 0, 'L', 0);
|
||||
$pdf->MultiCell(80, 3, $this->emetteur->adresse_full, 0, 'L', 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -761,7 +747,7 @@ class pdf_crabe extends ModelePDFFactures
|
||||
*/
|
||||
function _pagehead(&$pdf, $fac, $showadress=1, $outputlangs)
|
||||
{
|
||||
global $conf,$mysoc;
|
||||
global $conf;
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
@ -776,8 +762,8 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->societe->dir_logos.'/'.$mysoc->logo;
|
||||
if ($mysoc->logo)
|
||||
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
@ -842,28 +828,28 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
|
||||
else $pdf->MultiCell(80, 4, $mysoc->nom, 0, 'L');
|
||||
else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
|
||||
|
||||
// Caractéristiques emetteur
|
||||
$carac_emetteur = '';
|
||||
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
|
||||
else {
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$mysoc->adresse;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$mysoc->cp.' '.$mysoc->ville;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->adresse;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->cp.' '.$this->emetteur->ville;
|
||||
}
|
||||
$carac_emetteur .= "\n";
|
||||
// Tel
|
||||
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".FAC_PDF_TEL;
|
||||
elseif ($mysoc->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$mysoc->tel;
|
||||
elseif ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$this->emetteur->tel;
|
||||
// Fax
|
||||
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".FAC_PDF_FAX;
|
||||
elseif ($mysoc->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$mysoc->fax;
|
||||
elseif ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$this->emetteur->fax;
|
||||
// EMail
|
||||
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".FAC_PDF_MEL;
|
||||
elseif ($mysoc->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$mysoc->email;
|
||||
elseif ($this->emetteur->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$this->emetteur->email;
|
||||
// Web
|
||||
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".FAC_PDF_WWW;
|
||||
elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$mysoc->url;
|
||||
elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$this->emetteur->url;
|
||||
|
||||
$pdf->SetFont('Arial','',9);
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+8);
|
||||
@ -907,36 +893,36 @@ class pdf_crabe extends ModelePDFFactures
|
||||
|
||||
// Premiere ligne d'info réglementaires
|
||||
$ligne1="";
|
||||
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
|
||||
if ($this->emetteur->forme_juridique_code)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
|
||||
$ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($this->emetteur->forme_juridique_code);
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_CAPITAL)
|
||||
if ($this->emetteur->capital)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$outputlangs->trans("Currency".$conf->monnaie);
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$this->emetteur->capital)." ".$outputlangs->trans("Currency".$conf->monnaie);
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_SIRET)
|
||||
if ($this->emetteur->profid2)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET;
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId2",$this->emetteur->pays_code).": ".$this->emetteur->profid2;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR'))
|
||||
if ($this->emetteur->profid1 && (! $this->emetteur->profid2 || $this->emetteur->pays_code != 'FR'))
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->pays_code).": ".$this->emetteur->profid1;
|
||||
}
|
||||
|
||||
// Deuxieme ligne d'info réglementaires
|
||||
$ligne2="";
|
||||
if ($conf->global->MAIN_INFO_APE)
|
||||
if ($this->emetteur->profid3)
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->pays_code).": ".$this->emetteur->profid3;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_RCS)
|
||||
if ($this->emetteur->profid4)
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->pays_code).": ".$this->emetteur->profid4;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_TVAINTRA != '')
|
||||
if ($this->emetteur->tva_intra != '')
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$this->emetteur->tva_intra;
|
||||
}
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
|
||||
@ -37,7 +37,10 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
|
||||
\brief Classe permettant de générer les factures au modèle Huitre
|
||||
*/
|
||||
|
||||
class pdf_huitre extends ModelePDFFactures {
|
||||
class pdf_huitre extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
@ -61,9 +64,9 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
$this->page_hauteur = 297;
|
||||
$this->format = array($this->page_largeur,$this->page_hauteur);
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +77,7 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
*/
|
||||
function write_pdf_file($fac,$outputlangs='')
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
$outputlangs->load("main");
|
||||
@ -469,7 +472,7 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
*/
|
||||
function _pagehead(&$pdf, $fac)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
global $langs,$conf;
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("companies");
|
||||
@ -480,8 +483,8 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
$ligne = 2;
|
||||
|
||||
// Logo
|
||||
$logo=$conf->societe->dir_logos.'/'.$mysoc->logo;
|
||||
if ($mysoc->logo)
|
||||
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
@ -598,13 +601,13 @@ class pdf_huitre extends ModelePDFFactures {
|
||||
$ligne=$langs->trans('LimitedLiabilityCompanyCapital').' '. MAIN_INFO_CAPITAL." ".$langs->trans("Currency".$conf->monnaie);
|
||||
}
|
||||
if (defined('MAIN_INFO_SIREN') && MAIN_INFO_SIREN) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".MAIN_INFO_SIREN;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->pays_code).": ".MAIN_INFO_SIREN;
|
||||
}
|
||||
if (defined('MAIN_INFO_SIRET') && MAIN_INFO_SIRET) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".MAIN_INFO_SIRET;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->pays_code).": ".MAIN_INFO_SIRET;
|
||||
}
|
||||
if (defined('MAIN_INFO_RCS') && MAIN_INFO_RCS) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".MAIN_INFO_RCS;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->pays_code).": ".MAIN_INFO_RCS;
|
||||
}
|
||||
if ($ligne) {
|
||||
$pdf->SetY(-$footy);
|
||||
|
||||
@ -40,6 +40,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
|
||||
|
||||
class pdf_oursin extends ModelePDFFactures
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
var $marges=array("g"=>10,"h"=>5,"d"=>10,"b"=>15);
|
||||
|
||||
|
||||
@ -72,9 +73,9 @@ class pdf_oursin extends ModelePDFFactures
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +100,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
*/
|
||||
function write_pdf_file($fac,$outputlangs='')
|
||||
{
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
$outputlangs->load("main");
|
||||
@ -593,7 +594,7 @@ class pdf_oursin extends ModelePDFFactures
|
||||
*/
|
||||
function _pagehead(&$pdf, $fac)
|
||||
{
|
||||
global $langs,$conf,$mysoc;
|
||||
global $langs,$conf;
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("propal");
|
||||
@ -605,8 +606,8 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$pdf->SetXY($this->marges['g'],6);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->societe->dir_logos.'/'.$mysoc->logo;
|
||||
if ($mysoc->logo)
|
||||
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
@ -678,11 +679,11 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$pdf->SetFont('Arial','',7);
|
||||
if (defined("MAIN_INFO_SIREN") && MAIN_INFO_SIREN)
|
||||
{
|
||||
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId1",$this->code_pays).": ".MAIN_INFO_SIREN);
|
||||
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId1",$this->pays_code).": ".MAIN_INFO_SIREN);
|
||||
}
|
||||
elseif (defined("MAIN_INFO_SIRET") && MAIN_INFO_SIRET)
|
||||
{
|
||||
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIRET);
|
||||
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId2",$this->pays_code).": ".MAIN_INFO_SIRET);
|
||||
}
|
||||
|
||||
|
||||
@ -771,13 +772,13 @@ class pdf_oursin extends ModelePDFFactures
|
||||
$ligne=$langs->trans('LimitedLiabilityCompanyCapital').' '. MAIN_INFO_CAPITAL." ".$langs->trans("Currency".$conf->monnaie);
|
||||
}
|
||||
if (defined('MAIN_INFO_SIREN') && MAIN_INFO_SIREN) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".MAIN_INFO_SIREN;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->pays_code).": ".MAIN_INFO_SIREN;
|
||||
}
|
||||
if (defined('MAIN_INFO_SIRET') && MAIN_INFO_SIRET) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".MAIN_INFO_SIRET;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->pays_code).": ".MAIN_INFO_SIRET;
|
||||
}
|
||||
if (defined('MAIN_INFO_RCS') && MAIN_INFO_RCS) {
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".MAIN_INFO_RCS;
|
||||
$ligne.=($ligne?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->pays_code).": ".MAIN_INFO_RCS;
|
||||
}
|
||||
if ($ligne) {
|
||||
$pdf->SetY(-$footy);
|
||||
|
||||
@ -39,6 +39,8 @@ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||
|
||||
class pdf_propale_azur extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/**
|
||||
\brief Constructeur
|
||||
@ -75,9 +77,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||
$this->franchise=1;
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
@ -96,24 +98,10 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
\brief Fonction générant la propale sur le disque
|
||||
\param propale Objet propal
|
||||
\return int 1=ok, 0=ko
|
||||
\remarks Variables utilisées
|
||||
\remarks MAIN_INFO_SOCIETE_NOM
|
||||
\remarks MAIN_INFO_SOCIETE_ADRESSE
|
||||
\remarks MAIN_INFO_SOCIETE_CP
|
||||
\remarks MAIN_INFO_SOCIETE_VILLE
|
||||
\remarks MAIN_INFO_SOCIETE_TEL
|
||||
\remarks MAIN_INFO_SOCIETE_FAX
|
||||
\remarks MAIN_INFO_SOCIETE_WEB
|
||||
\remarks MAIN_INFO_SOCIETE_LOGO
|
||||
\remarks MAIN_INFO_SIRET
|
||||
\remarks MAIN_INFO_SIREN
|
||||
\remarks MAIN_INFO_RCS
|
||||
\remarks MAIN_INFO_CAPITAL
|
||||
\remarks MAIN_INFO_TVAINTRA
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
$outputlangs->load("main");
|
||||
@ -666,7 +654,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
*/
|
||||
function _pagehead(&$pdf, $propale, $showadress=1, $outputlangs)
|
||||
{
|
||||
global $conf,$mysoc;
|
||||
global $conf;
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
@ -681,8 +669,8 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetXY($this->marge_gauche,$posy);
|
||||
|
||||
// Logo
|
||||
$logo=$conf->societe->dir_logos.'/'.$mysoc->logo;
|
||||
if ($mysoc->logo)
|
||||
$logo=$conf->societe->dir_logos.'/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
@ -747,28 +735,28 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) $pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
|
||||
else $pdf->MultiCell(80, 4, $mysoc->nom, 0, 'L');
|
||||
else $pdf->MultiCell(80, 4, $this->emetteur->nom, 0, 'L');
|
||||
|
||||
// Caractéristiques emetteur
|
||||
$carac_emetteur = '';
|
||||
if (defined("FAC_PDF_ADRESSE") && FAC_PDF_ADRESSE) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).FAC_PDF_ADRESSE;
|
||||
else {
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$mysoc->adresse;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$mysoc->cp.' '.$mysoc->ville;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->adresse;
|
||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$this->emetteur->cp.' '.$this->emetteur->ville;
|
||||
}
|
||||
$carac_emetteur .= "\n";
|
||||
// Tel
|
||||
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".FAC_PDF_TEL;
|
||||
elseif ($mysoc->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$mysoc->tel;
|
||||
elseif ($this->emetteur->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$this->emetteur->tel;
|
||||
// Fax
|
||||
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".FAC_PDF_FAX;
|
||||
elseif ($mysoc->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$mysoc->fax;
|
||||
elseif ($this->emetteur->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$this->emetteur->fax;
|
||||
// EMail
|
||||
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".FAC_PDF_MEL;
|
||||
elseif ($mysoc->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$mysoc->email;
|
||||
elseif ($this->emetteur->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$this->emetteur->email;
|
||||
// Web
|
||||
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".FAC_PDF_WWW;
|
||||
elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$mysoc->url;
|
||||
elseif ($this->emetteur->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$this->emetteur->url;
|
||||
|
||||
$pdf->SetFont('Arial','',9);
|
||||
$pdf->SetXY($this->marge_gauche+2,$posy+8);
|
||||
@ -807,42 +795,40 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
*/
|
||||
function _pagefoot(&$pdf,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$html=new Form($this->db);
|
||||
|
||||
// Premiere ligne d'info réglementaires
|
||||
$ligne1="";
|
||||
if ($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE)
|
||||
if ($this->emetteur->forme_juridique_code)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
|
||||
$ligne1.=($ligne1?" - ":"").$html->forme_juridique_name($this->emetteur->forme_juridique_code);
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_CAPITAL)
|
||||
if ($this->emetteur->capital)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$outputlangs->trans("Currency".$conf->monnaie);
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$this->emetteur->capital)." ".$outputlangs->trans("Currency".$conf->monnaie);
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_SIRET)
|
||||
if ($this->emetteur->profid2)
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET;
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId2",$this->emetteur->pays_code).": ".$this->emetteur->profid2;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_SIREN && (! $conf->global->MAIN_INFO_SIRET || $this->emetteur->code_pays != 'FR'))
|
||||
if ($this->emetteur->profid1 && (! $this->emetteur->profid2 || $this->emetteur->pays_code != 'FR'))
|
||||
{
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
|
||||
$ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->pays_code).": ".$this->emetteur->profid1;
|
||||
}
|
||||
|
||||
// Deuxieme ligne d'info réglementaires
|
||||
$ligne2="";
|
||||
if ($conf->global->MAIN_INFO_APE)
|
||||
if ($this->emetteur->profid3)
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->pays_code).": ".$this->emetteur->profid3;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_RCS)
|
||||
if ($this->emetteur->profid4)
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->pays_code).": ".$this->emetteur->profid4;
|
||||
}
|
||||
if ($conf->global->MAIN_INFO_TVAINTRA != '')
|
||||
if ($this->emetteur->tva_intra != '')
|
||||
{
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
|
||||
$ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$this->emetteur->tva_intra;
|
||||
}
|
||||
|
||||
$pdf->SetFont('Arial','',8);
|
||||
|
||||
@ -36,11 +36,13 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php")
|
||||
|
||||
class pdf_propale_bleu extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
*/
|
||||
function pdf_propale_bleu($db=0)
|
||||
function pdf_propale_bleu($db=0)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->name = "bleu";
|
||||
@ -54,9 +56,9 @@ class pdf_propale_bleu extends ModelePDFPropales
|
||||
|
||||
$this->error = "";
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
}
|
||||
|
||||
|
||||
@ -74,20 +76,6 @@ class pdf_propale_bleu extends ModelePDFPropales
|
||||
\brief Fonction générant la propale sur le disque
|
||||
\param propale Objet propal
|
||||
\return int 1=ok, 0=ko
|
||||
\remarks Variables utilisées
|
||||
\remarks MAIN_INFO_SOCIETE_NOM
|
||||
\remarks MAIN_INFO_SOCIETE_ADRESSE
|
||||
\remarks MAIN_INFO_SOCIETE_CP
|
||||
\remarks MAIN_INFO_SOCIETE_VILLE
|
||||
\remarks MAIN_INFO_SOCIETE_TEL
|
||||
\remarks MAIN_INFO_SOCIETE_FAX
|
||||
\remarks MAIN_INFO_SOCIETE_WEB
|
||||
\remarks MAIN_INFO_SOCIETE_LOGO
|
||||
\remarks MAIN_INFO_SIRET
|
||||
\remarks MAIN_INFO_SIREN
|
||||
\remarks MAIN_INFO_RCS
|
||||
\remarks MAIN_INFO_CAPITAL
|
||||
\remarks MAIN_INFO_TVAINTRA
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
{
|
||||
@ -279,63 +267,63 @@ class pdf_propale_bleu extends ModelePDFPropales
|
||||
|
||||
}
|
||||
|
||||
function _pagehead(&$pdf, $propale)
|
||||
{
|
||||
global $langs;
|
||||
$pdf->SetXY(10,5);
|
||||
if (defined("FAC_PDF_INTITULE"))
|
||||
function _pagehead(&$pdf, $propale)
|
||||
{
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->SetFont('Times','B',14);
|
||||
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
|
||||
global $langs;
|
||||
$pdf->SetXY(10,5);
|
||||
if (defined("FAC_PDF_INTITULE"))
|
||||
{
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->SetFont('Times','B',14);
|
||||
$pdf->MultiCell(76, 8, FAC_PDF_INTITULE, 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(70,70,170);
|
||||
if (defined("FAC_PDF_ADRESSE"))
|
||||
{
|
||||
$pdf->SetFont('Times','',12);
|
||||
$pdf->MultiCell(76, 5, FAC_PDF_ADRESSE);
|
||||
}
|
||||
if (defined("FAC_PDF_TEL"))
|
||||
{
|
||||
$pdf->SetFont('Times','',10);
|
||||
$pdf->MultiCell(76, 5, $langs->trans("Phone")." : ".FAC_PDF_TEL);
|
||||
}
|
||||
if ($this->emetteur->profid1)
|
||||
{
|
||||
$pdf->SetFont('Times','',10);
|
||||
$pdf->MultiCell(76, 5, "SIREN : ".$this->emetteur->profid1);
|
||||
}
|
||||
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
{
|
||||
$pdf->SetXY(100,5);
|
||||
$pdf->SetFont('Times','B',14);
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->MultiCell(100, 10, FAC_PDF_INTITULE2, '' , 'R');
|
||||
}
|
||||
/*
|
||||
* Adresse Client
|
||||
*/
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Courier','B',12);
|
||||
$propale->fetch_client();
|
||||
$pdf->SetXY(102,42);
|
||||
$pdf->MultiCell(96,5, $propale->client->nom);
|
||||
$pdf->SetFont('Courier','B',11);
|
||||
$pdf->SetXY(102,47);
|
||||
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
|
||||
$pdf->rect(100, 40, 100, 40);
|
||||
|
||||
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Courier','B',12);
|
||||
$pdf->Text(11, 88, "Date : " . strftime("%d %b %Y", $propale->date));
|
||||
$pdf->Text(11, 94, "Proposition commerciale : ".$propale->ref);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(70,70,170);
|
||||
if (defined("FAC_PDF_ADRESSE"))
|
||||
{
|
||||
$pdf->SetFont('Times','',12);
|
||||
$pdf->MultiCell(76, 5, FAC_PDF_ADRESSE);
|
||||
}
|
||||
if (defined("FAC_PDF_TEL"))
|
||||
{
|
||||
$pdf->SetFont('Times','',10);
|
||||
$pdf->MultiCell(76, 5, $langs->trans("Phone")." : ".FAC_PDF_TEL);
|
||||
}
|
||||
if (defined("MAIN_INFO_SIREN"))
|
||||
{
|
||||
$pdf->SetFont('Times','',10);
|
||||
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
|
||||
}
|
||||
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
{
|
||||
$pdf->SetXY(100,5);
|
||||
$pdf->SetFont('Times','B',14);
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->MultiCell(100, 10, FAC_PDF_INTITULE2, '' , 'R');
|
||||
}
|
||||
/*
|
||||
* Adresse Client
|
||||
*/
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Courier','B',12);
|
||||
$propale->fetch_client();
|
||||
$pdf->SetXY(102,42);
|
||||
$pdf->MultiCell(96,5, $propale->client->nom);
|
||||
$pdf->SetFont('Courier','B',11);
|
||||
$pdf->SetXY(102,47);
|
||||
$pdf->MultiCell(96,5, $propale->client->adresse . "\n" . $propale->client->cp . " " . $propale->client->ville);
|
||||
$pdf->rect(100, 40, 100, 40);
|
||||
|
||||
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Courier','B',12);
|
||||
$pdf->Text(11, 88, "Date : " . strftime("%d %b %Y", $propale->date));
|
||||
$pdf->Text(11, 94, "Proposition commerciale : ".$propale->ref);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -36,12 +36,16 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php")
|
||||
|
||||
class pdf_propale_jaune extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
*/
|
||||
function pdf_propale_jaune($db=0)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "jaune";
|
||||
$this->description = "Modèle de proposition Jaune";
|
||||
@ -54,9 +58,9 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
|
||||
$this->error = "";
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +80,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
|
||||
@ -39,12 +39,16 @@ require_once(DOL_DOCUMENT_ROOT."/includes/modules/propale/modules_propale.php");
|
||||
|
||||
class pdf_propale_rouge extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
*/
|
||||
function pdf_propale_rouge($db=0)
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
*/
|
||||
function pdf_propale_rouge($db=0)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "rouge";
|
||||
$this->description = "Modèle de propale simple";
|
||||
@ -57,9 +61,9 @@ class pdf_propale_rouge extends ModelePDFPropales
|
||||
|
||||
$this->error = "";
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +83,7 @@ class pdf_propale_rouge extends ModelePDFPropales
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
|
||||
@ -37,12 +37,16 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php")
|
||||
|
||||
class pdf_propale_vert extends ModelePDFPropales
|
||||
{
|
||||
var $emetteur; // Objet societe qui emet
|
||||
|
||||
|
||||
/** \brief Constructeur
|
||||
\param db handler accès base de donnée
|
||||
*/
|
||||
function pdf_propale_vert($db=0)
|
||||
{
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "vert";
|
||||
$this->description = "Affichage de la remise par produit";
|
||||
@ -55,9 +59,9 @@ class pdf_propale_vert extends ModelePDFPropales
|
||||
|
||||
$this->error = "";
|
||||
|
||||
// Recupere code pays de l'emmetteur
|
||||
$this->emetteur->code_pays=$mysoc->pays_code;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +81,7 @@ class pdf_propale_vert extends ModelePDFPropales
|
||||
*/
|
||||
function write_pdf_file($propale,$outputlangs='')
|
||||
{
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if ($conf->propal->dir_output)
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user