Les modeles crabe et azur sont multilangues

This commit is contained in:
Laurent Destailleur 2006-06-17 22:30:55 +00:00
parent e958289b05
commit ac8c73555c
15 changed files with 279 additions and 281 deletions

View File

@ -354,8 +354,7 @@ while (($file = readdir($handle))!==false)
// Info // Info
$htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name; $htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name;
$htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$module->page_largeur; $htmltooltip.='<br><b>'.$langs->trans("Height").'/'.$langs->trans("Width").'</b>: '.$module->page_hauteur.'/'.$module->page_largeur;
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$module->page_hauteur;
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo); $htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg); $htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);

View File

@ -61,9 +61,9 @@ if ($_GET["action"] == 'specimen')
$classname = "pdf_propale_".$modele; $classname = "pdf_propale_".$modele;
require_once($dir.$file); require_once($dir.$file);
$obj = new $classname($db); $module = new $classname($db);
if ($obj->write_pdf_file($propal) > 0) if ($module->write_pdf_file($propal) > 0)
{ {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf"); header("Location: ".DOL_URL_ROOT."/document.php?modulepart=propal&file=SPECIMEN.pdf");
return; return;
@ -292,8 +292,8 @@ while (($file = readdir($handle))!==false)
print "$name"; print "$name";
print "</td>\n <td>\n"; print "</td>\n <td>\n";
require_once($dir.$file); require_once($dir.$file);
$obj = new $classname($db); $module = new $classname($db);
print $obj->description; print $module->description;
print '</td>'; print '</td>';
// Activé // Activé
@ -334,12 +334,11 @@ while (($file = readdir($handle))!==false)
// Info // Info
$htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name; $htmltooltip = '<b>'.$langs->trans("Name").'</b>: '.$module->name;
$htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='<br><b>'.$langs->trans("Type").'</b>: '.($module->type?$module->type:$langs->trans("Unknown"));
$htmltooltip.='<br><b>'.$langs->trans("Width").'</b>: '.$obj->page_largeur; $htmltooltip.='<br><b>'.$langs->trans("Height").'/'.$langs->trans("Width").'</b>: '.$module->page_hauteur.'/'.$module->page_largeur;
$htmltooltip.='<br><b>'.$langs->trans("Height").'</b>: '.$obj->page_hauteur;
$htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':'; $htmltooltip.='<br><br>'.$langs->trans("FeaturesSupported").':';
$htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($obj->option_logo); $htmltooltip.='<br><b>'.$langs->trans("Logo").'</b>: '.yn($module->option_logo);
$htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($obj->option_modereg); $htmltooltip.='<br><b>'.$langs->trans("PaymentMode").'</b>: '.yn($module->option_modereg);
$htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($obj->option_condreg); $htmltooltip.='<br><b>'.$langs->trans("PaymentConditions").'</b>: '.yn($module->option_condreg);
$htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang); $htmltooltip.='<br><b>'.$langs->trans("MultiLanguage").'</b>: '.yn($module->option_multilang);
print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>'; print '<td align="center" '.$html->tooltip_properties($htmltooltip).'>';
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" alt="" title="">'.img_help(0,0).'</a>'; print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'" alt="" title="">'.img_help(0,0).'</a>';

View File

@ -114,7 +114,7 @@ if ($_GET["action"] == 'create')
print '</tr>'; print '</tr>';
// Ligne info remises tiers // Ligne info remises tiers
print '<tr><td>'.$langs->trans('Info').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client); if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount"); else print $langs->trans("CompanyHasNoRelativeDiscount");
$absolute_discount=$soc->getCurrentDiscount(); $absolute_discount=$soc->getCurrentDiscount();

View File

@ -43,6 +43,7 @@ $langs->load('companies');
$langs->load('propal'); $langs->load('propal');
$langs->load('compta'); $langs->load('compta');
$langs->load('bills'); $langs->load('bills');
$langs->load('orders');
$langs->load('products'); $langs->load('products');
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php'); if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/project.class.php');
@ -642,7 +643,7 @@ if ($_GET['propalid'] > 0)
print '</td>'; print '</td>';
if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('Edit')).'</a></td>'; if ($_GET['action'] != 'refclient' && $propal->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&amp;propalid='.$propal->id.'">'.img_edit($langs->trans('Edit')).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="5">';
if ($user->rights->propale->creer && $_GET['action'] == 'refclient') if ($user->rights->propale->creer && $_GET['action'] == 'refclient')
{ {
print '<form action="propal.php?propalid='.$propal->id.'" method="post">'; print '<form action="propal.php?propalid='.$propal->id.'" method="post">';

View File

@ -39,23 +39,24 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php")
class pdf_bernique extends ModelePDFFactures { class pdf_bernique extends ModelePDFFactures {
function pdf_bernique($db=0) function pdf_bernique($db=0)
{ {
global $langs; global $conf,$langs,$mysoc;
$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->description = $langs->trans('PDFBerniqueDescription'); $this->name = "bernique";
$this->description = $langs->trans('PDFBerniqueDescription');
// Dimension page pour format A4
$this->type = 'pdf'; // Dimension page pour format A4
$this->page_largeur = 210; $this->type = 'pdf';
$this->page_hauteur = 297; $this->page_largeur = 210;
$this->format = array($this->page_largeur,$this->page_hauteur); $this->page_hauteur = 297;
} $this->format = array($this->page_largeur,$this->page_hauteur);
}
/** /**
* \brief Fonction générant la facture sur le disque * \brief Fonction générant la facture sur le disque

View File

@ -40,23 +40,24 @@ class pdf_bulot extends ModelePDFFactures {
/** \brief Constructeur /** \brief Constructeur
\param db handler accès base de donnée \param db handler accès base de donnée
*/ */
function pdf_bulot($db) function pdf_bulot($db)
{ {
global $langs; global $conf,$langs,$mysoc;
$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->description = $langs->trans('PDFBulotDescription'); $this->name = "bulot";
$this->description = $langs->trans('PDFBulotDescription');
// Dimension page pour format A4
$this->type = 'pdf'; // Dimension page pour format A4
$this->page_largeur = 210; $this->type = 'pdf';
$this->page_hauteur = 297; $this->page_largeur = 210;
$this->format = array($this->page_largeur,$this->page_hauteur); $this->page_hauteur = 297;
} $this->format = array($this->page_largeur,$this->page_hauteur);
}
/** /**
* \brief Fonction générant la facture sur le disque * \brief Fonction générant la facture sur le disque

View File

@ -46,11 +46,10 @@ class pdf_crabe extends ModelePDFFactures
*/ */
function pdf_crabe($db) function pdf_crabe($db)
{ {
global $conf,$langs; global $conf,$langs,$mysoc;
$langs->load("main"); $langs->load("main");
$langs->load("bills"); $langs->load("bills");
$langs->load("products");
$this->db = $db; $this->db = $db;
$this->name = "crabe"; $this->name = "crabe";
@ -71,24 +70,14 @@ class pdf_crabe extends ModelePDFFactures
$this->option_modereg = 1; // Affiche mode règlement $this->option_modereg = 1; // Affiche mode règlement
$this->option_condreg = 1; // Affiche conditions règlement $this->option_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1; $this->franchise=1;
// Recupere code pays de l'emmetteur // Recupere code pays de l'emmetteur
$this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas $this->emetteur->code_pays=$mysoc->pays_code;
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays"; if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
$sql .= " WHERE rowid = '".$conf->global->MAIN_INFO_SOCIETE_PAYS."'";
$result=$this->db->query($sql);
if ($result) {
$obj = $this->db->fetch_object($result);
if ($obj->code) $this->emetteur->code_pays=$obj->code;
}
else {
dolibarr_print_error($this->db);
}
$this->db->free($result);
$this->tva=array();
// Defini position des colonnes // Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
@ -98,6 +87,7 @@ class pdf_crabe extends ModelePDFFactures
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=177; $this->postotalht=177;
$this->tva=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
} }
@ -128,6 +118,14 @@ class pdf_crabe extends ModelePDFFactures
{ {
global $user,$langs,$conf,$mysoc; global $user,$langs,$conf,$mysoc;
if (! is_object($outputlangs)) $outputlangs=$langs;
$outputlangs->load("main");
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->load("products");
$outputlangs->setPhpLang();
if ($conf->facture->dir_output) if ($conf->facture->dir_output)
{ {
// Définition de l'objet $fac (pour compatibilite ascendante) // Définition de l'objet $fac (pour compatibilite ascendante)
@ -155,7 +153,7 @@ class pdf_crabe extends ModelePDFFactures
{ {
if (create_exdir($dir) < 0) if (create_exdir($dir) < 0)
{ {
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir); $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
return 0; return 0;
} }
} }
@ -172,7 +170,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($fac->ref); $pdf->SetTitle($fac->ref);
$pdf->SetSubject($langs->trans("Bill")); $pdf->SetSubject($outputlangs->trans("Invoice"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname); $pdf->SetAuthor($user->fullname);
@ -188,7 +186,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
$this->_pagehead($pdf, $fac); $this->_pagehead($pdf, $fac, 1, $outputlangs);
// Affiches lignes // Affiches lignes
$pagenb = 1; $pagenb = 1;
@ -244,9 +242,9 @@ class pdf_crabe extends ModelePDFFactures
if ($prodser->ref) { if ($prodser->ref) {
$prefix_prodserv = ""; $prefix_prodserv = "";
if($prodser->type == 0) if($prodser->type == 0)
$prefix_prodserv = $langs->trans("Product")." "; $prefix_prodserv = $outputlangs->trans("Product")." ";
if($prodser->type == 1) if($prodser->type == 1)
$prefix_prodserv = $langs->trans("Service")." "; $prefix_prodserv = $outputlangs->trans("Service")." ";
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice; $libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
} }
@ -264,7 +262,7 @@ class pdf_crabe extends ModelePDFFactures
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) { if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
// Affichage durée si il y en a une // Affichage durée si il y en a une
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")"; $libelleproduitservice.="\n(".$outputlangs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$outputlangs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")";
} }
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page $pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
@ -308,13 +306,13 @@ class pdf_crabe extends ModelePDFFactures
if ($nexY > ($tab_top+$tab_height) && $i < ($nblignes - 1)) if ($nexY > ($tab_top+$tab_height) && $i < ($nblignes - 1))
{ {
$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY); $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
$this->_pagefoot($pdf); $this->_pagefoot($pdf,$outputlangs);
// Nouvelle page // Nouvelle page
$pdf->AddPage(); $pdf->AddPage();
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $fac, 0); $this->_pagehead($pdf, $fac, 0, $outputlangs);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 8;
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
@ -325,21 +323,21 @@ class pdf_crabe extends ModelePDFFactures
// Affiche cadre tableau // Affiche cadre tableau
if ($pagenb == 1) if ($pagenb == 1)
{ {
$this->_tableau($pdf, $tab_top, $tab_height, $nexY); $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $tab_height + 1; $bottomlasttab=$tab_top + $tab_height + 1;
} }
else else
{ {
$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY); $this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $tab_height + 1; $bottomlasttab=$tab_top_newpage + $tab_height + 1;
} }
$deja_regle = $fac->getSommePaiement(); $deja_regle = $fac->getSommePaiement();
$posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab); $posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab, $outputlangs);
if ($deja_regle) { if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy); $this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
} }
/* /*
@ -350,7 +348,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->marge_gauche, 228); $pdf->SetXY($this->marge_gauche, 228);
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans("ErrorNoPaiementModeConfigured"),0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
@ -366,7 +364,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->marge_gauche, 227); $pdf->SetXY($this->marge_gauche, 227);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans('PaymentByChequeOrderedTo').' '.$account->proprio.' '.$langs->trans('SendTo').':',0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
$pdf->SetXY($this->marge_gauche, 231); $pdf->SetXY($this->marge_gauche, 231);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0); $pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
@ -375,7 +373,7 @@ class pdf_crabe extends ModelePDFFactures
{ {
$pdf->SetXY($this->marge_gauche, 227); $pdf->SetXY($this->marge_gauche, 227);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans('PaymentByChequeOrderedTo').' '.$mysoc->nom.' '.$langs->trans('SendTo').':',0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByChequeOrderedTo').' '.$mysoc->nom.' '.$outputlangs->trans('SendTo').':',0,'L',0);
$pdf->SetXY($this->marge_gauche, 231); $pdf->SetXY($this->marge_gauche, 231);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->MultiCell(80, 3, $mysoc->adresse_full, 0, 'L', 0); $pdf->MultiCell(80, 3, $mysoc->adresse_full, 0, 'L', 0);
@ -397,21 +395,21 @@ class pdf_crabe extends ModelePDFFactures
$cury=242; $cury=242;
$pdf->SetXY ($this->marges['g'], $cury); $pdf->SetXY ($this->marges['g'], $cury);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->trans('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
$cury+=4; $cury+=4;
$pdf->SetFont('Arial','B',6); $pdf->SetFont('Arial','B',6);
$pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 ); $pdf->line($this->marges['g']+1, $cury, $this->marges['g']+1, $cury+10 );
$pdf->SetXY ($this->marges['g'], $cury); $pdf->SetXY ($this->marges['g'], $cury);
$pdf->MultiCell(18, 3, $langs->trans("BankCode"), 0, 'C', 0); $pdf->MultiCell(18, 3, $outputlangs->trans("BankCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 ); $pdf->line($this->marges['g']+18, $cury, $this->marges['g']+18, $cury+10 );
$pdf->SetXY ($this->marges['g']+18, $cury); $pdf->SetXY ($this->marges['g']+18, $cury);
$pdf->MultiCell(18, 3, $langs->trans("DeskCode"), 0, 'C', 0); $pdf->MultiCell(18, 3, $outputlangs->trans("DeskCode"), 0, 'C', 0);
$pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 ); $pdf->line($this->marges['g']+36, $cury, $this->marges['g']+36, $cury+10 );
$pdf->SetXY ($this->marges['g']+36, $cury); $pdf->SetXY ($this->marges['g']+36, $cury);
$pdf->MultiCell(24, 3, $langs->trans("BankAccountNumber"), 0, 'C', 0); $pdf->MultiCell(24, 3, $outputlangs->trans("BankAccountNumber"), 0, 'C', 0);
$pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 ); $pdf->line($this->marges['g']+60, $cury, $this->marges['g']+60, $cury+10 );
$pdf->SetXY ($this->marges['g']+60, $cury); $pdf->SetXY ($this->marges['g']+60, $cury);
$pdf->MultiCell(13, 3, $langs->trans("BankAccountNumberKey"), 0, 'C', 0); $pdf->MultiCell(13, 3, $outputlangs->trans("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 ); $pdf->line($this->marges['g']+73, $cury, $this->marges['g']+73, $cury+10 );
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
@ -425,11 +423,11 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0); $pdf->MultiCell(13, 3, $account->cle_rib, 0, 'C', 0);
$pdf->SetXY ($this->marges['g'], $cury+12); $pdf->SetXY ($this->marges['g'], $cury+12);
$pdf->MultiCell(90, 3, $langs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->trans("Residence").' : ' . $account->domiciliation, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+22); $pdf->SetXY ($this->marges['g'], $cury+22);
$pdf->MultiCell(90, 3, $langs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->trans("IbanPrefix").' : ' . $account->iban_prefix, 0, 'L', 0);
$pdf->SetXY ($this->marges['g'], $cury+25); $pdf->SetXY ($this->marges['g'], $cury+25);
$pdf->MultiCell(90, 3, $langs->trans("BIC").' : ' . $account->bic, 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->trans("BIC").' : ' . $account->bic, 0, 'L', 0);
} }
} }
@ -441,38 +439,42 @@ class pdf_crabe extends ModelePDFFactures
{ {
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->SetXY($this->marge_gauche, 217); $pdf->SetXY($this->marge_gauche, 217);
$titre = $langs->trans("PaymentConditions").':'; $titre = $outputlangs->trans("PaymentConditions").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY(50, 217); $pdf->SetXY(50, 217);
$lib_condition_paiement=$langs->trans("PaymentCondition".$fac->cond_reglement_code)?$langs->trans("PaymentCondition".$fac->cond_reglement_code):$fac->cond_reglement; $lib_condition_paiement=$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$fac->cond_reglement_code):$fac->cond_reglement;
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
} }
/* /*
* Pied de page * Pied de page
*/ */
$this->_pagefoot($pdf); $this->_pagefoot($pdf,$outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
$pdf->Output($file); $pdf->Output($file);
$langs->setPhpLang(); // On restaure langue session
return 1; // Pas d'erreur return 1; // Pas d'erreur
} }
else else
{ {
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir); $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
$langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
} }
else else
{ {
$this->error=$langs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR"); $this->error=$outputlangs->trans("ErrorConstantNotDefined","FAC_OUTPUTDIR");
$langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
$this->error=$langs->trans("ErrorUnknown"); $this->error=$outputlangs->trans("ErrorUnknown");
$langs->setPhpLang(); // On restaure langue session
return 0; // Erreur par defaut return 0; // Erreur par defaut
} }
@ -482,12 +484,8 @@ class pdf_crabe extends ModelePDFFactures
* \param pdf objet PDF * \param pdf objet PDF
* \param fac objet facture * \param fac objet facture
*/ */
function _tableau_versements(&$pdf, $fac, $posy) function _tableau_versements(&$pdf, $fac, $posy, $outputlangs)
{ {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab3_posx = 120; $tab3_posx = 120;
$tab3_top = $posy + 8; $tab3_top = $posy + 8;
$tab3_width = 80; $tab3_width = 80;
@ -495,18 +493,18 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY ($tab3_posx, $tab3_top - 5); $pdf->SetXY ($tab3_posx, $tab3_top - 5);
$pdf->MultiCell(60, 5, $langs->trans("PaymentsAlreadyDone"), 0, 'L', 0); $pdf->MultiCell(60, 5, $outputlangs->trans("PaymentsAlreadyDone"), 0, 'L', 0);
$pdf->Rect($tab3_posx, $tab3_top-1, $tab3_width, $tab3_height); $pdf->Rect($tab3_posx, $tab3_top-1, $tab3_width, $tab3_height);
$pdf->SetXY ($tab3_posx, $tab3_top-1 ); $pdf->SetXY ($tab3_posx, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Payment"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->trans("Payment"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+21, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+21, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Amount"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->trans("Amount"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+41, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+41, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Type"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->trans("Type"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top-1 ); $pdf->SetXY ($tab3_posx+60, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Num"), 0, 'L', 0); $pdf->MultiCell(20, 4, $outputlangs->trans("Num"), 0, 'L', 0);
$sql = "SELECT ".$this->db->pdate("p.datep")."as date, pf.amount as amount, p.fk_paiement as type, p.num_paiement as num "; $sql = "SELECT ".$this->db->pdate("p.datep")."as date, pf.amount as amount, p.fk_paiement as type, p.num_paiement as num ";
$sql.= "FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."paiement_facture as pf "; $sql.= "FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."paiement_facture as pf ";
@ -561,7 +559,7 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$this->error=$langs->trans("ErrorSQL")." $sql"; $this->error=$outputlangs->trans("ErrorSQL")." $sql";
return 0; return 0;
} }
@ -574,12 +572,8 @@ class pdf_crabe extends ModelePDFFactures
* \param deja_regle Montant deja regle * \param deja_regle Montant deja regle
* \return y Position pour suite * \return y Position pour suite
*/ */
function _tableau_tot(&$pdf, $fac, $deja_regle, $posy) function _tableau_tot(&$pdf, $fac, $deja_regle, $posy, $outputlangs)
{ {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab2_top = $posy; $tab2_top = $posy;
$tab2_hl = 5; $tab2_hl = 5;
$tab2_height = $tab2_hl * 4; $tab2_height = $tab2_hl * 4;
@ -589,7 +583,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->marge_gauche, $tab2_top + 0); $pdf->SetXY($this->marge_gauche, $tab2_top + 0);
if ($this->franchise==1) if ($this->franchise==1)
{ {
$pdf->MultiCell(100, $tab2_hl, $langs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0); $pdf->MultiCell(100, $tab2_hl, $outputlangs->trans("VATIsNotUsedForInvoice"), 0, 'L', 0);
} }
// Tableau total // Tableau total
@ -598,7 +592,7 @@ class pdf_crabe extends ModelePDFFactures
// Total HT // Total HT
$pdf->SetFillColor(256,256,256); $pdf->SetFillColor(256,256,256);
$pdf->SetXY ($col1x, $tab2_top + 0); $pdf->SetXY ($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalHT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + 0); $pdf->SetXY ($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ht + $fac->remise), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ht + $fac->remise), 0, 'R', 1);
@ -607,13 +601,13 @@ class pdf_crabe extends ModelePDFFactures
if ($fac->remise > 0) if ($fac->remise > 0)
{ {
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("GlobalDiscount"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("GlobalDiscount"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl);
$pdf->MultiCell($largcol2, $tab2_hl, "-".$fac->remise_percent."%", 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, "-".$fac->remise_percent."%", 0, 'R', 1);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("WithDiscountTotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("WithDiscountTotalHT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ht), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ht), 0, 'R', 1);
@ -635,8 +629,8 @@ class pdf_crabe extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ; $tvacompl = ( (float)$tvakey < 0 ) ? " (".$outputlangs->trans("NonPercuRecuperable").")" : '' ;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * (float)$tvakey / 100 ), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * (float)$tvakey / 100 ), 0, 'R', 1);
@ -646,7 +640,7 @@ class pdf_crabe extends ModelePDFFactures
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_tva), 0, 'R', 1);
@ -658,7 +652,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc), $useborder, 'R', 1);
@ -670,7 +664,7 @@ class pdf_crabe extends ModelePDFFactures
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("AlreadyPayed"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
@ -679,7 +673,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
//$pdf->SetFont('Arial','B', 9); //$pdf->SetFont('Arial','B', 9);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("RemainderToPay"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc - $deja_regle), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($fac->total_ttc - $deja_regle), $useborder, 'R', 1);
@ -690,7 +684,7 @@ class pdf_crabe extends ModelePDFFactures
/* Ne semble pas requis par la réglementation /* Ne semble pas requis par la réglementation
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x+$largcol2, $tab2_hl, $langs->trans('DispenseMontantLettres'), 0, 'L' ); $pdf->MultiCell($col2x-$col1x+$largcol2, $tab2_hl, $outputlangs->trans('DispenseMontantLettres'), 0, 'L' );
*/ */
$index++; $index++;
return ($tab2_top + ($tab2_hl * $index)); return ($tab2_top + ($tab2_hl * $index));
@ -700,16 +694,14 @@ class pdf_crabe extends ModelePDFFactures
* \brief Affiche la grille des lignes de factures * \brief Affiche la grille des lignes de factures
* \param pdf objet PDF * \param pdf objet PDF
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{ {
global $langs,$conf; global $conf;
$langs->load("main");
$langs->load("bills");
// Montants exprimés en (en tab_top - 1) // Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$titre = $langs->trans("AmountInCurrency",$langs->trans("Currency".$conf->monnaie)); $titre = $outputlangs->trans("AmountInCurrency",$outputlangs->trans("Currency".$conf->monnaie));
$pdf->Text($this->page_largeur - $this->marge_droite - $pdf->GetStringWidth($titre), $tab_top-1, $titre); $pdf->Text($this->page_largeur - $this->marge_droite - $pdf->GetStringWidth($titre), $tab_top-1, $titre);
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
@ -722,25 +714,25 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('Arial','',10); $pdf->SetFont('Arial','',10);
$pdf->SetXY ($this->posxdesc-1, $tab_top+2); $pdf->SetXY ($this->posxdesc-1, $tab_top+2);
$pdf->MultiCell(108,2, $langs->trans("Designation"),'','L'); $pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxtva-1, $tab_top+2); $pdf->SetXY ($this->posxtva-1, $tab_top+2);
$pdf->MultiCell(12,2, $langs->trans("VAT"),'','C'); $pdf->MultiCell(12,2, $outputlangs->trans("VAT"),'','C');
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxup-1, $tab_top+2); $pdf->SetXY ($this->posxup-1, $tab_top+2);
$pdf->MultiCell(18,2, $langs->trans("PriceUHT"),'','C'); $pdf->MultiCell(18,2, $outputlangs->trans("PriceUHT"),'','C');
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxqty-1, $tab_top+2); $pdf->SetXY ($this->posxqty-1, $tab_top+2);
$pdf->MultiCell(11,2, $langs->trans("Qty"),'','C'); $pdf->MultiCell(11,2, $outputlangs->trans("Qty"),'','C');
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if ($this->atleastonediscount) if ($this->atleastonediscount)
{ {
$pdf->SetXY ($this->posxdiscount-1, $tab_top+2); $pdf->SetXY ($this->posxdiscount-1, $tab_top+2);
$pdf->MultiCell(16,2, $langs->trans("ReductionShort"),'','C'); $pdf->MultiCell(16,2, $outputlangs->trans("ReductionShort"),'','C');
} }
if ($this->atleastonediscount) if ($this->atleastonediscount)
@ -748,7 +740,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
} }
$pdf->SetXY ($this->postotalht-1, $tab_top+2); $pdf->SetXY ($this->postotalht-1, $tab_top+2);
$pdf->MultiCell(23,2, $langs->trans("TotalHT"),'','C'); $pdf->MultiCell(23,2, $outputlangs->trans("TotalHT"),'','C');
} }
@ -758,14 +750,14 @@ class pdf_crabe extends ModelePDFFactures
* \param fac Objet facture * \param fac Objet facture
* \param showadress 0=non, 1=oui * \param showadress 0=non, 1=oui
*/ */
function _pagehead(&$pdf, $fac, $showadress=1) function _pagehead(&$pdf, $fac, $showadress=1, $outputlangs)
{ {
global $langs,$conf,$mysoc; global $conf,$mysoc;
$langs->load("main"); $outputlangs->load("main");
$langs->load("bills"); $outputlangs->load("bills");
$langs->load("propal"); $outputlangs->load("propal");
$langs->load("companies"); $outputlangs->load("companies");
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
@ -786,8 +778,8 @@ class pdf_crabe extends ModelePDFFactures
{ {
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(100, 3, $langs->trans("ErrorLogoFileNotFound",$logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->trans("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->trans("ErrorGoToModuleSetup"), 0, 'L');
} }
} }
else if (defined("FAC_PDF_INTITULE")) else if (defined("FAC_PDF_INTITULE"))
@ -798,18 +790,26 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Invoice")." ".$fac->ref, '' , 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("Invoice"), '' , 'R');
$pdf->SetFont('Arial','',12);
$pdf->SetFont('Arial','B',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $fac->ref, '', 'R');
$pdf->SetFont('Arial','B',12);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("DateInvoice")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("DateInvoice")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R');
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("DateEcheance")." : " . dolibarr_print_date($fac->date_lim_reglement,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("DateEcheance")." : " . dolibarr_print_date($fac->date_lim_reglement,"%d %b %Y"), '', 'R');
if ($showadress) if ($showadress)
{ {
@ -819,7 +819,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5); $pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $langs->trans("BillFrom").":"); $pdf->MultiCell(66,5, $outputlangs->trans("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy); $pdf->SetXY($this->marge_gauche,$posy);
@ -844,17 +844,17 @@ class pdf_crabe extends ModelePDFFactures
} }
$carac_emetteur .= "\n"; $carac_emetteur .= "\n";
// Tel // Tel
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Phone").": ".FAC_PDF_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" : '' ).$langs->trans("Phone").": ".$mysoc->tel; elseif ($mysoc->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$mysoc->tel;
// Fax // Fax
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Fax").": ".FAC_PDF_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" : '' ).$langs->trans("Fax").": ".$mysoc->fax; elseif ($mysoc->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$mysoc->fax;
// EMail // EMail
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Email").": ".FAC_PDF_MEL; 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" : '' ).$langs->trans("Email").": ".$mysoc->email; elseif ($mysoc->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$mysoc->email;
// Web // Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".FAC_PDF_WWW; 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" : '' ).$langs->trans("Web").": ".$mysoc->url; elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$mysoc->url;
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8); $pdf->SetXY($this->marge_gauche+2,$posy+8);
@ -865,7 +865,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5); $pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $langs->trans("BillTo").":"); $pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
$fac->fetch_client(); $fac->fetch_client();
// Cadre client destinataire // Cadre client destinataire
$pdf->rect(100, $posy, 100, $hautcadre); $pdf->rect(100, $posy, 100, $hautcadre);
@ -878,7 +878,7 @@ class pdf_crabe extends ModelePDFFactures
// Caractéristiques client // Caractéristiques client
$carac_client=$fac->client->adresse; $carac_client=$fac->client->adresse;
$carac_client.="\n".$fac->client->cp . " " . $fac->client->ville."\n"; $carac_client.="\n".$fac->client->cp . " " . $fac->client->ville."\n";
if ($fac->client->tva_intra) $carac_client.="\n".$langs->trans("VATIntraShort").': '.$fac->client->tva_intra; if ($fac->client->tva_intra) $carac_client.="\n".$outputlangs->trans("VATIntraShort").': '.$fac->client->tva_intra;
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8); $pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client); $pdf->MultiCell(86,4, $carac_client);
@ -890,12 +890,9 @@ class pdf_crabe extends ModelePDFFactures
* \brief Affiche le pied de page * \brief Affiche le pied de page
* \param pdf objet PDF * \param pdf objet PDF
*/ */
function _pagefoot(&$pdf) function _pagefoot(&$pdf,$outputlangs)
{ {
global $langs, $conf; global $conf;
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$html=new Form($this->db); $html=new Form($this->db);
@ -907,30 +904,30 @@ class pdf_crabe extends ModelePDFFactures
} }
if ($conf->global->MAIN_INFO_CAPITAL) if ($conf->global->MAIN_INFO_CAPITAL)
{ {
$ligne1.=($ligne1?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie); $ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$outputlangs->trans("Currency".$conf->monnaie);
} }
if ($conf->global->MAIN_INFO_SIRET) if ($conf->global->MAIN_INFO_SIRET)
{ {
$ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET; $ligne1.=($ligne1?" - ":"").$outputlangs->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'))
{ {
$ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN; $ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
} }
// Deuxieme ligne d'info réglementaires // Deuxieme ligne d'info réglementaires
$ligne2=""; $ligne2="";
if ($conf->global->MAIN_INFO_APE) if ($conf->global->MAIN_INFO_APE)
{ {
$ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE; $ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
} }
if ($conf->global->MAIN_INFO_RCS) if ($conf->global->MAIN_INFO_RCS)
{ {
$ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS; $ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
} }
if ($conf->global->MAIN_INFO_TVAINTRA != '') if ($conf->global->MAIN_INFO_TVAINTRA != '')
{ {
$ligne2.=($ligne2?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA; $ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
} }
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);

View File

@ -26,7 +26,6 @@
\brief Fichier de la classe permettant de générer les propales au modèle Azur \brief Fichier de la classe permettant de générer les propales au modèle Azur
\author Laurent Destailleur \author Laurent Destailleur
\version $Revision$ \version $Revision$
\version $Revision$
*/ */
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
@ -47,11 +46,10 @@ class pdf_propale_azur extends ModelePDFPropales
*/ */
function pdf_propale_azur($db) function pdf_propale_azur($db)
{ {
global $conf,$langs; global $conf,$langs,$mysoc;
$langs->load("main"); $langs->load("main");
$langs->load("bills"); $langs->load("bills");
$langs->load("products");
$this->db = $db; $this->db = $db;
$this->name = "azur"; $this->name = "azur";
@ -72,24 +70,14 @@ class pdf_propale_azur extends ModelePDFPropales
$this->option_modereg = 1; // Affiche mode règlement $this->option_modereg = 1; // Affiche mode règlement
$this->option_condreg = 1; // Affiche conditions règlement $this->option_condreg = 1; // Affiche conditions règlement
$this->option_codeproduitservice = 1; // Affiche code produit-service $this->option_codeproduitservice = 1; // Affiche code produit-service
$this->option_multilang = 1; // Dispo en plusieurs langues
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1; $this->franchise=1;
// Recupere code pays de l'emmetteur // Recupere code pays de l'emmetteur
$this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas $this->emetteur->code_pays=$mysoc->pays_code;
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays"; if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // Par defaut, si on trouve pas
$sql .= " WHERE rowid = '".$conf->global->MAIN_INFO_SOCIETE_PAYS."'";
$result=$this->db->query($sql);
if ($result) {
$obj = $this->db->fetch_object($result);
if ($obj->code) $this->emetteur->code_pays=$obj->code;
}
else {
dolibarr_print_error($this->db);
}
$this->db->free($result);
$this->tva=array();
// Defini position des colonnes // Defini position des colonnes
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
@ -99,19 +87,11 @@ class pdf_propale_azur extends ModelePDFPropales
$this->posxdiscount=162; $this->posxdiscount=162;
$this->postotalht=177; $this->postotalht=177;
$this->tva=array();
$this->atleastoneratenotnull=0; $this->atleastoneratenotnull=0;
$this->atleastonediscount=0; $this->atleastonediscount=0;
} }
/**
\brief Renvoi dernière erreur
\return string Dernière erreur
*/
function pdferror()
{
return $this->error;
}
/** /**
\brief Fonction générant la propale sur le disque \brief Fonction générant la propale sur le disque
\param propale Objet propal \param propale Objet propal
@ -135,6 +115,15 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
global $user,$conf,$langs,$mysoc; global $user,$conf,$langs,$mysoc;
if (! is_object($outputlangs)) $outputlangs=$langs;
$outputlangs->load("main");
$outputlangs->load("companies");
$outputlangs->load("bills");
$outputlangs->load("propal");
$outputlangs->load("products");
$outputlangs->setPhpLang();
if ($conf->propal->dir_output) if ($conf->propal->dir_output)
{ {
// Définition de l'objet $propale (pour compatibilite ascendante) // Définition de l'objet $propale (pour compatibilite ascendante)
@ -162,7 +151,7 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
if (create_exdir($dir) < 0) if (create_exdir($dir) < 0)
{ {
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir); $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
return 0; return 0;
} }
} }
@ -179,7 +168,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
$pdf->SetTitle($propale->ref); $pdf->SetTitle($propale->ref);
$pdf->SetSubject($langs->trans("Bill")); $pdf->SetSubject($outputlangs->trans("CommercialProposal"));
$pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetCreator("Dolibarr ".DOL_VERSION);
$pdf->SetAuthor($user->fullname); $pdf->SetAuthor($user->fullname);
@ -195,7 +184,7 @@ class pdf_propale_azur extends ModelePDFPropales
} }
} }
$this->_pagehead($pdf, $propale); $this->_pagehead($pdf, $propale, 1, $outputlangs);
// Affiches lignes // Affiches lignes
$pagenb = 1; $pagenb = 1;
@ -252,9 +241,9 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$prefix_prodserv = ""; $prefix_prodserv = "";
if($prodser->type == 0) if($prodser->type == 0)
$prefix_prodserv = $langs->trans("Product")." "; $prefix_prodserv = $outputlangs->trans("Product")." ";
if($prodser->type == 1) if($prodser->type == 1)
$prefix_prodserv = $langs->trans("Service")." "; $prefix_prodserv = $outputlangs->trans("Service")." ";
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice; $libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
} }
@ -272,7 +261,7 @@ class pdf_propale_azur extends ModelePDFPropales
if ($propale->lignes[$i]->date_start && $propale->lignes[$i]->date_end) if ($propale->lignes[$i]->date_start && $propale->lignes[$i]->date_end)
{ {
// Affichage durée si il y en a une // Affichage durée si il y en a une
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end).")"; $libelleproduitservice.="\n(".$outputlangs->trans("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start)." ".$outputlangs->trans("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end).")";
} }
$pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page $pdf->SetFont('Arial','', 9); // Dans boucle pour gérer multi-page
@ -316,17 +305,17 @@ class pdf_propale_azur extends ModelePDFPropales
if ($nexY > 200 && $i < ($nblignes - 1)) if ($nexY > 200 && $i < ($nblignes - 1))
{ {
//$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY); //$this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
if ($pagenb == 1) if ($pagenb == 1)
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY); $this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
else else
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY); $this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
$this->_pagefoot($pdf); $this->_pagefoot($pdf,$outputlangs);
// Nouvelle page // Nouvelle page
$pdf->AddPage(); $pdf->AddPage();
$pagenb++; $pagenb++;
$this->_pagehead($pdf, $propale, 0); $this->_pagehead($pdf, $propale, 0, $outputlangs);
$nexY = $tab_top_newpage + 8; $nexY = $tab_top_newpage + 8;
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
@ -337,26 +326,26 @@ class pdf_propale_azur extends ModelePDFPropales
// Affiche cadre tableau // Affiche cadre tableau
if ($pagenb == 1) if ($pagenb == 1)
{ {
//$this->_tableau($pdf, $tab_top, $tab_height, $nexY); //$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
//$bottomlasttab=$tab_top + $tab_height + 1; //$bottomlasttab=$tab_top + $tab_height + 1;
$this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY); $this->_tableau($pdf, $tab_top, $nexY - $tab_top + 20, $nexY, $outputlangs);
$bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1; $bottomlasttab=$tab_top + $nexY - $tab_top + 20 + 1;
} }
else else
{ {
//$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY); //$this->_tableau($pdf, $tab_top_newpage, $tab_height, $nexY, $outputlangs);
//$bottomlasttab=$tab_top_newpage + $tab_height + 1; //$bottomlasttab=$tab_top_newpage + $tab_height + 1;
$this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY); $this->_tableau($pdf, $tab_top_newpage, $nexY - $tab_top_newpage + 20, $nexY, $outputlangs);
$bottomlasttab=$tab_top_newpage + $nexY - $tab_top_newpage + 20 + 1; $bottomlasttab=$tab_top_newpage + $nexY - $tab_top_newpage + 20 + 1;
} }
$deja_regle = ""; $deja_regle = "";
$posy=$this->_tableau_tot($pdf, $propale, $deja_regle, $bottomlasttab); $posy=$this->_tableau_tot($pdf, $propale, $deja_regle, $bottomlasttab, $outputlangs);
if ($deja_regle) { if ($deja_regle) {
$this->_tableau_versements($pdf, $fac, $posy); $this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
} }
/* /*
@ -368,7 +357,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($this->marge_gauche, 228); $pdf->SetXY ($this->marge_gauche, 228);
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $langs->trans("ErrorNoPaiementModeConfigured"),0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->trans("ErrorNoPaiementModeConfigured"),0,'L',0);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
*/ */
@ -455,39 +444,43 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->SetXY($this->marge_gauche, 217); $pdf->SetXY($this->marge_gauche, 217);
$titre = $langs->trans("PaymentConditions").':'; $titre = $outputlangs->trans("PaymentConditions").':';
$pdf->MultiCell(80, 5, $titre, 0, 'L'); $pdf->MultiCell(80, 5, $titre, 0, 'L');
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY(50, 217); $pdf->SetXY(50, 217);
$lib_condition_paiement=$langs->trans("PaymentCondition".$propale->cond_reglement_code)?$langs->trans("PaymentCondition".$propale->cond_reglement_code):$propale->cond_reglement; $lib_condition_paiement=$outputlangs->trans("PaymentCondition".$propale->cond_reglement_code)?$outputlangs->trans("PaymentCondition".$propale->cond_reglement_code):$propale->cond_reglement;
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L'); $pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
} }
/* /*
* Pied de page * Pied de page
*/ */
$this->_pagefoot($pdf); $this->_pagefoot($pdf, $outputlangs);
$pdf->AliasNbPages(); $pdf->AliasNbPages();
$pdf->Close(); $pdf->Close();
$pdf->Output($file); $pdf->Output($file);
$langs->setPhpLang(); // On restaure langue session
return 1; // Pas d'erreur return 1; // Pas d'erreur
} }
else else
{ {
$this->error=$langs->trans("ErrorCanNotCreateDir",$dir); $this->error=$outputlangs->trans("ErrorCanNotCreateDir",$dir);
$langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
} }
else else
{ {
$this->error=$langs->trans("ErrorConstantNotDefined","PROP_OUTPUTDIR"); $this->error=$outputlangs->trans("ErrorConstantNotDefined","PROP_OUTPUTDIR");
$langs->setPhpLang(); // On restaure langue session
return 0; return 0;
} }
$this->error=$langs->trans("ErrorUnknown"); $this->error=$outputlangs->trans("ErrorUnknown");
$langs->setPhpLang(); // On restaure langue session
return 0; // Erreur par defaut return 0; // Erreur par defaut
} }
@ -498,12 +491,8 @@ class pdf_propale_azur extends ModelePDFPropales
* \param deja_regle Montant deja regle * \param deja_regle Montant deja regle
* \return y Position pour suite * \return y Position pour suite
*/ */
function _tableau_tot(&$pdf, $propale, $deja_regle, $posy) function _tableau_tot(&$pdf, $propale, $deja_regle, $posy, $outputlangs)
{ {
global $langs;
$langs->load("main");
$langs->load("bills");
$tab2_top = $posy; $tab2_top = $posy;
$tab2_hl = 5; $tab2_hl = 5;
$tab2_height = $tab2_hl * 4; $tab2_height = $tab2_hl * 4;
@ -522,7 +511,7 @@ class pdf_propale_azur extends ModelePDFPropales
// Total HT // Total HT
$pdf->SetFillColor(256,256,256); $pdf->SetFillColor(256,256,256);
$pdf->SetXY ($col1x, $tab2_top + 0); $pdf->SetXY ($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalHT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalHT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + 0); $pdf->SetXY ($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ht + $propale->remise), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ht + $propale->remise), 0, 'R', 1);
@ -531,13 +520,13 @@ class pdf_propale_azur extends ModelePDFPropales
if ($propale->remise > 0) if ($propale->remise > 0)
{ {
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("GlobalDiscount"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("GlobalDiscount"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl);
$pdf->MultiCell($largcol2, $tab2_hl, "-".$propale->remise_percent."%", 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, "-".$propale->remise_percent."%", 0, 'R', 1);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, "Total HT après remise", 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("WithDiscountTotalHT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * 2);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ht), 0, 'R', 0); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ht), 0, 'R', 0);
@ -559,8 +548,8 @@ class pdf_propale_azur extends ModelePDFPropales
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$tvacompl = ( (float)$tvakey < 0 ) ? " (".$langs->trans("NonPercuRecuperable").")" : '' ; $tvacompl = ( (float)$tvakey < 0 ) ? " (".$outputlangs->trans("NonPercuRecuperable").")" : '' ;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT").' '.abs($tvakey).'%'.$tvacompl, 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * abs((float)$tvakey) / 100 ), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval * abs((float)$tvakey) / 100 ), 0, 'R', 1);
@ -570,7 +559,7 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalVAT"), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalVAT"), 0, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_tva), 0, 'R', 1);
@ -582,7 +571,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("TotalTTC"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("TotalTTC"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc), $useborder, 'R', 1);
@ -594,7 +583,7 @@ class pdf_propale_azur extends ModelePDFPropales
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("AlreadyPayed"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("AlreadyPayed"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
@ -603,7 +592,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
//$pdf->SetFont('Arial','B', 9); //$pdf->SetFont('Arial','B', 9);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $langs->trans("RemainderToPay"), $useborder, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->trans("RemainderToPay"), $useborder, 'L', 1);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc - $deja_regle), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($propale->total_ttc - $deja_regle), $useborder, 'R', 1);
@ -619,16 +608,12 @@ class pdf_propale_azur extends ModelePDFPropales
* \brief Affiche la grille des lignes de propales * \brief Affiche la grille des lignes de propales
* \param pdf objet PDF * \param pdf objet PDF
*/ */
function _tableau(&$pdf, $tab_top, $tab_height, $nexY) function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
{ {
global $langs,$conf;
$langs->load("main");
$langs->load("bills");
// Montants exprimés en (en tab_top - 1) // Montants exprimés en (en tab_top - 1)
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$titre = $langs->trans("AmountInCurrency",$langs->trans("Currency".$conf->monnaie)); $titre = $outputlangs->trans("AmountInCurrency",$outputlangs->trans("Currency".$conf->monnaie));
$pdf->Text($this->page_largeur - $this->marge_droite - $pdf->GetStringWidth($titre), $tab_top-1, $titre); $pdf->Text($this->page_largeur - $this->marge_droite - $pdf->GetStringWidth($titre), $tab_top-1, $titre);
$pdf->SetDrawColor(128,128,128); $pdf->SetDrawColor(128,128,128);
@ -641,25 +626,25 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetFont('Arial','',10); $pdf->SetFont('Arial','',10);
$pdf->SetXY ($this->posxdesc-1, $tab_top+2); $pdf->SetXY ($this->posxdesc-1, $tab_top+2);
$pdf->MultiCell(108,2, $langs->trans("Designation"),'','L'); $pdf->MultiCell(108,2, $outputlangs->trans("Designation"),'','L');
$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxtva-1, $tab_top+2); $pdf->SetXY ($this->posxtva-1, $tab_top+2);
$pdf->MultiCell(12,2, $langs->trans("VAT"),'','C'); $pdf->MultiCell(12,2, $outputlangs->trans("VAT"),'','C');
$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxup-1, $tab_top+2); $pdf->SetXY ($this->posxup-1, $tab_top+2);
$pdf->MultiCell(18,2, $langs->trans("PriceUHT"),'','C'); $pdf->MultiCell(18,2, $outputlangs->trans("PriceUHT"),'','C');
$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
$pdf->SetXY ($this->posxqty-1, $tab_top+2); $pdf->SetXY ($this->posxqty-1, $tab_top+2);
$pdf->MultiCell(11,2, $langs->trans("Qty"),'','C'); $pdf->MultiCell(11,2, $outputlangs->trans("Qty"),'','C');
$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
if ($this->atleastonediscount) if ($this->atleastonediscount)
{ {
$pdf->SetXY ($this->posxdiscount-1, $tab_top+2); $pdf->SetXY ($this->posxdiscount-1, $tab_top+2);
$pdf->MultiCell(16,2, $langs->trans("ReductionShort"),'','C'); $pdf->MultiCell(16,2, $outputlangs->trans("ReductionShort"),'','C');
} }
if ($this->atleastonediscount) if ($this->atleastonediscount)
@ -667,7 +652,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
} }
$pdf->SetXY ($this->postotalht-1, $tab_top+2); $pdf->SetXY ($this->postotalht-1, $tab_top+2);
$pdf->MultiCell(23,2, $langs->trans("TotalHT"),'','C'); $pdf->MultiCell(23,2, $outputlangs->trans("TotalHT"),'','C');
} }
@ -677,14 +662,14 @@ class pdf_propale_azur extends ModelePDFPropales
* \param fac objet propale * \param fac objet propale
* \param showadress 0=non, 1=oui * \param showadress 0=non, 1=oui
*/ */
function _pagehead(&$pdf, $propale, $showadress=1) function _pagehead(&$pdf, $propale, $showadress=1, $outputlangs)
{ {
global $langs,$conf,$mysoc; global $conf,$mysoc;
$langs->load("main"); $outputlangs->load("main");
$langs->load("bills"); $outputlangs->load("bills");
$langs->load("propal"); $outputlangs->load("propal");
$langs->load("companies"); $outputlangs->load("companies");
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
@ -705,8 +690,8 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(100, 3, $langs->trans("ErrorLogoFileNotFound",$logo), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->trans("ErrorLogoFileNotFound",$logo), 0, 'L');
$pdf->MultiCell(100, 3, $langs->trans("ErrorGoToModuleSetup"), 0, 'L'); $pdf->MultiCell(100, 3, $outputlangs->trans("ErrorGoToModuleSetup"), 0, 'L');
} }
} }
else if (defined("FAC_PDF_INTITULE")) else if (defined("FAC_PDF_INTITULE"))
@ -717,18 +702,26 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetFont('Arial','B',13); $pdf->SetFont('Arial','B',13);
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Proposal")." ".$propale->ref, '' , 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("CommercialProposal"), '' , 'R');
$pdf->SetFont('Arial','B',12);
$posy+=6;
$pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $outputlangs->trans("Ref")." : " . $propale->ref, '', 'R');
$pdf->SetFont('Arial','',12); $pdf->SetFont('Arial','',12);
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("Date")." : " . dolibarr_print_date($propale->date,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("Date")." : " . dolibarr_print_date($propale->date,"%d %b %Y"), '', 'R');
$posy+=6; $posy+=6;
$pdf->SetXY(100,$posy); $pdf->SetXY(100,$posy);
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->MultiCell(100, 4, $langs->trans("DateEndPropal")." : " . dolibarr_print_date($propale->fin_validite,"%d %b %Y"), '', 'R'); $pdf->MultiCell(100, 4, $outputlangs->trans("DateEndPropal")." : " . dolibarr_print_date($propale->fin_validite,"%d %b %Y"), '', 'R');
if ($showadress) if ($showadress)
{ {
@ -738,7 +731,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY($this->marge_gauche,$posy-5); $pdf->SetXY($this->marge_gauche,$posy-5);
$pdf->MultiCell(66,5, $langs->trans("BillFrom").":"); $pdf->MultiCell(66,5, $outputlangs->trans("BillFrom").":");
$pdf->SetXY($this->marge_gauche,$posy); $pdf->SetXY($this->marge_gauche,$posy);
@ -763,17 +756,17 @@ class pdf_propale_azur extends ModelePDFPropales
} }
$carac_emetteur .= "\n"; $carac_emetteur .= "\n";
// Tel // Tel
if (defined("FAC_PDF_TEL") && FAC_PDF_TEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Phone").": ".FAC_PDF_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" : '' ).$langs->trans("Phone").": ".$mysoc->tel; elseif ($mysoc->tel) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Phone").": ".$mysoc->tel;
// Fax // Fax
if (defined("FAC_PDF_FAX") && FAC_PDF_FAX) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Fax").": ".FAC_PDF_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" : '' ).$langs->trans("Fax").": ".$mysoc->fax; elseif ($mysoc->fax) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Fax").": ".$mysoc->fax;
// EMail // EMail
if (defined("FAC_PDF_MEL") && FAC_PDF_MEL) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Email").": ".FAC_PDF_MEL; 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" : '' ).$langs->trans("Email").": ".$mysoc->email; elseif ($mysoc->email) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Email").": ".$mysoc->email;
// Web // Web
if (defined("FAC_PDF_WWW") && FAC_PDF_WWW) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$langs->trans("Web").": ".FAC_PDF_WWW; 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" : '' ).$langs->trans("Web").": ".$mysoc->url; elseif ($mysoc->url) $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->trans("Web").": ".$mysoc->url;
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);
$pdf->SetXY($this->marge_gauche+2,$posy+8); $pdf->SetXY($this->marge_gauche+2,$posy+8);
@ -784,7 +777,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5); $pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $langs->trans("BillTo").":"); $pdf->MultiCell(80,5, $outputlangs->trans("BillTo").":");
$propale->fetch_client(); $propale->fetch_client();
// Cadre client destinataire // Cadre client destinataire
@ -798,7 +791,7 @@ class pdf_propale_azur extends ModelePDFPropales
// Caractéristiques client // Caractéristiques client
$carac_client=$propale->client->adresse; $carac_client=$propale->client->adresse;
$carac_client.="\n".$propale->client->cp . " " . $propale->client->ville."\n"; $carac_client.="\n".$propale->client->cp . " " . $propale->client->ville."\n";
if ($propale->client->tva_intra) $carac_client.="\n".$langs->trans("VATIntraShort").': '.$propale->client->tva_intra; if ($propale->client->tva_intra) $carac_client.="\n".$outputlangs->trans("VATIntraShort").': '.$propale->client->tva_intra;
$pdf->SetFont('Arial','',9); $pdf->SetFont('Arial','',9);
$pdf->SetXY(102,$posy+8); $pdf->SetXY(102,$posy+8);
$pdf->MultiCell(86,4, $carac_client); $pdf->MultiCell(86,4, $carac_client);
@ -810,12 +803,9 @@ class pdf_propale_azur extends ModelePDFPropales
* \brief Affiche le pied de page * \brief Affiche le pied de page
* \param pdf objet PDF * \param pdf objet PDF
*/ */
function _pagefoot(&$pdf) function _pagefoot(&$pdf,$outputlangs)
{ {
global $langs, $conf; global $conf;
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$html=new Form($this->db); $html=new Form($this->db);
@ -827,30 +817,30 @@ class pdf_propale_azur extends ModelePDFPropales
} }
if ($conf->global->MAIN_INFO_CAPITAL) if ($conf->global->MAIN_INFO_CAPITAL)
{ {
$ligne1.=($ligne1?" - ":"").$langs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$langs->trans("Currency".$conf->monnaie); $ligne1.=($ligne1?" - ":"").$outputlangs->trans("CapitalOf",$conf->global->MAIN_INFO_CAPITAL)." ".$outputlangs->trans("Currency".$conf->monnaie);
} }
if ($conf->global->MAIN_INFO_SIRET) if ($conf->global->MAIN_INFO_SIRET)
{ {
$ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId2",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIRET; $ligne1.=($ligne1?" - ":"").$outputlangs->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'))
{ {
$ligne1.=($ligne1?" - ":"").$langs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN; $ligne1.=($ligne1?" - ":"").$outputlangs->transcountry("ProfId1",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_SIREN;
} }
// Deuxieme ligne d'info réglementaires // Deuxieme ligne d'info réglementaires
$ligne2=""; $ligne2="";
if ($conf->global->MAIN_INFO_APE) if ($conf->global->MAIN_INFO_APE)
{ {
$ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE; $ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId3",$this->emetteur->code_pays).": ".MAIN_INFO_APE;
} }
if ($conf->global->MAIN_INFO_RCS) if ($conf->global->MAIN_INFO_RCS)
{ {
$ligne2.=($ligne2?" - ":"").$langs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS; $ligne2.=($ligne2?" - ":"").$outputlangs->transcountry("ProfId4",$this->emetteur->code_pays).": ".$conf->global->MAIN_INFO_RCS;
} }
if ($conf->global->MAIN_INFO_TVAINTRA != '') if ($conf->global->MAIN_INFO_TVAINTRA != '')
{ {
$ligne2.=($ligne2?" - ":"").$langs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA; $ligne2.=($ligne2?" - ":"").$outputlangs->trans("VATIntraShort").": ".$conf->global->MAIN_INFO_TVAINTRA;
} }
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);

View File

@ -60,7 +60,7 @@ ErrorNoPaiementModeConfigured=No paiment mode yet defined
ErrorCreateBankAccount=Creat a bank account then go to Setup panel of Invoice module to define paiement modes ErrorCreateBankAccount=Creat a bank account then go to Setup panel of Invoice module to define paiement modes
ErrorBillNotFound=Invoice %s does not exists ErrorBillNotFound=Invoice %s does not exists
BillFrom=From BillFrom=From
BillTo=To BillTo=Bill to
ActionsOnBill=Actions on invoice ActionsOnBill=Actions on invoice
NewBill=New invoice NewBill=New invoice
Prélèvements=Prelevment Prélèvements=Prelevment
@ -172,7 +172,7 @@ FullPhoneNumber=Telephone
TeleFax=Fax TeleFax=Fax
PrettyLittleSentence=Accepte le réglement des sommes dues par chèques libellés à mon nom en ma qualité de Membre d'une Association de Gestion agréée par l'Administration Fiscale. PrettyLittleSentence=Accepte le réglement des sommes dues par chèques libellés à mon nom en ma qualité de Membre d'une Association de Gestion agréée par l'Administration Fiscale.
IntracommunityVATNumber=Intracommunity number of VAT IntracommunityVATNumber=Intracommunity number of VAT
PaymentByChequeOrderedTo=Règlement par chèque à l'ordre de PaymentByChequeOrderedTo=Cheque payment are payable to %s send to
SendTo=envoyé à SendTo=envoyé à
PaymentByTransferOnThisBankAccount=Payment by transfer on the following bank account PaymentByTransferOnThisBankAccount=Payment by transfer on the following bank account
VATIsNotUsedForInvoice=* TVA non applicable art-293B du CGI VATIsNotUsedForInvoice=* TVA non applicable art-293B du CGI

View File

@ -90,13 +90,13 @@ Parameter=Parameter
Parameters=Parameters Parameters=Parameters
Value=Value Value=Value
GlobalValue=Global value GlobalValue=Global value
DefaultValue=Default value
PersonalValue=Personal value PersonalValue=Personal value
NewValue=New value NewValue=New value
CurrentValue=Current value CurrentValue=Current value
Code=Code Code=Code
Type=Type Type=Type
Language=Language Language=Language
MultiLanguage=Multi-language
Note=Note Note=Note
CurrentNote=Current note CurrentNote=Current note
Title=Title Title=Title
@ -156,12 +156,13 @@ Cut=Cut
Copy=Copy Copy=Copy
Paste=Paste Paste=Paste
Default=Default Default=Default
DefaultValue=Valeur par défaut
DefaultGlobalValue=Global value DefaultGlobalValue=Global value
Price=Price Price=Price
UnitPrice=Unit price UnitPrice=Unit price
PriceU=U.P. PriceU=U.P.
PriceUHT=U.P. HT PriceUHT=U.P. HT
PriceUTTC=U.P. w/ tax PriceUTTC=U.P. TTC
Amount=Amount Amount=Amount
AmountHT=Amount HT AmountHT=Amount HT
AmountTTC=Amount TTC AmountTTC=Amount TTC
@ -174,6 +175,8 @@ SubTotal=Subtotal
TotalHT=Total HT TotalHT=Total HT
TotalTTC=Total TTC TotalTTC=Total TTC
TotalVAT=Total VAT TotalVAT=Total VAT
TotalHTAfterDiscounts=Total HT with discounts
TotalTTCAfterDiscounts=Total TTC with discounts
IncludedVAT=Included VAT IncludedVAT=Included VAT
VAT=VAT VAT=VAT
Average=Average Average=Average

View File

@ -5,6 +5,8 @@ ProposalsDraft=Draft commercial proposals
ProposalDraft=Draft commercial proposal ProposalDraft=Draft commercial proposal
ProposalsOpened=Opened commercial proposals ProposalsOpened=Opened commercial proposals
Prop=Commercial proposals Prop=Commercial proposals
CommercialProposal=Commercial proposal
CommercialProposals=Commercial proposals
ProposalContact=Proposal contact ProposalContact=Proposal contact
NewProp=New commercial proposal NewProp=New commercial proposal
NewProposal=New commercial proposal NewProposal=New commercial proposal

View File

@ -172,7 +172,7 @@ FullPhoneNumber=T
TeleFax=Télécopie TeleFax=Télécopie
PrettyLittleSentence=Accepte le règlement des sommes dues par chèques libellés à mon nom en ma qualité de Membre d'une Association de Gestion agréée par l'Administration Fiscale. PrettyLittleSentence=Accepte le règlement des sommes dues par chèques libellés à mon nom en ma qualité de Membre d'une Association de Gestion agréée par l'Administration Fiscale.
IntracommunityVATNumber=Numéro de TVA intracommunautaire IntracommunityVATNumber=Numéro de TVA intracommunautaire
PaymentByChequeOrderedTo=Règlement par chèque à l'ordre de PaymentByChequeOrderedTo=Règlement par chèque à l'ordre de %s envoyé à
SendTo=envoyé à SendTo=envoyé à
PaymentByTransferOnThisBankAccount=Règlement par virement sur le compte bancaire suivant PaymentByTransferOnThisBankAccount=Règlement par virement sur le compte bancaire suivant
VATIsNotUsedForInvoice=* TVA non applicable art-293B du CGI VATIsNotUsedForInvoice=* TVA non applicable art-293B du CGI

View File

@ -96,6 +96,7 @@ CurrentValue=Valeur courante
Code=Code Code=Code
Type=Type Type=Type
Language=Langue Language=Langue
MultiLanguage=Multi-langage
Note=Note Note=Note
CurrentNote=Note actuelle CurrentNote=Note actuelle
Title=Titre Title=Titre
@ -155,8 +156,8 @@ Cut=Couper
Copy=Copier Copy=Copier
Paste=Coller Paste=Coller
Default=Défaut Default=Défaut
DefaultGlobalValue=Valeur globale
DefaultValue=Valeur par défaut DefaultValue=Valeur par défaut
DefaultGlobalValue=Valeur globale
Price=Prix Price=Prix
UnitPrice=Prix unitaire UnitPrice=Prix unitaire
PriceU=P.U. PriceU=P.U.
@ -174,6 +175,8 @@ SubTotal=Sous-total
TotalHT=Total HT TotalHT=Total HT
TotalTTC=Total TTC TotalTTC=Total TTC
TotalVAT=Total TVA TotalVAT=Total TVA
TotalHTAfterDiscounts=Total HT après remise
TotalTTCAfterDiscounts=Total TTC après remise
IncludedVAT=Dont TVA IncludedVAT=Dont TVA
VAT=TVA VAT=TVA
Average=Moyenne Average=Moyenne

View File

@ -4,6 +4,8 @@ Proposal=Proposition commerciale
ProposalsDraft=Propositions commerciales brouillons ProposalsDraft=Propositions commerciales brouillons
ProposalDraft=Proposition commerciale brouillon ProposalDraft=Proposition commerciale brouillon
Prop=Propositions commerc. Prop=Propositions commerc.
CommercialProposal=Proposition commerciale
CommercialProposals=Propositions commerciales
ProposalsOpened=Propositions commerciales ouvertes ProposalsOpened=Propositions commerciales ouvertes
ProposalContact=Contact proposition ProposalContact=Contact proposition
NewProp=Nouvelle proposition commerciale NewProp=Nouvelle proposition commerciale

View File

@ -120,7 +120,7 @@ class Translate {
*/ */
function setPhpLang() function setPhpLang()
{ {
//dolibarr_syslog("Translate::set_php_lang: code_lang=$code_lang code_lang_tirer=$code_lang_tiret"); dolibarr_syslog("Translate::set_php_lang: ".$this->defaultlang);
$code_lang_tiret=ereg_replace('_','-',$this->defaultlang); $code_lang_tiret=ereg_replace('_','-',$this->defaultlang);
setlocale(LC_ALL, $this->defaultlang); // Compenser pb de locale avec windows setlocale(LC_ALL, $this->defaultlang); // Compenser pb de locale avec windows