Fix: Miscellanous fix on i18n
This commit is contained in:
parent
5f50893b48
commit
6da0d25acc
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copytight (C) 2004 Christophe Combelles <ccomb@free.fr>
|
* Copytight (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||||
* Copytight (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
* Copytight (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
|
||||||
*
|
*
|
||||||
@ -61,11 +61,12 @@ $mesg='';
|
|||||||
/*
|
/*
|
||||||
* Action
|
* Action
|
||||||
*/
|
*/
|
||||||
|
$dateop=-1;
|
||||||
|
|
||||||
if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->banque->modifier)
|
if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]) && $user->rights->banque->modifier)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($_POST["credit"] > 0)
|
if (price2num($_POST["credit"]) > 0)
|
||||||
{
|
{
|
||||||
$amount = price2num($_POST["credit"]);
|
$amount = price2num($_POST["credit"]);
|
||||||
}
|
}
|
||||||
@ -315,7 +316,7 @@ if ($account || $_GET["ref"])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Formulaire de saisie d'une opération hors factures
|
// Form to add a transaction with no invoice
|
||||||
if ($user->rights->banque->modifier && $_GET["action"]=='addline')
|
if ($user->rights->banque->modifier && $_GET["action"]=='addline')
|
||||||
{
|
{
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
@ -339,20 +340,20 @@ if ($account || $_GET["ref"])
|
|||||||
|
|
||||||
print '<tr '.$bc[false].'>';
|
print '<tr '.$bc[false].'>';
|
||||||
print '<td nowrap="nowrap" colspan="2">';
|
print '<td nowrap="nowrap" colspan="2">';
|
||||||
$html->select_date(-1,'op',0,0,0,'transaction');
|
$html->select_date($dateop,'op',0,0,0,'transaction');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td nowrap="nowrap">';
|
print '<td nowrap="nowrap">';
|
||||||
$html->select_types_paiements('','operation','1,2',2,1);
|
$html->select_types_paiements((isset($_POST["operation"])?$_POST["operation"]:''),'operation','1,2',2,1);
|
||||||
print '<input name="num_chq" class="flat" type="text" size="4"></td>';
|
print '<input name="num_chq" class="flat" type="text" size="4" value="'.(isset($_POST["num_chq"])?$_POST["num_chq"]:'').'"></td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print '<input name="label" class="flat" type="text" size="32">';
|
print '<input name="label" class="flat" type="text" size="32" value="'.(isset($_POST["label"])?$_POST["label"]:'').'">';
|
||||||
if ($nbcategories)
|
if ($nbcategories)
|
||||||
{
|
{
|
||||||
print '<br>'.$langs->trans("Category").': <select class="flat" name="cat1">'.$options.'</select>';
|
print '<br>'.$langs->trans("Category").': <select class="flat" name="cat1">'.$options.'</select>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align=right><input name="debit" class="flat" type="text" size="4"></td>';
|
print '<td align=right><input name="debit" class="flat" type="text" size="4" value="'.(isset($_POST["debit"])?$_POST["debit"]:'').'"></td>';
|
||||||
print '<td align=right><input name="credit" class="flat" type="text" size="4"></td>';
|
print '<td align=right><input name="credit" class="flat" type="text" size="4" value="'.(isset($_POST["credit"])?$_POST["credit"]:'').'"></td>';
|
||||||
print '<td colspan="2" align="center">';
|
print '<td colspan="2" align="center">';
|
||||||
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'"><br>';
|
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'"><br>';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
||||||
|
|||||||
@ -314,7 +314,7 @@ class pdf_edison extends ModelePDFCommandes
|
|||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',10);
|
$pdf->SetFont('Arial','',10);
|
||||||
$titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentities("Currency".$conf->monnaie));
|
$titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||||
$pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
$pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -441,9 +441,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
$pdf->SetFont('Arial','', 9);
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
/*
|
// If France, show VAT mention if not applicable
|
||||||
* If France, show VAT mention if not applicable
|
|
||||||
*/
|
|
||||||
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
||||||
{
|
{
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
@ -453,9 +451,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy=$pdf->GetY()+4;
|
$posy=$pdf->GetY()+4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Show payments conditions
|
||||||
* Conditions de reglements
|
|
||||||
*/
|
|
||||||
if ($object->cond_reglement_code || $object->cond_reglement)
|
if ($object->cond_reglement_code || $object->cond_reglement)
|
||||||
{
|
{
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
@ -471,10 +467,10 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy=$pdf->GetY()+3;
|
$posy=$pdf->GetY()+3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Check a payment mode is defined
|
||||||
* Check si absence mode reglement
|
if (empty($object->mode_reglement_code)
|
||||||
*/
|
&& ! $conf->global->FACTURE_CHQ_NUMBER
|
||||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
&& ! $conf->global->FACTURE_RIB_NUMBER)
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200,0,0);
|
||||||
@ -485,10 +481,26 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy=$pdf->GetY()+1;
|
$posy=$pdf->GetY()+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Sown payment mode
|
||||||
* Propose mode reglement par CHQ
|
if ($object->mode_reglement_code
|
||||||
*/
|
&& $object->mode_reglement_code != 'CHQ'
|
||||||
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'CHQ')
|
&& $object->mode_reglement_code != 'VIR')
|
||||||
|
{
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("PaymentMode").':';
|
||||||
|
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->SetXY(50, $posy);
|
||||||
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code)!=('PaymentMode'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
|
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show payment mode CHQ
|
||||||
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a CHQ
|
// Si mode reglement non force ou si force a CHQ
|
||||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||||
@ -505,8 +517,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||||
@ -518,22 +529,16 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 6, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
* Propose mode reglement par RIB
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
*/
|
|
||||||
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'VIR')
|
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a VIR
|
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
|
||||||
{
|
|
||||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
|
||||||
{
|
{
|
||||||
$account = new Account($this->db);
|
$account = new Account($this->db);
|
||||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||||
@ -546,7 +551,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$posy+=2;
|
$posy+=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $posy;
|
return $posy;
|
||||||
}
|
}
|
||||||
@ -569,7 +573,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetFont('Arial','', 9);
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
// Tableau total
|
// Tableau total
|
||||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
$lltot = 200; $col1x = 120; $col2x = 170; $largcol2 = $lltot - $col2x;
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
@ -671,7 +675,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// Montants exprim<69>s en (en tab_top - 1)
|
// Montants exprim<69>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 = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("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);
|
||||||
@ -865,9 +869,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
if ($usecontact)
|
if ($usecontact)
|
||||||
{
|
{
|
||||||
// Nom societe
|
// Nom societe
|
||||||
$pdf->SetXY(102,$posy+3);
|
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
|
||||||
|
|
||||||
// Customer name
|
// Customer name
|
||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
@ -884,16 +886,14 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Customer name
|
// Customer name
|
||||||
$pdf->SetXY(102,$posy+3);
|
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
|
||||||
|
|
||||||
// Nom du contact suivi commande si c'est une soci<63>t<EFBFBD>
|
// Nom du contact suivi commande si c'est une soci<63>t<EFBFBD>
|
||||||
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
||||||
if (sizeof($arrayidcontact) > 0)
|
if (sizeof($arrayidcontact) > 0)
|
||||||
{
|
{
|
||||||
$object->fetch_contact($arrayidcontact[0]);
|
$object->fetch_contact($arrayidcontact[0]);
|
||||||
// On v<EFBFBD>rifie si c'est une soci<63>t<EFBFBD> ou un particulier
|
// On verifie si c'est une societe ou un particulier
|
||||||
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
||||||
{
|
{
|
||||||
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
@ -910,8 +910,14 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$carac_client.=$outputlangs->convToOutputCharset($object->client->pays)."\n";
|
$carac_client.=$outputlangs->convToOutputCharset($object->client->pays)."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Num<75>ro TVA intracom
|
// Numero TVA intracom
|
||||||
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
||||||
|
|
||||||
|
// Show customer/recipient
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('Arial','',9);
|
$pdf->SetFont('Arial','',9);
|
||||||
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
$pdf->SetXY(102,$posy+6);
|
$pdf->SetXY(102,$posy+6);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2008 Regis Houssin <regis.houssin@dolibarr.fr>
|
* Copyright (C) 2005-2008 Regis Houssin <regis.houssin@dolibarr.fr>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
*
|
*
|
||||||
@ -25,7 +25,7 @@
|
|||||||
\brief File of class to generate invoices from crab model
|
\brief File of class to generate invoices from crab model
|
||||||
\author Laurent Destailleur
|
\author Laurent Destailleur
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/modules/facture/modules_facture.php");
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product.class.php");
|
||||||
@ -36,7 +36,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php");
|
|||||||
/**
|
/**
|
||||||
\class pdf_crabe
|
\class pdf_crabe
|
||||||
\brief Classe permettant de g<EFBFBD>n<EFBFBD>rer les factures au mod<EFBFBD>le Crabe
|
\brief Classe permettant de g<EFBFBD>n<EFBFBD>rer les factures au mod<EFBFBD>le Crabe
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class pdf_crabe extends ModelePDFFactures
|
class pdf_crabe extends ModelePDFFactures
|
||||||
{
|
{
|
||||||
@ -70,12 +70,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo
|
$this->option_logo = 1; // Affiche logo
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
$this->option_modereg = 1; // Affiche mode r<EFBFBD>glement
|
$this->option_modereg = 1; // Affiche mode reglement
|
||||||
$this->option_condreg = 1; // Affiche conditions r<EFBFBD>glement
|
$this->option_condreg = 1; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 1; // Affiche si il y a eu escompte
|
$this->option_escompte = 1; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 1; // G<EFBFBD>re les avoirs
|
$this->option_credit_note = 1; // Support credit notes
|
||||||
$this->option_freetext = 1; // Support add of a personalised text
|
$this->option_freetext = 1; // Support add of a personalised text
|
||||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||||
|
|
||||||
@ -234,12 +234,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$curY = $tab_top + 8;
|
$curY = $tab_top + 8;
|
||||||
$nexY = $tab_top + 8;
|
$nexY = $tab_top + 8;
|
||||||
|
|
||||||
// Boucle sur les lignes
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description de la ligne produit
|
// Description of product line
|
||||||
$libelleproduitservice=dol_htmlentitiesbr($fac->lignes[$i]->libelle,1);
|
$libelleproduitservice=dol_htmlentitiesbr($fac->lignes[$i]->libelle,1);
|
||||||
if ($fac->lignes[$i]->desc && $fac->lignes[$i]->desc != $fac->lignes[$i]->libelle)
|
if ($fac->lignes[$i]->desc && $fac->lignes[$i]->desc != $fac->lignes[$i]->libelle)
|
||||||
{
|
{
|
||||||
@ -299,8 +299,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
//if ($i==0) { print $libelleproduitservice; exit; }
|
//if ($i==0) { print $libelleproduitservice; exit; }
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
|
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
|
||||||
|
|
||||||
// Description
|
|
||||||
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
$pdf->writeHTMLCell($this->posxtva-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||||
|
|
||||||
$pdf->SetFont('Arial','', 9); // On repositionne la police par defaut
|
$pdf->SetFont('Arial','', 9); // On repositionne la police par defaut
|
||||||
@ -649,9 +647,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Show payment mode CHQ
|
||||||
* Propose mode reglement par CHQ
|
|
||||||
*/
|
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a CHQ
|
// Si mode reglement non force ou si force a CHQ
|
||||||
@ -670,7 +666,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||||
@ -682,16 +677,13 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 6, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
* Si mode reglement non force ou si force a VIR, propose mode reglement par RIB
|
|
||||||
*/
|
|
||||||
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
{
|
{
|
||||||
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
@ -730,7 +722,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetFont('Arial','', 9);
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
// Tableau total
|
// Tableau total
|
||||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
$lltot = 200; $col1x = 120; $col2x = 170; $largcol2 = $lltot - $col2x;
|
||||||
|
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
|
||||||
@ -853,10 +845,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Montants exprim<69>s en (en tab_top - 1)
|
// Amount in (at tab_top - 1)
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("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);
|
||||||
@ -1091,13 +1083,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
if ($usecontact)
|
if ($usecontact)
|
||||||
{
|
{
|
||||||
// Nom societe
|
// On peut utiliser le nom de la societe du contact
|
||||||
$pdf->SetXY(102,$posy+3);
|
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
// On peut utiliser le nom de la societe du contact facturation
|
|
||||||
if ($conf->global->FACTURE_USE_COMPANY_NAME_OF_BILL_CONTACT) $socname = $object->contact->socname;
|
if ($conf->global->FACTURE_USE_COMPANY_NAME_OF_BILL_CONTACT) $socname = $object->contact->socname;
|
||||||
else $socname = $object->client->nom;
|
else $socname = $object->client->nom;
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($socname), 0, 'L');
|
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||||
|
|
||||||
// Customer name
|
// Customer name
|
||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
@ -1114,9 +1103,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nom client
|
// Nom client
|
||||||
$pdf->SetXY(102,$posy+3);
|
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
|
||||||
|
|
||||||
// Nom du contact facturation si c'est une societe
|
// Nom du contact facturation si c'est une societe
|
||||||
$arrayidcontact = $object->getIdContact('external','BILLING');
|
$arrayidcontact = $object->getIdContact('external','BILLING');
|
||||||
@ -1142,6 +1129,12 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
// Numero TVA intracom
|
// Numero TVA intracom
|
||||||
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
||||||
|
|
||||||
|
// Show customer/recipient
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('Arial','',9);
|
$pdf->SetFont('Arial','',9);
|
||||||
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
$pdf->SetXY(102,$posy+6);
|
$pdf->SetXY(102,$posy+6);
|
||||||
|
|||||||
@ -583,7 +583,7 @@ class pdf_huitre extends ModelePDFFactures
|
|||||||
// Montants exprimes en euros
|
// Montants exprimes en euros
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',10);
|
$pdf->SetFont('Arial','',10);
|
||||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||||
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre);
|
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005 Sylvain SCATTOLINI <sylvain@s-infoservices.com>
|
* Copyright (C) 2005 Sylvain SCATTOLINI <sylvain@s-infoservices.com>
|
||||||
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||||
@ -70,12 +70,12 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
|
|
||||||
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
$this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
|
||||||
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
$this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
|
||||||
$this->option_modereg = 1; // Gere choix mode r<EFBFBD>glement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
|
$this->option_modereg = 1; // Gere choix mode reglement FACTURE_CHQ_NUMBER, FACTURE_RIB_NUMBER
|
||||||
$this->option_condreg = 1; // Affiche conditions r<EFBFBD>glement
|
$this->option_condreg = 1; // Affiche conditions reglement
|
||||||
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
$this->option_codeproduitservice = 1; // Affiche code produit-service
|
||||||
$this->option_multilang = 1; // Dispo en plusieurs langues
|
$this->option_multilang = 1; // Dispo en plusieurs langues
|
||||||
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
$this->option_escompte = 0; // Affiche si il y a eu escompte
|
||||||
$this->option_credit_note = 1; // G<EFBFBD>re les avoirs
|
$this->option_credit_note = 1; // Gere les avoirs
|
||||||
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
$this->option_draft_watermark = 1; //Support add of a watermark on drafts
|
||||||
|
|
||||||
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
if (defined("FACTURE_TVAOPTION") && FACTURE_TVAOPTION == 'franchise')
|
||||||
@ -88,8 +88,8 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction g<EFBFBD>n<EFBFBD>rant la facture sur le disque
|
* \brief Fonction generant la facture sur le disque
|
||||||
* \param fac Objet facture <EFBFBD> g<EFBFBD>n<EFBFBD>rer (ou id si ancienne methode)
|
* \param fac Objet facture a generer (ou id si ancienne methode)
|
||||||
* \param outputlangs Lang object for output language
|
* \param outputlangs Lang object for output language
|
||||||
* \return int 1=ok, 0=ko
|
* \return int 1=ok, 0=ko
|
||||||
*/
|
*/
|
||||||
@ -110,7 +110,7 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
|
|
||||||
if ($conf->facture->dir_output)
|
if ($conf->facture->dir_output)
|
||||||
{
|
{
|
||||||
// D<EFBFBD>finition de l'objet $fac (pour compatibilite ascendante)
|
// Definition de l'objet $fac (pour compatibilite ascendante)
|
||||||
if (! is_object($fac))
|
if (! is_object($fac))
|
||||||
{
|
{
|
||||||
$id = $fac;
|
$id = $fac;
|
||||||
@ -189,29 +189,71 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$nblignes = sizeof($fac->lignes);
|
$nblignes = sizeof($fac->lignes);
|
||||||
|
|
||||||
// Boucle sur les lignes de factures
|
// Loop on each lines
|
||||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||||
{
|
{
|
||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
|
|
||||||
// Description produit
|
// Description of product line
|
||||||
$codeproduitservice="";
|
$libelleproduitservice=dol_htmlentitiesbr($fac->lignes[$i]->libelle,1);
|
||||||
$pdf->SetXY ($this->marges['g']+ 1, $curY );
|
if ($fac->lignes[$i]->desc && $fac->lignes[$i]->desc != $fac->lignes[$i]->libelle)
|
||||||
if (defined("FACTURE_CODEPRODUITSERVICE") && FACTURE_CODEPRODUITSERVICE) {
|
{
|
||||||
// Affiche code produit si ligne associ<63>e <20> un code produit
|
if ($libelleproduitservice) $libelleproduitservice.="<br>";
|
||||||
|
|
||||||
|
if ($fac->lignes[$i]->desc == '(CREDIT_NOTE)' && $fac->lignes[$i]->fk_remise_except)
|
||||||
|
{
|
||||||
|
$discount=new DiscountAbsolute($this->db);
|
||||||
|
$discount->fetch($fac->lignes[$i]->fk_remise_except);
|
||||||
|
$libelleproduitservice=dol_htmlentitiesbr($langs->trans("DiscountFromCreditNote",$discount->ref_facture_source),1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($fac->lignes[$i]->produit_id)
|
||||||
|
{
|
||||||
|
$libelleproduitservice.=dol_htmlentitiesbr($fac->lignes[$i]->desc,1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//$fac->lignes[$i]->desc='<27>zaaaa';
|
||||||
|
//print dol_string_is_good_iso($fac->lignes[$i]->desc);
|
||||||
|
//print dol_htmlentitiesbr($fac->lignes[$i]->desc);
|
||||||
|
//print exit;
|
||||||
|
$libelleproduitservice.=dol_htmlentitiesbr($fac->lignes[$i]->desc,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Si ligne associee a un code produit
|
||||||
|
if ($fac->lignes[$i]->produit_id)
|
||||||
|
{
|
||||||
$prodser = new Product($this->db);
|
$prodser = new Product($this->db);
|
||||||
|
|
||||||
$prodser->fetch($fac->lignes[$i]->produit_id);
|
$prodser->fetch($fac->lignes[$i]->produit_id);
|
||||||
if ($prodser->ref) {
|
// On ajoute la ref
|
||||||
$codeproduitservice=" - ".$outputlangs->transnoentities("ProductCode")." ".$prodser->ref;
|
if ($prodser->ref)
|
||||||
|
{
|
||||||
|
$prefix_prodserv = "";
|
||||||
|
if($prodser->isservice())
|
||||||
|
{
|
||||||
|
$prefix_prodserv = $outputlangs->transnoentities("Service")." ";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$prefix_prodserv = $outputlangs->transnoentities("Product")." ";
|
||||||
}
|
}
|
||||||
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
|
|
||||||
// Affichage dur<75>e si il y en a une
|
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
|
||||||
$codeproduitservice.=" (".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start,'',false,$outputlangs)." ".$langs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end,'',false,$outputlangs).")";
|
|
||||||
}
|
}
|
||||||
$pdf->MultiCell(108, 5, $outputlangs->convToOutputCharset($fac->lignes[$i]->desc).$codeproduitservice, 0, 'J');
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end)
|
||||||
|
{
|
||||||
|
// Affichage duree si il y en a une
|
||||||
|
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start,'',false,$outputlangs)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end,'',false,$outputlangs).")",1);
|
||||||
|
}
|
||||||
|
//if ($i==0) { print $libelleproduitservice; exit; }
|
||||||
|
|
||||||
|
$pdf->writeHTMLCell(108, 3, $this->posxdesc-1, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
|
||||||
|
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
|
|
||||||
@ -253,8 +295,13 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
|
|
||||||
}
|
}
|
||||||
$posy=$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $fac, $outputlangs);
|
$posy=$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $fac, $outputlangs);
|
||||||
|
$bottomlasttab=$tab_top + $tab_height + 1;
|
||||||
|
|
||||||
$posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $outputlangs);
|
// Affiche zone infos
|
||||||
|
$posy=$this->_tableau_info($pdf, $fac, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
|
// Affiche zone totaux
|
||||||
|
$posy=$this->_tableau_tot($pdf, $fac, $deja_regle, $bottomlasttab, $outputlangs);
|
||||||
|
|
||||||
// Affiche zone versements
|
// Affiche zone versements
|
||||||
if ($deja_regle || $amount_credit_not_included)
|
if ($deja_regle || $amount_credit_not_included)
|
||||||
@ -262,61 +309,6 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
$posy=$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
$posy=$this->_tableau_versements($pdf, $fac, $posy, $outputlangs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mode de r<>glement
|
|
||||||
if ((! defined("FACTURE_CHQ_NUMBER") || ! FACTURE_CHQ_NUMBER) && (! defined("FACTURE_RIB_NUMBER") || ! FACTURE_RIB_NUMBER)) {
|
|
||||||
$pdf->SetXY ($this->marges['g'], 228);
|
|
||||||
$pdf->SetTextColor(200,0,0);
|
|
||||||
$pdf->SetFont('Arial','B',8);
|
|
||||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
|
|
||||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorCreateBankAccount"),0,'L',0);
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Propose mode reglement par CHQ
|
|
||||||
if (defined("FACTURE_CHQ_NUMBER"))
|
|
||||||
{
|
|
||||||
if (FACTURE_CHQ_NUMBER > 0)
|
|
||||||
{
|
|
||||||
$account = new Account($this->db);
|
|
||||||
$account->fetch(FACTURE_CHQ_NUMBER);
|
|
||||||
|
|
||||||
$pdf->SetXY ($this->marges['g'], 225);
|
|
||||||
$pdf->SetFont('Arial','B',8);
|
|
||||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo').' '.$account->proprio.' '.$langs->transnoentities('SendTo').':',0,'L',0);
|
|
||||||
$pdf->SetXY ($this->marges['g'], 230);
|
|
||||||
$pdf->SetFont('Arial','',8);
|
|
||||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Propose mode reglement par RIB
|
|
||||||
if (defined("FACTURE_RIB_NUMBER"))
|
|
||||||
{
|
|
||||||
if (FACTURE_RIB_NUMBER > 0)
|
|
||||||
{
|
|
||||||
$account = new Account($this->db);
|
|
||||||
$account->fetch(FACTURE_RIB_NUMBER);
|
|
||||||
|
|
||||||
$cury=240;
|
|
||||||
$curx=$this->marges['g'];
|
|
||||||
|
|
||||||
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Conditions de reglements
|
|
||||||
if ($fac->cond_reglement_code)
|
|
||||||
{
|
|
||||||
$pdf->SetFont('Arial','B',10);
|
|
||||||
$pdf->SetXY($this->marges['g'], 217);
|
|
||||||
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
|
||||||
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
|
||||||
$pdf->SetFont('Arial','',10);
|
|
||||||
$pdf->SetXY($this->marges['g']+44, 217);
|
|
||||||
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$fac->cond_reglement_code)!=('PaymentCondition'.$fac->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$fac->cond_reglement_code):$outputlangs->convToOutputCharset($fac->cond_reglement);
|
|
||||||
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pied de page
|
// Pied de page
|
||||||
$this->_pagefoot($pdf, $fac, $outputlangs);
|
$this->_pagefoot($pdf, $fac, $outputlangs);
|
||||||
$pdf->AliasNbPages();
|
$pdf->AliasNbPages();
|
||||||
@ -484,13 +476,146 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* \brief Affiche infos divers
|
||||||
|
* \param pdf Objet PDF
|
||||||
|
* \param object Objet facture
|
||||||
|
* \param posy Position depart
|
||||||
|
* \param outputlangs Objet langs
|
||||||
|
* \return y Position pour suite
|
||||||
|
*/
|
||||||
|
function _tableau_info(&$pdf, $object, $posy, $outputlangs)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
|
// If France, show VAT mention if not applicable
|
||||||
|
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
||||||
|
{
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show payments conditions
|
||||||
|
if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement))
|
||||||
|
{
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("PaymentConditions").':';
|
||||||
|
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->SetXY(50, $posy);
|
||||||
|
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement);
|
||||||
|
$pdf->MultiCell(80, 5, $lib_condition_paiement,0,'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($object->type != 2)
|
||||||
|
{
|
||||||
|
// Check a payment mode is defined
|
||||||
|
if (empty($object->mode_reglement_code)
|
||||||
|
&& ! $conf->global->FACTURE_CHQ_NUMBER
|
||||||
|
&& ! $conf->global->FACTURE_RIB_NUMBER)
|
||||||
|
{
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->SetTextColor(200,0,0);
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sown payment mode
|
||||||
|
if ($object->mode_reglement_code
|
||||||
|
&& $object->mode_reglement_code != 'CHQ'
|
||||||
|
&& $object->mode_reglement_code != 'VIR')
|
||||||
|
{
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("PaymentMode").':';
|
||||||
|
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||||
|
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->SetXY(50, $posy);
|
||||||
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code)!=('PaymentMode'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
|
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show payment mode CHQ
|
||||||
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
|
{
|
||||||
|
// Si mode reglement non force ou si force a CHQ
|
||||||
|
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||||
|
{
|
||||||
|
if ($conf->global->FACTURE_CHQ_NUMBER > 0)
|
||||||
|
{
|
||||||
|
$account = new Account($this->db);
|
||||||
|
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
|
||||||
|
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$outputlangs->convToOutputCharset($account->proprio)).':',0,'L',0);
|
||||||
|
$posy=$pdf->GetY()+1;
|
||||||
|
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||||
|
$posy=$pdf->GetY()+2;
|
||||||
|
}
|
||||||
|
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||||
|
{
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->nom).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0);
|
||||||
|
$posy=$pdf->GetY()+1;
|
||||||
|
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
||||||
|
$posy=$pdf->GetY()+2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
|
{
|
||||||
|
$account = new Account($this->db);
|
||||||
|
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||||
|
|
||||||
|
$curx=$this->marge_gauche;
|
||||||
|
$cury=$posy;
|
||||||
|
|
||||||
|
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
|
||||||
|
|
||||||
|
$posy+=2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $posy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
* \brief Affiche le total <EFBFBD> payer
|
* \brief Affiche le total <EFBFBD> payer
|
||||||
* \param pdf objet PDF
|
* \param pdf objet PDF
|
||||||
* \param fac objet facture
|
* \param fac objet facture
|
||||||
* \param deja_regle montant deja regle
|
* \param deja_regle montant deja regle
|
||||||
*/
|
*/
|
||||||
function _tableau_tot(&$pdf, $fac, $deja_regle, $outputlangs)
|
function _tableau_tot(&$pdf, $fac, $deja_regle, $posy, $outputlangs)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
@ -612,6 +737,8 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
$pdf->Text($this->marges['g']+163, $tab_top + 5,$outputlangs->transnoentities("Note"));
|
$pdf->Text($this->marges['g']+163, $tab_top + 5,$outputlangs->transnoentities("Note"));
|
||||||
}
|
}
|
||||||
$pdf->Text($this->marges['g']+175, $tab_top + 5, $outputlangs->transnoentities("TotalHT"));
|
$pdf->Text($this->marges['g']+175, $tab_top + 5, $outputlangs->transnoentities("TotalHT"));
|
||||||
|
|
||||||
|
return $pdf->GetY();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -665,8 +792,8 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
{
|
{
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200,0,0);
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
$pdf->MultiCell(80, 3, $langs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
$pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
|
||||||
$pdf->MultiCell(80, 3, $langs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
$pdf->MultiCell(80, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (defined("FAC_PDF_INTITULE"))
|
else if (defined("FAC_PDF_INTITULE"))
|
||||||
@ -724,11 +851,76 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
$pdf->SetXY($this->marges['g']+100,$posy-5);
|
$pdf->SetXY($this->marges['g']+100,$posy-5);
|
||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$fac->fetch_client();
|
$fac->fetch_client();
|
||||||
|
|
||||||
|
$object=$fac;
|
||||||
|
|
||||||
|
// If BILLING contact defined on invoice, we use it
|
||||||
|
$usecontact=false;
|
||||||
|
if ($conf->global->FACTURE_USE_BILL_CONTACT_AS_RECIPIENT)
|
||||||
|
{
|
||||||
|
$arrayidcontact=$object->getIdContact('external','BILLING');
|
||||||
|
if (sizeof($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$usecontact=true;
|
||||||
|
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($usecontact)
|
||||||
|
{
|
||||||
|
// On peut utiliser le nom de la societe du contact facturation
|
||||||
|
if ($conf->global->FACTURE_USE_COMPANY_NAME_OF_BILL_CONTACT) $socname = $object->contact->socname;
|
||||||
|
else $socname = $object->client->nom;
|
||||||
|
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||||
|
|
||||||
|
// Customer name
|
||||||
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
|
// Customer properties
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
|
//Pays si different de l'emetteur
|
||||||
|
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
||||||
|
{
|
||||||
|
$carac_client.=$outputlangs->convToOutputCharset($object->contact->pays)."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Nom client
|
||||||
|
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||||
|
|
||||||
|
// Nom du contact facturation si c'est une societe
|
||||||
|
$arrayidcontact = $object->getIdContact('external','BILLING');
|
||||||
|
if (sizeof($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
// On verifie si c'est une societe ou un particulier
|
||||||
|
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
||||||
|
{
|
||||||
|
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caracteristiques client
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->adresse);
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
||||||
|
|
||||||
|
//Pays si different de l'emetteur
|
||||||
|
if ($this->emetteur->pays_code != $object->client->pays_code)
|
||||||
|
{
|
||||||
|
$carac_client.=$outputlangs->convToOutputCharset($object->client->pays)."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Numero TVA intracom
|
||||||
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
||||||
|
|
||||||
|
// Show customer/recipient
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->SetXY($this->marges['g']+100,$posy+4);
|
$pdf->SetXY($this->marges['g']+100,$posy+4);
|
||||||
$pdf->MultiCell(86,4, $outputlangs->transnoentities($fac->client->nom), 0, 'L');
|
$pdf->MultiCell(86,4, $carac_client_name, 0, 'L');
|
||||||
$pdf->SetFont('Arial','B',10);
|
$pdf->SetFont('Arial','B',10);
|
||||||
$pdf->SetXY($this->marges['g']+100,$posy+12);
|
$pdf->SetXY($this->marges['g']+100,$posy+12);
|
||||||
$pdf->MultiCell(86,4, $outputlangs->transnoentities($fac->client->adresse) . "\n\n" . $outputlangs->transnoentities($fac->client->cp) . " " . $outputlangs->transnoentities($fac->client->ville));
|
$pdf->MultiCell(86,4, $carac_client);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ref facture
|
* ref facture
|
||||||
@ -773,16 +965,11 @@ class pdf_oursin extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Amount in (at tab_top - 1)
|
||||||
* monnaie
|
|
||||||
*/
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',10);
|
$pdf->SetFont('Arial','',10);
|
||||||
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||||
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre);
|
$pdf->Text(200 - $pdf->GetStringWidth($titre), 94, $titre);
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -298,7 +298,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
|||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',10);
|
$pdf->SetFont('Arial','',10);
|
||||||
// $titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentities("Currency".$conf->monnaie));
|
// $titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentitiesnoconv("Currency".$conf->monnaie));
|
||||||
// $pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
// $pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -351,7 +351,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
// Montants exprimes en (en tab_top - 1)
|
// Montants exprimes en (en tab_top - 1)
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
//$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
//$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("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);
|
||||||
|
|||||||
@ -438,10 +438,10 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* \brief Affiche infos divers
|
* \brief Affiche infos divers
|
||||||
* \param pdf Objet PDF
|
* \param pdf Objet PDF
|
||||||
* \param object Objet propale
|
* \param object Objet facture
|
||||||
* \param posy Position depart
|
* \param posy Position depart
|
||||||
* \param outputlangs Objet langs
|
* \param outputlangs Objet langs
|
||||||
* \return y Position pour suite
|
* \return y Position pour suite
|
||||||
@ -452,9 +452,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->SetFont('Arial','', 9);
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
/*
|
// If France, show VAT mention if not applicable
|
||||||
* If France, show VAT mention if not applicable
|
|
||||||
*/
|
|
||||||
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
|
||||||
{
|
{
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
@ -464,10 +462,8 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$posy=$pdf->GetY()+4;
|
$posy=$pdf->GetY()+4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Show payments conditions
|
||||||
* Conditions de reglements
|
if ($object->type != 2 && ($object->cond_reglement_code || $object->cond_reglement))
|
||||||
*/
|
|
||||||
if ($object->cond_reglement_code || $object->cond_reglement)
|
|
||||||
{
|
{
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
@ -482,10 +478,13 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$posy=$pdf->GetY()+3;
|
$posy=$pdf->GetY()+3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check si absence mode reglement
|
if ($object->type != 2)
|
||||||
*/
|
{
|
||||||
if (! $conf->global->FACTURE_CHQ_NUMBER && ! $conf->global->FACTURE_RIB_NUMBER)
|
// Check a payment mode is defined
|
||||||
|
if (empty($object->mode_reglement_code)
|
||||||
|
&& ! $conf->global->FACTURE_CHQ_NUMBER
|
||||||
|
&& ! $conf->global->FACTURE_RIB_NUMBER)
|
||||||
{
|
{
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200,0,0);
|
||||||
@ -496,10 +495,25 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$posy=$pdf->GetY()+1;
|
$posy=$pdf->GetY()+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// Sown payment mode
|
||||||
* Propose mode reglement par CHQ
|
if ($object->mode_reglement_code
|
||||||
*/
|
&& $object->mode_reglement_code != 'CHQ'
|
||||||
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'CHQ')
|
&& $object->mode_reglement_code != 'VIR')
|
||||||
|
{
|
||||||
|
$pdf->SetFont('Arial','B',8);
|
||||||
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
|
$titre = $outputlangs->transnoentities("PaymentMode").':';
|
||||||
|
$pdf->MultiCell(80, 5, $titre, 0, 'L');
|
||||||
|
$pdf->SetFont('Arial','',8);
|
||||||
|
$pdf->SetXY(50, $posy);
|
||||||
|
$lib_mode_reg=$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code)!=('PaymentMode'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentMode".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
|
||||||
|
$pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
|
||||||
|
|
||||||
|
$posy=$pdf->GetY()+2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show payment mode CHQ
|
||||||
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a CHQ
|
// Si mode reglement non force ou si force a CHQ
|
||||||
if ($conf->global->FACTURE_CHQ_NUMBER)
|
if ($conf->global->FACTURE_CHQ_NUMBER)
|
||||||
@ -517,7 +531,6 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
if ($conf->global->FACTURE_CHQ_NUMBER == -1)
|
||||||
@ -529,22 +542,16 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche, $posy);
|
$pdf->SetXY($this->marge_gauche, $posy);
|
||||||
$pdf->SetFont('Arial','',8);
|
$pdf->SetFont('Arial','',8);
|
||||||
$pdf->MultiCell(80, 6, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
$pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
|
||||||
|
|
||||||
$posy=$pdf->GetY()+2;
|
$posy=$pdf->GetY()+2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// If payment mode not forced or forced to VIR, show payment with BAN
|
||||||
* Propose mode reglement par RIB
|
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
|
||||||
*/
|
|
||||||
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'VIR')
|
|
||||||
{
|
{
|
||||||
// Si mode reglement non force ou si force a VIR
|
if (! empty($conf->global->FACTURE_RIB_NUMBER))
|
||||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
|
||||||
{
|
|
||||||
if ($conf->global->FACTURE_RIB_NUMBER)
|
|
||||||
{
|
{
|
||||||
$account = new Account($this->db);
|
$account = new Account($this->db);
|
||||||
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
$account->fetch($conf->global->FACTURE_RIB_NUMBER);
|
||||||
@ -580,7 +587,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$pdf->SetFont('Arial','', 9);
|
$pdf->SetFont('Arial','', 9);
|
||||||
|
|
||||||
// Tableau total
|
// Tableau total
|
||||||
$lltot = 200; $col1x = 120; $col2x = 182; $largcol2 = $lltot - $col2x;
|
$lltot = 200; $col1x = 120; $col2x = 170; $largcol2 = $lltot - $col2x;
|
||||||
|
|
||||||
// Total HT
|
// Total HT
|
||||||
$pdf->SetFillColor(255,255,255);
|
$pdf->SetFillColor(255,255,255);
|
||||||
@ -695,7 +702,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
// 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 = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("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);
|
||||||
@ -894,10 +901,10 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
if ($usecontact)
|
if ($usecontact)
|
||||||
{
|
{
|
||||||
// Nom societe
|
// On peut utiliser le nom de la societe du contact
|
||||||
$pdf->SetXY(102,$posy+3);
|
if ($conf->global->PROPALE_USE_COMPANY_NAME_OF_CUSTOMER_CONTACT) $socname = $object->contact->socname;
|
||||||
$pdf->SetFont('Arial','B',11);
|
else $socname = $object->client->nom;
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
$carac_client_name=$outputlangs->convToOutputCharset($socname);
|
||||||
|
|
||||||
// Nom client
|
// Nom client
|
||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
@ -914,9 +921,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nom client
|
// Nom client
|
||||||
$pdf->SetXY(102,$posy+3);
|
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
|
||||||
|
|
||||||
// Nom du contact suivi propal si c'est une société
|
// Nom du contact suivi propal si c'est une société
|
||||||
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
||||||
@ -942,6 +947,12 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
// Numéro TVA intracom
|
// Numéro TVA intracom
|
||||||
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
||||||
|
|
||||||
|
// Show customer/recipient
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('Arial','',9);
|
$pdf->SetFont('Arial','',9);
|
||||||
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
$pdf->SetXY(102,$posy+6);
|
$pdf->SetXY(102,$posy+6);
|
||||||
|
|||||||
@ -572,7 +572,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Montants exprim<69>s en (en tab_top - 1
|
// Montants exprim<69>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 = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentities("Currency".$conf->monnaie));
|
$titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("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);
|
||||||
@ -690,7 +690,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($mysoc->nom), 0, 'L');
|
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($mysoc->nom), 0, 'L');
|
||||||
|
|
||||||
// Caract<EFBFBD>ristiques emetteur
|
// Caracteristiques emetteur
|
||||||
$carac_emetteur = '';
|
$carac_emetteur = '';
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($mysoc->adresse);
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($mysoc->adresse);
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($mysoc->cp).' '.$outputlangs->convToOutputCharset($mysoc->ville);
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($mysoc->cp).' '.$outputlangs->convToOutputCharset($mysoc->ville);
|
||||||
@ -723,17 +723,22 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Cadre client destinataire
|
// Cadre client destinataire
|
||||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||||
|
|
||||||
// Nom client
|
$carac_client_name = $outputlangs->convToOutputCharset($object->client->nom);
|
||||||
$pdf->SetXY(102,$posy+3);
|
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->MultiCell(106,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
|
||||||
|
|
||||||
// Caract<63>ristiques client
|
|
||||||
$carac_client=$outputlangs->convToOutputCharset($object->client->adresse);
|
$carac_client=$outputlangs->convToOutputCharset($object->client->adresse);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
||||||
|
|
||||||
|
// Numero TVA intracom
|
||||||
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($object->client->tva_intra);
|
||||||
|
|
||||||
|
// Show customer/recipient
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||||
|
|
||||||
$pdf->SetFont('Arial','',9);
|
$pdf->SetFont('Arial','',9);
|
||||||
$pdf->SetXY(102,$posy+8);
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
|
$pdf->SetXY(102,$posy+6);
|
||||||
$pdf->MultiCell(86,4, $carac_client);
|
$pdf->MultiCell(86,4, $carac_client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -672,7 +672,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account)
|
|||||||
{
|
{
|
||||||
$pdf->SetXY ($curx, $cury);
|
$pdf->SetXY ($curx, $cury);
|
||||||
$pdf->SetFont('Arial','B',8);
|
$pdf->SetFont('Arial','B',8);
|
||||||
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0);
|
||||||
$cury+=4;
|
$cury+=4;
|
||||||
|
|
||||||
$usedetailedbban=$account->useDetailedBBAN();
|
$usedetailedbban=$account->useDetailedBBAN();
|
||||||
|
|||||||
@ -2079,24 +2079,25 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Fonction qui retourne un numerique conforme SQL, depuis un montant issu d'une saisie
|
* \brief Function that return a number with universal decimal format (decimal separator is '.') from
|
||||||
* utilisateur.
|
* an amount typed by a user.
|
||||||
* \remarks Fonction a appeler sur montants saisis avant un insert en base
|
* \remarks Function to use on each input amount before any numeric test or database insert.
|
||||||
* \param amount Montant a formater
|
* \param amount Amount to convert/clean
|
||||||
* \param rounding 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
|
* \param rounding ''=No rounding
|
||||||
|
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
|
||||||
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
|
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
|
||||||
* 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN)
|
* 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN)
|
||||||
* ''=No rounding
|
* \param alreadysqlnb Put 1 if you know that content is already universal format number
|
||||||
* \return string Montant au format numerique universel et SQL (Exemple: '99.99999')
|
* \return string Amount with universal numeric format (Example: '99.99999')
|
||||||
* \seealso price Fonction inverse de price2num
|
* \seealso price Opposite function of price2num
|
||||||
*/
|
*/
|
||||||
function price2num($amount,$rounding='',$alreadysqlnb=-1)
|
function price2num($amount,$rounding='',$alreadysqlnb=0)
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
// Round PHP function does not allow number like '1,234.56' nor '1.234,56' nor '1 234,56'
|
// Round PHP function does not allow number like '1,234.56' nor '1.234,56' nor '1 234,56'
|
||||||
// Numbers must be '1234.56'
|
// Numbers must be '1234.56'
|
||||||
// Decimal delimiter for database SQL request must be '.'
|
// Decimal delimiter for PHP and database SQL requests must be '.'
|
||||||
$dec=','; $thousand=' ';
|
$dec=','; $thousand=' ';
|
||||||
if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal");
|
if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal");
|
||||||
if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand");
|
if ($langs->trans("SeparatorThousand")!= "SeparatorThousand") $thousand=$langs->trans("SeparatorThousand");
|
||||||
@ -2122,7 +2123,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1)
|
|||||||
$amount=str_replace($dec,'.',$amount);
|
$amount=str_replace($dec,'.',$amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now if rounding required
|
// Now, make a rounding if required
|
||||||
if ($rounding)
|
if ($rounding)
|
||||||
{
|
{
|
||||||
$nbofdectoround='';
|
$nbofdectoround='';
|
||||||
|
|||||||
@ -382,7 +382,7 @@ class Translate {
|
|||||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
* et si toujours pas trouve, il est retourne tel quel.
|
* et si toujours pas trouve, il est retourne tel quel.
|
||||||
* Parameters of this method must not contains any HTML tags.
|
* Parameters of this method must not contains any HTML tags.
|
||||||
* \param key cl<EFBFBD> de chaine a traduire
|
* \param key key of string to translate
|
||||||
* \param param1 chaine de param1
|
* \param param1 chaine de param1
|
||||||
* \param param2 chaine de param1
|
* \param param2 chaine de param1
|
||||||
* \param param3 chaine de param1
|
* \param param3 chaine de param1
|
||||||
@ -401,6 +401,30 @@ class Translate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Return translated value of a text string
|
||||||
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
|
* et si toujours pas trouve, il est retourne tel quel.
|
||||||
|
* Parameters of this method must not contains any HTML tags.
|
||||||
|
* \param key key of string to translate
|
||||||
|
* \param param1 chaine de param1
|
||||||
|
* \param param2 chaine de param1
|
||||||
|
* \param param3 chaine de param1
|
||||||
|
* \param param4 chaine de param1
|
||||||
|
* \return string chaine traduite
|
||||||
|
*/
|
||||||
|
function transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='')
|
||||||
|
{
|
||||||
|
$newstr=$key;
|
||||||
|
if ($this->getTransFromTab($newstr))
|
||||||
|
{
|
||||||
|
// Si la traduction est disponible
|
||||||
|
$newstr=sprintf($this->tab_translate[$newstr],$param1,$param2,$param3,$param4);
|
||||||
|
}
|
||||||
|
return $newstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la version traduite du texte passe en parametre complete du code pays
|
* \brief Retourne la version traduite du texte passe en parametre complete du code pays
|
||||||
* \param str chaine a traduire
|
* \param str chaine a traduire
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user