Fix: Miscellanous fix on i18n

This commit is contained in:
Laurent Destailleur 2009-01-25 16:45:04 +00:00
parent 5f50893b48
commit 6da0d25acc
13 changed files with 1134 additions and 906 deletions

View File

@ -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>
* *
@ -40,7 +40,7 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/facture/paiementfourn.class.php");
if (!$user->rights->banque->lire) if (!$user->rights->banque->lire)
accessforbidden(); accessforbidden();
$langs->load("bills"); $langs->load("bills");
@ -57,15 +57,16 @@ if ($negpage)
$mesg=''; $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"]);
} }
@ -83,7 +84,7 @@ if ($_POST["action"] == 'add' && $account && ! isset($_POST["cancel"]) && $user-
if (! $dateop) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date")); if (! $dateop) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
if (! $operation) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); if (! $operation) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
if (! $amount) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount")); if (! $amount) $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
if (! $mesg) if (! $mesg)
{ {
$acct=new Account($db,$account); $acct=new Account($db,$account);
@ -137,11 +138,11 @@ if ($account || $_GET["ref"])
$viewline = 20; $viewline = 20;
} }
$acct = new Account($db); $acct = new Account($db);
if ($account) if ($account)
{ {
$result=$acct->fetch($account); $result=$acct->fetch($account);
} }
if ($_GET["ref"]) if ($_GET["ref"])
{ {
$result=$acct->fetch(0,$_GET["ref"]); $result=$acct->fetch(0,$_GET["ref"]);
$account=$acct->id; $account=$acct->id;
@ -169,7 +170,7 @@ if ($account || $_GET["ref"])
$db->free($result); $db->free($result);
} }
// Definition de sql_rech et param // Definition de sql_rech et param
$param=''; $param='';
$sql_rech=''; $sql_rech='';
@ -207,7 +208,7 @@ if ($account || $_GET["ref"])
} }
$sql.= " WHERE b.fk_account=".$acct->id; $sql.= " WHERE b.fk_account=".$acct->id;
$sql.= $sql_rech; $sql.= $sql_rech;
dolibarr_syslog("account.php count transactions - sql=".$sql); dolibarr_syslog("account.php count transactions - sql=".$sql);
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)
@ -249,7 +250,7 @@ if ($account || $_GET["ref"])
// Onglets // Onglets
$head=bank_prepare_head($acct); $head=bank_prepare_head($acct);
dolibarr_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0); dolibarr_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0);
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
@ -265,10 +266,10 @@ if ($account || $_GET["ref"])
print '</table>'; print '</table>';
print '<br>'; print '<br>';
if ($mesg) print '<div class="error">'.$mesg.'</div>'; if ($mesg) print '<div class="error">'.$mesg.'</div>';
/** /**
* Search form * Search form
*/ */
@ -296,7 +297,7 @@ if ($account || $_GET["ref"])
} }
$navig.='</form>'; $navig.='</form>';
// Confirmation delete // Confirmation delete
if ($_GET["action"]=='delete') if ($_GET["action"]=='delete')
{ {
@ -314,8 +315,8 @@ if ($account || $_GET["ref"])
print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>'; print '<tr><td colspan="9" align="right">'.$navig.'</td></tr>';
} }
// 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").'">';
@ -446,10 +447,10 @@ if ($account || $_GET["ref"])
$time = time(); $time = time();
$var=true; $var=true;
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $total = 0; $sep = 0; $i = 0; $total = 0; $sep = 0;
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@ -457,7 +458,7 @@ if ($account || $_GET["ref"])
if ($i >= ($nbline - $viewline)) if ($i >= ($nbline - $viewline))
{ {
$var=!$var; $var=!$var;
if ($objp->do > $time && !$sep) if ($objp->do > $time && !$sep)
{ {
$sep = 1 ; $sep = 1 ;
@ -466,20 +467,20 @@ if ($account || $_GET["ref"])
print "<td>&nbsp;</td>"; print "<td>&nbsp;</td>";
print '</tr>'; print '</tr>';
} }
print "<tr $bc[$var]>"; print "<tr $bc[$var]>";
print "<td nowrap>".dolibarr_print_date($objp->do,"day")."</td>\n"; print "<td nowrap>".dolibarr_print_date($objp->do,"day")."</td>\n";
print "<td nowrap>&nbsp;".dolibarr_print_date($objp->dv,"day")."</td>\n"; print "<td nowrap>&nbsp;".dolibarr_print_date($objp->dv,"day")."</td>\n";
print "<td nowrap>&nbsp;".$langs->trans($objp->fk_type)." ".($objp->num_chq?$objp->num_chq:"")."</td>\n"; print "<td nowrap>&nbsp;".$langs->trans($objp->fk_type)." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
// Description // Description
print '<td>'; print '<td>';
$links = $acct->get_url($objp->rowid); $links = $acct->get_url($objp->rowid);
$isbanktransfert=false; $isbanktransfert=false;
foreach($links as $key=>$val) { if ($val['type']=='banktransfert') $isbanktransfert=true; } foreach($links as $key=>$val) { if ($val['type']=='banktransfert') $isbanktransfert=true; }
$issocialcontrib=false; $issocialcontrib=false;
@ -492,11 +493,11 @@ if ($account || $_GET["ref"])
{ {
if (eregi('^\((.*)\)$',$objp->label,$reg)) if (eregi('^\((.*)\)$',$objp->label,$reg))
{ {
// Genereic description because between (). We show it after translating. // Genereic description because between (). We show it after translating.
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
else else
{ {
print dolibarr_trunc($objp->label,60); print dolibarr_trunc($objp->label,60);
} }
} }
@ -520,7 +521,7 @@ if ($account || $_GET["ref"])
$chargestatic->ref=$links[$key]['url_id']; $chargestatic->ref=$links[$key]['url_id'];
print ' '.$chargestatic->getNomUrl(2); print ' '.$chargestatic->getNomUrl(2);
} }
else if ($links[$key]['type']=='payment_sc') else if ($links[$key]['type']=='payment_sc')
{ {
//print ' - '; //print ' - ';
/* /*
@ -530,7 +531,7 @@ if ($account || $_GET["ref"])
print '</a>'; print '</a>';
*/ */
} }
else if ($links[$key]['type']=='payment_vat') else if ($links[$key]['type']=='payment_vat')
{ {
$paymentvatstatic->id=$links[$key]['url_id']; $paymentvatstatic->id=$links[$key]['url_id'];
$paymentvatstatic->ref=$links[$key]['url_id']; $paymentvatstatic->ref=$links[$key]['url_id'];
@ -546,12 +547,12 @@ if ($account || $_GET["ref"])
print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">'; print '<a href="'.$links[$key]['url'].$links[$key]['url_id'].'">';
if (eregi('^\((.*)\)$',$links[$key]['label'],$reg)) if (eregi('^\((.*)\)$',$links[$key]['label'],$reg))
{ {
// Label générique car entre parenthèses. On l'affiche en le traduisant // Label générique car entre parenthèses. On l'affiche en le traduisant
if ($reg[1]=='paiement') $reg[1]='Payment'; if ($reg[1]=='paiement') $reg[1]='Payment';
print $langs->trans($reg[1]); print $langs->trans($reg[1]);
} }
else else
{ {
print $links[$key]['label']; print $links[$key]['label'];
} }
print '</a>'; print '</a>';
@ -589,7 +590,7 @@ if ($account || $_GET["ref"])
} }
} }
print '</td>'; print '</td>';
if ($objp->amount < 0) if ($objp->amount < 0)
{ {
print "<td align=\"right\" nowrap>".price($objp->amount * -1)."</td><td>&nbsp;</td>\n"; print "<td align=\"right\" nowrap>".price($objp->amount * -1)."</td><td>&nbsp;</td>\n";
@ -598,7 +599,7 @@ if ($account || $_GET["ref"])
{ {
print "<td>&nbsp;</td><td align=\"right\" nowrap>&nbsp;".price($objp->amount)."</td>\n"; print "<td>&nbsp;</td><td align=\"right\" nowrap>&nbsp;".price($objp->amount)."</td>\n";
} }
if ($action != 'search') if ($action != 'search')
{ {
if ($total >= 0) if ($total >= 0)
@ -614,7 +615,7 @@ if ($account || $_GET["ref"])
{ {
print '<td align="right">-</td>'; print '<td align="right">-</td>';
} }
// Relevé rappro ou lien edition // Relevé rappro ou lien edition
if ($objp->rappro && $acct->type != 2) // Si non compte cash if ($objp->rappro && $acct->type != 2) // Si non compte cash
{ {
@ -650,14 +651,14 @@ if ($account || $_GET["ref"])
} }
print '</td>'; print '</td>';
} }
print "</tr>"; print "</tr>";
} }
$i++; $i++;
} }
// Affichage total // Affichage total
if ($page == 0 && ! $mode_search) if ($page == 0 && ! $mode_search)
{ {

View File

@ -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);
} }

View File

@ -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,81 +467,89 @@ 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);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$posy=$pdf->GetY()+1; $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
* Propose mode reglement par CHQ if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
*/ {
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'CHQ') if (! empty($conf->global->FACTURE_RIB_NUMBER))
{ {
// Si mode reglement non force ou si force a CHQ $account = new Account($this->db);
if ($conf->global->FACTURE_CHQ_NUMBER) $account->fetch($conf->global->FACTURE_RIB_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); $curx=$this->marge_gauche;
$pdf->SetFont('Arial','B',8); $cury=$posy;
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$outputlangs->convToOutputCharset($account->proprio)).':',0,'L',0);
$posy=$pdf->GetY()+1;
$pdf->SetXY($this->marge_gauche, $posy); $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$pdf->SetFont('Arial','',8);
$pdf->MultiCell(80, 3, $account->adresse_proprio, 0, 'L', 0);
$posy=$pdf->GetY()+2; $posy+=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, 6, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
$posy=$pdf->GetY()+2;
}
}
}
/*
* Propose mode reglement par RIB
*/
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'VIR')
{
// Si mode reglement non force ou si force a VIR
if ($conf->global->FACTURE_RIB_NUMBER)
{
if ($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; 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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
} }

View File

@ -1,8 +1,8 @@
<?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>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -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>";
$prodser = new Product($this->db); if ($fac->lignes[$i]->desc == '(CREDIT_NOTE)' && $fac->lignes[$i]->fk_remise_except)
{
$prodser->fetch($fac->lignes[$i]->produit_id); $discount=new DiscountAbsolute($this->db);
if ($prodser->ref) { $discount->fetch($fac->lignes[$i]->fk_remise_except);
$codeproduitservice=" - ".$outputlangs->transnoentities("ProductCode")." ".$prodser->ref; $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);
}
} }
} }
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
// Affichage dur<75>e si il y en a une // Si ligne associee a un code produit
$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).")"; if ($fac->lignes[$i]->produit_id)
{
$prodser = new Product($this->db);
$prodser->fetch($fac->lignes[$i]->produit_id);
// On ajoute la ref
if ($prodser->ref)
{
$prefix_prodserv = "";
if($prodser->isservice())
{
$prefix_prodserv = $outputlangs->transnoentities("Service")." ";
}
else
{
$prefix_prodserv = $outputlangs->transnoentities("Product")." ";
}
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
}
} }
$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");
@ -537,47 +662,47 @@ class pdf_oursin extends ModelePDFFactures
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 0); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc), 0, 'R', 0);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$creditnoteamount=$fac->getSommeCreditNote(); $creditnoteamount=$fac->getSommeCreditNote();
$resteapayer = $fac->total_ttc - $deja_regle - $creditnoteamount; $resteapayer = $fac->total_ttc - $deja_regle - $creditnoteamount;
if ($object->paye) $resteapayer=0; if ($object->paye) $resteapayer=0;
if ($deja_regle > 0 || $creditnoteamount > 0) if ($deja_regle > 0 || $creditnoteamount > 0)
{ {
$pdf->SetFont('Arial','', 10); $pdf->SetFont('Arial','', 10);
// Already payed // Already payed
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPayed"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPayed"), 0, 'L', 0);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0); $pdf->MultiCell(26, $tab2_hl, price($deja_regle), 0, 'R', 0);
// Credit note // Credit note
if ($creditnoteamount) if ($creditnoteamount)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 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($creditnoteamount), 0, 'R', 0); $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount), 0, 'R', 0);
} }
$resteapayer = $object->total_ttc - $deja_regle - $creditnoteamount; $resteapayer = $object->total_ttc - $deja_regle - $creditnoteamount;
if ($object->paye) $resteapayer=0; if ($object->paye) $resteapayer=0;
$index++; $index++;
$pdf->SetTextColor(0,0,60); $pdf->SetTextColor(0,0,60);
$pdf->SetFont('Arial','B', 11); $pdf->SetFont('Arial','B', 11);
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), 0, 'L', 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), 0, 'L', 0);
$pdf->SetFillColor(224,224,224); $pdf->SetFillColor(224,224,224);
$pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc - $deja_regle), 0, 'R', 0); $pdf->MultiCell(26, $tab2_hl, price($fac->total_ttc - $deja_regle), 0, 'R', 0);
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
} }
$index++; $index++;
return ($tab2_top + ($tab2_hl * $index)); return ($tab2_top + ($tab2_hl * $index));
} }
/* /*
@ -605,13 +730,15 @@ class pdf_oursin extends ModelePDFFactures
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
if ($fac->lignes[$i]->remise_percent) if ($fac->lignes[$i]->remise_percent)
{ {
$rem=1; $rem=1;
} }
if ($rem==1) if ($rem==1)
{ {
$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();
} }
/* /*
@ -656,18 +783,18 @@ class pdf_oursin extends ModelePDFFactures
if ($this->emetteur->logo) if ($this->emetteur->logo)
{ {
if (is_readable($logo)) if (is_readable($logo))
{ {
$taille=getimagesize($logo); $taille=getimagesize($logo);
$longueur=$taille[0]/2.835; $longueur=$taille[0]/2.835;
$pdf->Image($logo, $this->marges['g'], $this->marges['h'], 0, 24); $pdf->Image($logo, $this->marges['g'], $this->marges['h'], 0, 24);
} }
else else
{ {
$pdf->SetTextColor(200,0,0); $pdf->SetTextColor(200,0,0);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(80, 3, $langs->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);
/*
*/
} }
/* /*

View File

@ -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);
} }

View File

@ -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);

View File

@ -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,79 +478,90 @@ class pdf_propale_azur extends ModelePDFPropales
$posy=$pdf->GetY()+3; $posy=$pdf->GetY()+3;
} }
/*
* Check si absence mode reglement
*/
if (! $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; if ($object->type != 2)
}
/*
* Propose mode reglement par CHQ
*/
if (! $object->mode_reglement_code || $object->mode_reglement_code == 'CHQ')
{ {
// Si mode reglement non force ou si force a CHQ // Check a payment mode is defined
if ($conf->global->FACTURE_CHQ_NUMBER) if (empty($object->mode_reglement_code)
&& ! $conf->global->FACTURE_CHQ_NUMBER
&& ! $conf->global->FACTURE_RIB_NUMBER)
{ {
if ($conf->global->FACTURE_CHQ_NUMBER > 0) $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)
{ {
$account = new Account($this->db); if ($conf->global->FACTURE_CHQ_NUMBER > 0)
$account->fetch($conf->global->FACTURE_CHQ_NUMBER); {
$account = new Account($this->db);
$account->fetch($conf->global->FACTURE_CHQ_NUMBER);
$pdf->SetXY($this->marge_gauche, $posy); $pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('Arial','B',8); $pdf->SetFont('Arial','B',8);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$outputlangs->convToOutputCharset($account->proprio)).':',0,'L',0); $pdf->MultiCell(90, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$outputlangs->convToOutputCharset($account->proprio)).':',0,'L',0);
$posy=$pdf->GetY()+1; $posy=$pdf->GetY()+1;
$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;
}
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;
$posy=$pdf->GetY()+2; $pdf->SetXY($this->marge_gauche, $posy);
} $pdf->SetFont('Arial','',8);
if ($conf->global->FACTURE_CHQ_NUMBER == -1) $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->adresse_full), 0, 'L', 0);
{ $posy=$pdf->GetY()+2;
$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, 6, $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
* 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 ($conf->global->FACTURE_RIB_NUMBER)
{ {
if ($conf->global->FACTURE_RIB_NUMBER) if (! empty($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);
$curx=$this->marge_gauche; $curx=$this->marge_gauche;
$cury=$posy; $cury=$posy;
$posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account); $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account);
$posy+=2; $posy+=2;
} }
} }
} }
@ -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);

View File

@ -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);
} }
} }

View File

@ -345,7 +345,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
$actionstatic=new ActionComm($db); $actionstatic=new ActionComm($db);
$userstatic=new User($db); $userstatic=new User($db);
$contactstatic = new Contact($db); $contactstatic = new Contact($db);
if (is_object($objcon) && $objcon->id) print_titre($langs->trans("TasksHistoryForThisContact")); if (is_object($objcon) && $objcon->id) print_titre($langs->trans("TasksHistoryForThisContact"));
else print_titre($langs->trans("ActionsOnCompany")); else print_titre($langs->trans("ActionsOnCompany"));
@ -409,7 +409,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
$actionstatic->id=$obj->id; $actionstatic->id=$obj->id;
print '<td width="140">'.$actionstatic->getNomUrl(1,16).'</td>'; print '<td width="140">'.$actionstatic->getNomUrl(1,16).'</td>';
} }
print '<td colspan="2">'.$obj->label.'</td>'; print '<td colspan="2">'.$obj->label.'</td>';
// Contact pour cette action // Contact pour cette action
@ -424,7 +424,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
print '<td width="80" nowrap="nowrap">'; print '<td width="80" nowrap="nowrap">';
$userstatic->id=$obj->fk_user_author; $userstatic->id=$obj->fk_user_author;
$userstatic->login=$obj->login; $userstatic->login=$obj->login;
@ -441,7 +441,7 @@ function show_actions_todo($conf,$langs,$db,$objsoc,$objcon='')
else else
{ {
// Aucun action a faire // Aucun action a faire
} }
$db->free($result); $db->free($result);
} }
@ -605,7 +605,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
// Note // Note
print '<td>'.dolibarr_trunc($histo[$key]['note'], 30).'</td>'; print '<td>'.dolibarr_trunc($histo[$key]['note'], 30).'</td>';
// Objet lie // Objet lie
print '<td>'; print '<td>';
if ($histo[$key]['pid'] && $conf->propal->enabled) if ($histo[$key]['pid'] && $conf->propal->enabled)
@ -642,7 +642,7 @@ function show_actions_done($conf,$langs,$db,$objsoc,$objcon='')
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }
// Auteur // Auteur
print '<td nowrap="nowrap" width="80">'; print '<td nowrap="nowrap" width="80">';
$userstatic->id=$histo[$key]['userid']; $userstatic->id=$histo[$key]['userid'];
@ -672,11 +672,11 @@ 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();
if ($usedetailedbban) if ($usedetailedbban)
{ {
$pdf->SetFont('Arial','B',6); $pdf->SetFont('Arial','B',6);
@ -693,7 +693,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account)
$pdf->SetXY ($curx+60, $cury); $pdf->SetXY ($curx+60, $cury);
$pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0); $pdf->MultiCell(13, 3, $outputlangs->transnoentities("BankAccountNumberKey"), 0, 'C', 0);
$pdf->line($curx+73, $cury, $curx+73, $cury+10 ); $pdf->line($curx+73, $cury, $curx+73, $cury+10 );
$pdf->SetFont('Arial','',8); $pdf->SetFont('Arial','',8);
$pdf->SetXY ($curx, $cury+6); $pdf->SetXY ($curx, $cury+6);
$pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0); $pdf->MultiCell(18, 3, $outputlangs->convToOutputCharset($account->code_banque), 0, 'C', 0);
@ -711,7 +711,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account)
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->transnoentities("BankAccountNumber").': ' . $outputlangs->convToOutputCharset($account->number), 0, 'L', 0);
$cury-=9; $cury-=9;
} }
$pdf->SetXY ($curx, $cury+12); $pdf->SetXY ($curx, $cury+12);
$pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0); $pdf->MultiCell(90, 3, $outputlangs->transnoentities("Residence").': ' . $outputlangs->convToOutputCharset($account->domiciliation), 0, 'L', 0);
$pdf->SetXY ($curx, $cury+22); $pdf->SetXY ($curx, $cury+22);

View File

@ -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
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) * 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
* 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN) * 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
* ''=No rounding * 'MS'=Round to Max Shown (MAIN_MAX_DECIMALS_SHOWN)
* \return string Montant au format numerique universel et SQL (Exemple: '99.99999') * \param alreadysqlnb Put 1 if you know that content is already universal format number
* \seealso price Fonction inverse de price2num * \return string Amount with universal numeric format (Example: '99.99999')
* \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='';

View File

@ -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