Trad: Traductions pour les factures PDF

This commit is contained in:
Laurent Destailleur 2005-03-20 01:19:35 +00:00
parent 0e896c341a
commit 838b5ddb09
7 changed files with 170 additions and 86 deletions

View File

@ -298,7 +298,12 @@ class pdf_adytek extends ModelePDFFactures {
$pdf->MultiCell(20, 6, "Banque", 0, 'L', 0);
}
function _tableau_tot(&$pdf, $fac)
/*
* \brief Affiche le total à payer
* \param pdf objet PDF
* \param fac objet facture
*/
function _tableau_tot(&$pdf, $fac)
{
global $langs;
$langs->load("main");
@ -413,12 +418,14 @@ class pdf_adytek extends ModelePDFFactures {
global $langs;
$langs->load("main");
$langs->load("bills");
$langs->load("companies");
$tab4_top = 60;
$tab4_hl = 6;
$tab4_sl = 4;
$ligne = 2;
// Logo
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO)
{
if (file_exists(FAC_PDF_LOGO)) {
@ -447,38 +454,32 @@ class pdf_adytek extends ModelePDFFactures {
if (defined("FAC_PDF_ADRESSE"))
{
$pdf->SetXY( $tab4_top , $tab4_hl );
$pdf->MultiCell(40, 3, FAC_PDF_ADRESSE, '' , 'L');
$pdf->MultiCell(80, 3, FAC_PDF_ADRESSE, '' , 'L');
}
$pdf->SetFont('Arial','',7);
if (defined("FAC_PDF_TEL"))
{
$pdf->SetXY( $tab4_top , $tab4_hl + 2*$tab4_sl );
$pdf->MultiCell(40, 3, "Téléphone : " . FAC_PDF_TEL, '' , 'L');
$pdf->MultiCell(80, 3, "Téléphone : " . FAC_PDF_TEL, '' , 'L');
}
if (defined("FAC_PDF_FAX"))
{
$pdf->SetXY( $tab4_top , $tab4_hl + 3*$tab4_sl );
$pdf->MultiCell(40, 3, "Télécopie : " . FAC_PDF_FAX, '' , 'L');
$pdf->MultiCell(80, 3, "Télécopie : " . FAC_PDF_FAX, '' , 'L');
}
if (defined("FAC_PDF_MEL"))
{
$pdf->SetXY( $tab4_top , $tab4_hl + 4*$tab4_sl );
$pdf->MultiCell(40, 3, "E-mail : " . FAC_PDF_MEL, '' , 'L');
$pdf->MultiCell(80, 3, "E-mail : " . FAC_PDF_MEL, '' , 'L');
}
if (defined("FAC_PDF_WWW"))
{
$pdf->SetXY( $tab4_top , $tab4_hl + 5*$tab4_sl );
$pdf->MultiCell(40, 3, "Internet : " . FAC_PDF_WWW, '' , 'L');
$pdf->MultiCell(80, 3, "Internet : " . FAC_PDF_WWW, '' , 'L');
}
$pdf->SetTextColor(70,70,170);
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetXY(10,30);
$pdf->SetFont('Arial','',7);
$pdf->SetTextColor(0,0,200);
$pdf->MultiCell(45, 5, FAC_PDF_INTITULE2, '' , 'C');
}
/*
* Definition du document
*/

View File

@ -21,7 +21,8 @@
*
*/
/** \file htdocs/includes/modules/facture/pdf_crabe.modules.php
/**
\file htdocs/includes/modules/facture/pdf_crabe.modules.php
\ingroup facture
\brief Fichier de la classe permettant de générer les factures au modèle Crabe
\author Laurent Destailleur
@ -29,18 +30,22 @@
*/
/** \class pdf_crabe
/**
\class pdf_crabe
\brief Classe permettant de générer les factures au modèle Crabe
*/
class pdf_crabe extends ModelePDFFactures
{
/** \brief Constructeur
/**
\brief Constructeur
\param db handler accès base de donnée
*/
function pdf_crabe($db)
{
global $langs;
$this->db = $db;
$this->description = "Modèle de facture complet (Gère l'option fiscale de facturation TVA, le choix du mode de règlement à afficher, logo...)";
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
@ -49,6 +54,22 @@ class pdf_crabe extends ModelePDFFactures
$this->option_codeproduitservice = 1; // Affiche code produit-service FACTURE_CODEPRODUITSERVICE
$this->option_tvaintra = 1; // Affiche tva intra MAIN_INFO_TVAINTRA
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
// Recupere code pays
$this->code_pays=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE rowid = ".MAIN_INFO_SOCIETE_PAYS;
$result=$this->db->query($sql);
if ($result) {
$obj = $this->db->fetch_object($result);
if ($obj->code) $this->code_pays=$obj->code;
}
else {
dolibarr_print_error($this->db);
}
$this->db->free($result);
}
@ -67,6 +88,7 @@ class pdf_crabe extends ModelePDFFactures
\remarks FAC_PDF_ADRESSE
\remarks MAIN_INFO_SIRET
\remarks MAIN_INFO_SIREN
\remarks MAIN_INFO_RCS
\remarks MAIN_INFO_CAPITAL
\remarks MAIN_INFO_TVAINTRA
*/
@ -350,7 +372,7 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($tab3_posx+41, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Type"), 0, 'L', 0);
$pdf->SetXY ($tab3_posx+60, $tab3_top-1 );
$pdf->MultiCell(20, 4, $langs->trans("Ref"), 0, 'L', 0);
$pdf->MultiCell(20, 4, $langs->trans("RefBill"), 0, 'L', 0);
$sql = "SELECT ".$this->db->pdate("p.datep")."as date, p.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 ";
@ -430,7 +452,8 @@ class pdf_crabe extends ModelePDFFactures
// Affiche la mention TVA non applicable selon option
$pdf->SetXY (10, $tab2_top + 0);
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise') {
if ($this->franchise==1)
{
$pdf->MultiCell(100, $tab2_hl, "* TVA non applicable art-293B du CGI", 0, 'L', 0);
}
@ -544,12 +567,15 @@ class pdf_crabe extends ModelePDFFactures
global $langs;
$langs->load("main");
$langs->load("bills");
$langs->load("propal");
$langs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
$pdf->SetXY(10,6);
// Logo
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO)
{
if (file_exists(FAC_PDF_LOGO)) {
@ -577,8 +603,8 @@ class pdf_crabe extends ModelePDFFactures
$pdf->MultiCell(100, 10, $langs->trans("Date")." : " . dolibarr_print_date($fac->date,"%d %b %Y"), '', 'R');
/*
* Emetteur
*/
* Emetteur
*/
$posy=42;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
@ -593,48 +619,68 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY(10,$posy+4);
if (defined("FAC_PDF_INTITULE2"))
{
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',10);
$pdf->MultiCell(70, 4, FAC_PDF_INTITULE2, 0, 'L');
}
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',11);
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) // Prioritaire sur MAIN_INFO_SOCIETE_NOM
{
$pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
}
else // Par defaut
{
$pdf->MultiCell(80, 4, MAIN_INFO_SOCIETE_NOM, 0, 'L');
}
// Caractéristiques emetteur
$pdf->SetFont('Arial','',9);
if (defined("FAC_PDF_ADRESSE"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(80, 4, FAC_PDF_ADRESSE);
}
if (defined("FAC_PDF_TEL"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(40, 4, "Tél : ".FAC_PDF_TEL);
$pdf->MultiCell(80, 4, $langs->trans("Phone").": ".FAC_PDF_TEL);
}
if (defined("FAC_PDF_FAX"))
{
$pdf->MultiCell(80, 4, $langs->trans("Fax").": ".FAC_PDF_FAX);
}
if (defined("FAC_PDF_MEL"))
{
$pdf->MultiCell(80, 4, $langs->trans("Email").": ".FAC_PDF_MEL);
}
if (defined("FAC_PDF_WWW"))
{
$pdf->MultiCell(80, 4, $langs->trans("Web").": ".FAC_PDF_WWW);
}
if (defined("MAIN_INFO_SIREN"))
if (defined("MAIN_INFO_SIREN") && MAIN_INFO_SIREN)
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(60, 4, "SIREN : ".MAIN_INFO_SIREN);
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId1",$this->code_pays).": ".MAIN_INFO_SIREN);
}
elseif (defined("MAIN_INFO_SIRET"))
elseif (defined("MAIN_INFO_SIRET") && MAIN_INFO_SIRET)
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(60, 4, "SIRET : ".MAIN_INFO_SIRET);
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIRET);
}
/*
* Client
*/
* Client
*/
$posy=42;
$pdf->SetTextColor(0,0,0);
$pdf->SetFont('Arial','',8);
$pdf->SetXY(102,$posy-5);
$pdf->MultiCell(80,5, $langs->trans("BillTo").":");
$pdf->SetFont('Arial','B',11);
$fac->fetch_client();
// Nom client
$pdf->SetXY(102,$posy+4);
$pdf->SetFont('Arial','B',11);
$pdf->MultiCell(86,4, $fac->client->nom, 0, 'L');
$pdf->SetFont('Arial','B',10);
// Caractéristiques client
$pdf->SetFont('Arial','B',9);
$pdf->SetXY(102,$posy+12);
$pdf->MultiCell(86,4, $fac->client->adresse . "\n" . $fac->client->cp . " " . $fac->client->ville);
$pdf->rect(100, $posy, 100, 34);
@ -666,9 +712,16 @@ class pdf_crabe extends ModelePDFFactures
$footy=13;
$pdf->SetFont('Arial','',8);
if (MAIN_INFO_CAPITAL) {
if (defined(MAIN_INFO_CAPITAL)) {
$pdf->SetY(-$footy);
$pdf->MultiCell(190, 3,"SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie." - " . MAIN_INFO_RCS." - Identifiant professionnel: " . MAIN_INFO_SIREN , 0, 'C');
$ligne="SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie;
if (defined(MAIN_INFO_SIREN) && MAIN_INFO_SIREN) {
$ligne.=" - ".$langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIREN;
}
if (defined(MAIN_INFO_RCS) && MAIN_INFO_RCS) {
$ligne.=" - ".$langs->transcountry("ProfId3",$this->code_pays).": ".MAIN_INFO_RCS;
}
$pdf->MultiCell(190, 3, $ligne, 0, 'C');
$footy-=3;
}
@ -683,7 +736,7 @@ class pdf_crabe extends ModelePDFFactures
}
elseif (MAIN_INFO_TVAINTRA != '') {
$pdf->SetY(-$footy);
$pdf->MultiCell(190, 3, $langs->trans("TVAIntra")." : ".MAIN_INFO_TVAINTRA, 0, 'C');
$pdf->MultiCell(190, 3, $langs->trans("TVAIntra").": ".MAIN_INFO_TVAINTRA, 0, 'C');
}
$pdf->SetXY(-10,-10);

View File

@ -22,16 +22,18 @@
*
*/
/*! \file htdocs/includes/modules/facture/pdf_oursin.modules.php
\ingroup facture
\brief Fichier de la classe permettant de générer les factures au modèle oursin
\author Sylvain SCATTOLINI basé sur un modèle de Laurent Destailleur
\version $Revision$
/**
\file htdocs/includes/modules/facture/pdf_oursin.modules.php
\ingroup facture
\brief Fichier de la classe permettant de générer les factures au modèle oursin
\author Sylvain SCATTOLINI basé sur un modèle de Laurent Destailleur
\version $Revision$
*/
/*! \class pdf_oursin
\brief Classe permettant de générer les factures au modèle oursin
/**
\class pdf_oursin
\brief Classe permettant de générer les factures au modèle oursin
*/
@ -40,8 +42,9 @@ class pdf_oursin extends ModelePDFFactures
var $marges=array("g"=>10,"h"=>5,"d"=>10,"b"=>15);
/*! \brief Constructeur
\param db handler accès base de donnée
/**
\brief Constructeur
\param db handler accès base de donnée
*/
function pdf_oursin($db)
{
@ -55,10 +58,24 @@ class pdf_oursin extends ModelePDFFactures
$this->option_capital = 1; // Affiche capital MAIN_INFO_CAPITAL
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
$this->franchise=1;
// Recupere code pays
$this->code_pays=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
$sql .= " WHERE rowid = ".MAIN_INFO_SOCIETE_PAYS;
$result=$this->db->query($sql);
if ($result) {
$obj = $this->db->fetch_object($result);
if ($obj->code) $this->code_pays=$obj->code;
}
else {
dolibarr_print_error($this->db);
}
$this->db->free($result);
}
/*!
/**
\brief Fonction générant la facture sur le disque
\param facid id de la facture à générer
\return int 1=ok, 0=ko
@ -69,11 +86,10 @@ class pdf_oursin extends ModelePDFFactures
\remarks FACTURE_RIB_NUMBER
\remarks FAC_PDF_INTITULE
\remarks FAC_PDF_INTITULE2
\remarks FAC_PDF_SIREN
\remarks FAC_PDF_SIRET
\remarks FAC_PDF_TEL
\remarks FAC_PDF_ADRESSE
\remarks MAIN_INFO_RCS
\remarks MAIN_INFO_SIRET
\remarks MAIN_INFO_SIREN
\remarks MAIN_INFO_CAPITAL
\remarks MAIN_INFO_TVAINTRA
*/
@ -154,7 +170,7 @@ class pdf_oursin extends ModelePDFFactures
}
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
// Affichage durée si il y en a une
$codeproduitservice.="\n".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end);
$codeproduitservice.=" (".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")";
}
$pdf->MultiCell(108, 5, $fac->lignes[$i]->desc."$codeproduitservice", 0, 'J');
@ -166,7 +182,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY ($this->marges['g']+119, $curY);
$pdf->MultiCell(10, 5, $fac->lignes[$i]->tva_taux, 0, 'C');
}
// Prix unitaire HT
// Prix unitaire HT avant remise
$pdf->SetXY ($this->marges['g']+132, $curY);
$pdf->MultiCell(16, 5, price($fac->lignes[$i]->subprice), 0, 'R', 0);
@ -549,15 +565,15 @@ class pdf_oursin extends ModelePDFFactures
global $langs;
$langs->load("main");
$langs->load("bills");
$langs->load("propal");
$langs->load("companies");
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',13);
$pdf->SetXY($this->marges['g'],6);
/*
* Logo
*/
// Logo
if (defined("FAC_PDF_LOGO") && FAC_PDF_LOGO)
{
if (file_exists(FAC_PDF_LOGO))
@ -595,41 +611,44 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetXY($this->marges['g'],$posy+4);
if (defined("FAC_PDF_INTITULE2"))
{
// Nom emetteur
$pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B',12);
$pdf->MultiCell(70, 4, FAC_PDF_INTITULE2, 0, 'L');
if (defined("FAC_PDF_SOCIETE_NOM") && FAC_PDF_SOCIETE_NOM) // Prioritaire sur MAIN_INFO_SOCIETE_NOM
{
$pdf->MultiCell(80, 4, FAC_PDF_SOCIETE_NOM, 0, 'L');
}
else // Par defaut
{
$pdf->MultiCell(80, 4, MAIN_INFO_SOCIETE_NOM, 0, 'L');
}
// Caractéristiques emetteur
$pdf->SetFont('Arial','',9);
if (defined("FAC_PDF_ADRESSE"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(80, 4, FAC_PDF_ADRESSE);
}
if (defined("FAC_PDF_TEL"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(40, 4, "Tél. : ".FAC_PDF_TEL);
$pdf->MultiCell(80, 4, $langs->trans("Phone").": ".FAC_PDF_TEL);
}
if (defined("FAC_PDF_MEL"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(60, 4, "émail : ".FAC_PDF_MEL);
$pdf->MultiCell(80, 4, $langs->trans("Email").": ".FAC_PDF_MEL);
}
if (defined("FAC_PDF_WWW"))
{
$pdf->SetFont('Arial','',10);
$pdf->MultiCell(60, 4, FAC_PDF_WWW);
$pdf->MultiCell(80, 4, $langs->trans("Web").": ".FAC_PDF_WWW);
}
if (defined("FAC_PDF_SIRET"))
if (defined("MAIN_INFO_SIREN") && MAIN_INFO_SIREN)
{
$pdf->SetFont('Arial','',7);
$pdf->MultiCell(60, 4, "SIRET : ".FAC_PDF_SIRET);
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId1",$this->code_pays).": ".MAIN_INFO_SIREN);
}
elseif (defined("FAC_PDF_SIREN"))
elseif (defined("MAIN_INFO_SIRET") && MAIN_INFO_SIRET)
{
$pdf->SetFont('Arial','',7);
$pdf->MultiCell(60, 4, "SIREN : ".FAC_PDF_SIREN);
$pdf->MultiCell(80, 4, $langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIRET);
}
@ -659,7 +678,7 @@ class pdf_oursin extends ModelePDFFactures
$pdf->SetFont('Arial','B',11);
$pdf->SetXY($this->marges['g'],$posy+6);
$pdf->SetTextColor(22,137,210);
$pdf->MultiCell(100, 10, " : " . $fac->ref, '', 'L');
$pdf->MultiCell(100, 10, $langs->trans("RefBill")." : " . $fac->ref, '', 'L');
$pdf->SetTextColor(0,0,0);
/*
@ -670,7 +689,7 @@ class pdf_oursin extends ModelePDFFactures
$projet = New Project($fac->db);
$projet->fetch($fac->projetid);
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(60, 4, "Projet : ".$projet->title);
$pdf->MultiCell(60, 4, $langs->trans("Project")." : ".$projet->title);
}
/*
@ -683,7 +702,7 @@ class pdf_oursin extends ModelePDFFactures
{
$objp = $fac->db->fetch_object();
$pdf->SetFont('Arial','',9);
$pdf->MultiCell(60, 4, "Réf. interne : ".$objp->ref);
$pdf->MultiCell(60, 4, $langs->trans("RefProposal")." : ".$objp->ref);
}
/*
@ -713,10 +732,17 @@ class pdf_oursin extends ModelePDFFactures
$footy=13;
$pdf->SetFont('Arial','',8);
if (MAIN_INFO_CAPITAL) {
$pdf->SetY(-$footy);
$pdf->MultiCell(190, 3,"SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie." - " . MAIN_INFO_RCS." - Identifiant professionnel: " . MAIN_INFO_SIREN , 0, 'C');
$footy-=3;
if (defined(MAIN_INFO_CAPITAL)) {
$pdf->SetY(-$footy);
$ligne="SARL au Capital de " . MAIN_INFO_CAPITAL." ".$conf->monnaie;
if (defined(MAIN_INFO_SIREN) && MAIN_INFO_SIREN) {
$ligne.=" - ".$langs->transcountry("ProfId2",$this->code_pays).": ".MAIN_INFO_SIREN;
}
if (defined(MAIN_INFO_RCS) && MAIN_INFO_RCS) {
$ligne.=" - ".$langs->transcountry("ProfId3",$this->code_pays).": ".MAIN_INFO_RCS;
}
$pdf->MultiCell(190, 3, $ligne, 0, 'C');
$footy-=3;
}
// Affiche le numéro de TVA intracommunautaire

View File

@ -65,3 +65,4 @@ SendBillRef=Send bill %s
SendReminderBillRef=Send bill %s (reminder)
NoDraftBills=No drafts bills
NoOtherDraftBills=No other drafts bills
RefBill=Bill ref

View File

@ -26,4 +26,5 @@ PropalStatusValidated=Validated (proposal is opened)
ListOfProposals=List of commercial proposals
ActionsOnPropal=Tasks on proposal
NoOpenedPropals=No opened commercial proposals
NoOtherOpenedPropals=No other opened commercial proposals
NoOtherOpenedPropals=No other opened commercial proposals
RefProposal=Commercial proposal ref

View File

@ -67,4 +67,5 @@ ShowBill=Afficher facture
StandingOrders=Prélèvements
StandingOrder=Prélèvement
NoDraftBills=Pas de factures brouillons
NoOtherDraftBills=Pas d'autres factures brouillons
NoOtherDraftBills=Pas d'autres factures brouillons
RefBill=Réf facture

View File

@ -26,4 +26,5 @@ PropalStatusValidated=Valid
ListOfProposals=Liste des devis/propositions commerciales
ActionsOnPropal=Actions sur la proposition
NoOpenedPropals=Pas de propositions ouvertes
NoOtherOpenedPropals=Pas d'autres propositions ouvertes
NoOtherOpenedPropals=Pas d'autres propositions ouvertes
RefProposal=Réf proposition commerciale