New: changes to support UTF-8 output format
This commit is contained in:
parent
29a4af0177
commit
dd3d8084b8
@ -79,6 +79,9 @@ class CommActionRapport
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -80,6 +80,9 @@ Class pdf_expedition_merou extends ModelePdfExpedition
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -121,6 +121,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition
|
||||
global $user,$conf,$langs;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -111,6 +111,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -86,9 +86,12 @@ class pdf_edison extends ModelePDFCommandes
|
||||
*/
|
||||
function write_file($com,$outputlangs='')
|
||||
{
|
||||
global $user,$conf,$langs,$mysco;
|
||||
global $user,$conf,$langs,$mysoc;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -109,6 +109,9 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -110,6 +110,9 @@ class pdf_crabe extends ModelePDFFactures
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -94,6 +94,9 @@ class pdf_huitre extends ModelePDFFactures
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -98,6 +98,9 @@ class pdf_oursin extends ModelePDFFactures
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("companies");
|
||||
$outputlangs->load("bills");
|
||||
|
||||
@ -83,6 +83,9 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
global $user,$langs,$conf,$mysoc;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -109,6 +109,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -94,6 +94,9 @@ class pdf_propale_jaune extends ModelePDFPropales
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
|
||||
@ -101,7 +101,7 @@ function unaccent_isostring($str)
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Nettoie chaine de caractere de caracteres speciaux
|
||||
* \brief Nettoie chaine de caractere de ces caracteres speciaux
|
||||
* \remarks Fonction appelee par exemple pour definir un nom de fichier depuis un identifiant chaine libre
|
||||
* \param str String to clean
|
||||
* \param newstr String to replace bad chars by
|
||||
@ -403,19 +403,20 @@ function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
|
||||
|
||||
|
||||
/**
|
||||
* \brief Formattage de la date en fonction de la langue $conf->langage
|
||||
* \param time GM Timestamps date (or 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' in server TZ)
|
||||
* \param format Output date format
|
||||
* "%d %b %Y",
|
||||
* "%d/%m/%Y %H:%M",
|
||||
* "%d/%m/%Y %H:%M:%S",
|
||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext"
|
||||
* \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users
|
||||
* \return string Formated date or '' if time is null
|
||||
* \brief Output date in a string format according to language $conf->language
|
||||
* \param time GM Timestamps date (or 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' in server TZ)
|
||||
* \param format Output date format
|
||||
* "%d %b %Y",
|
||||
* "%d/%m/%Y %H:%M",
|
||||
* "%d/%m/%Y %H:%M:%S",
|
||||
* "day", "daytext", "dayhour", "dayhourldap", "dayhourtext"
|
||||
* \param to_gmt false=output string if for local server TZ users, true=output string is for GMT users
|
||||
* \param convtooutput true=Output string is encoded into encoding defined into $langs->charset_output.
|
||||
* \return string Formated date or '' if time is null
|
||||
*/
|
||||
function dolibarr_print_date($time,$format='',$to_gmt=false)
|
||||
function dolibarr_print_date($time,$format='',$to_gmt=false,$convtooutput=true)
|
||||
{
|
||||
global $conf;
|
||||
global $conf,$langs;
|
||||
|
||||
// Si format non defini, on prend $conf->format_date_text_short sinon %Y-%m-%d %H:%M:%S
|
||||
if (! $format) $format=(isset($conf->format_date_text_short) ? $conf->format_date_text_short : '%Y-%m-%d %H:%M:%S');
|
||||
@ -448,13 +449,14 @@ function dolibarr_print_date($time,$format='',$to_gmt=false)
|
||||
$smin = $reg[5];
|
||||
$ssec = $reg[6];
|
||||
|
||||
return adodb_strftime($format,dolibarr_mktime($shour,$smin,$ssec,$smonth,$sday,$syear),$to_gmt);
|
||||
$ret=adodb_strftime($format,dolibarr_mktime($shour,$smin,$ssec,$smonth,$sday,$syear),$to_gmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Date is a timestamps
|
||||
return adodb_strftime($format,$time,$to_gmt);
|
||||
$ret=adodb_strftime($format,$time,$to_gmt);
|
||||
}
|
||||
return ($convtooutput?$langs->convToOuptutCharset($ret):$ret);
|
||||
}
|
||||
|
||||
|
||||
@ -2794,13 +2796,13 @@ function make_substitutions($chaine,$substitutionarray)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* \brief Formate l'affichage de date de d<EFBFBD>but et de fin
|
||||
* \param date_start date de d<EFBFBD>but
|
||||
* \param date_end date de fin
|
||||
* \param format format de l'affichage
|
||||
* \remarks Updated by Matelli : added format paramter
|
||||
* \remarks See http://matelli.fr/showcases/patchs-dolibarr/update-date-range-format.html for details
|
||||
/**
|
||||
* \brief Format output for start and end date
|
||||
* \param date_start Start date
|
||||
* \param date_end End date
|
||||
* \param format Output format
|
||||
* \remarks Updated by Matelli : added format paramter
|
||||
* \remarks See http://matelli.fr/showcases/patchs-dolibarr/update-date-range-format.html for details
|
||||
*/
|
||||
function print_date_range($date_start,$date_end,$format = '')
|
||||
{
|
||||
@ -2808,15 +2810,15 @@ function print_date_range($date_start,$date_end,$format = '')
|
||||
|
||||
if ($date_start && $date_end)
|
||||
{
|
||||
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format),dolibarr_print_date($date_end, $format)).')';
|
||||
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start, $format, false, false),dolibarr_print_date($date_end, $format, false, false)).')';
|
||||
}
|
||||
if ($date_start && ! $date_end)
|
||||
{
|
||||
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start), $format).')';
|
||||
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start, $format, false, false)).')';
|
||||
}
|
||||
if (! $date_start && $date_end)
|
||||
{
|
||||
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end), $format).')';
|
||||
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end, $format, false, false)).')';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,9 +41,14 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
/** \brief Constructor
|
||||
* \param db Database handler
|
||||
*/
|
||||
function pdf_sirocco($db=0)
|
||||
function pdf_sirocco($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
global $conf,$langs,$mysoc;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
|
||||
$this->db = $db;
|
||||
$this->name = "sirocco";
|
||||
$this->description = "Modele de bon de réception livraison simple";
|
||||
|
||||
@ -57,6 +62,10 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$this->marge_haute=10;
|
||||
$this->marge_basse=10;
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'était pas défini
|
||||
|
||||
$this->error = "";
|
||||
}
|
||||
|
||||
@ -80,10 +89,16 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
{
|
||||
global $user,$conf,$langs;
|
||||
|
||||
$langs->load("main");
|
||||
$langs->load("bills");
|
||||
$langs->load("products");
|
||||
$langs->load("deliveries");
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("bills");
|
||||
$outputlangs->load("products");
|
||||
$outputlangs->load("deliveries");
|
||||
|
||||
$outputlangs->setPhpLang();
|
||||
|
||||
if ($conf->livraison_bon->dir_output)
|
||||
{
|
||||
@ -134,7 +149,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
$pdf->AddPage();
|
||||
|
||||
$pdf->SetTitle($delivery->ref);
|
||||
$pdf->SetSubject($langs->transnoentities("DeliveryOrder"));
|
||||
$pdf->SetSubject($outputlangs->transnoentities("DeliveryOrder"));
|
||||
$pdf->SetCreator("Dolibarr ".DOL_VERSION);
|
||||
$pdf->SetAuthor($user->fullname);
|
||||
|
||||
@ -158,7 +173,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
for ($i = 0 ; $i < $nblignes ; $i++)
|
||||
{
|
||||
$curY = $nexY;
|
||||
$curY = $nexY;
|
||||
|
||||
// Description de la ligne produit
|
||||
$libelleproduitservice=dol_htmlentitiesbr($delivery->lignes[$i]->label,1);
|
||||
@ -178,11 +193,11 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
if($prodser->isservice())
|
||||
{
|
||||
// Un service peur aussi etre livre
|
||||
$prefix_prodserv = $langs->transnoentities("Service")." ";
|
||||
$prefix_prodserv = $outputlangs->transnoentities("Service")." ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$prefix_prodserv = $langs->transnoentities("Product")." ";
|
||||
$prefix_prodserv = $outputlangs->transnoentities("Product")." ";
|
||||
}
|
||||
$libelleproduitservice=$prefix_prodserv.$prodser->ref." - ".$libelleproduitservice;
|
||||
}
|
||||
@ -190,50 +205,50 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
if ($delivery->lignes[$i]->date_start && $delivery->lignes[$i]->date_end)
|
||||
{
|
||||
// Affichage duree si il y en a une
|
||||
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$langs->transnoentities("From")." ".dolibarr_print_date($delivery->lignes[$i]->date_start)." ".$langs->transnoentities("to")." ".dolibarr_print_date($delivery->lignes[$i]->date_end).")",1);
|
||||
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($delivery->lignes[$i]->date_start)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($delivery->lignes[$i]->date_end).")",1);
|
||||
}
|
||||
|
||||
$pdf->SetXY (30, $curY );
|
||||
|
||||
$pdf->MultiCell(100, 5, $libelleproduitservice, 0, 'J', 0);
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$pdf->SetXY (30, $curY );
|
||||
|
||||
$pdf->SetXY (10, $curY );
|
||||
$pdf->MultiCell(100, 5, $libelleproduitservice, 0, 'J', 0);
|
||||
|
||||
$pdf->MultiCell(20, 5, $delivery->lignes[$i]->ref, 0, 'C');
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (133, $curY );
|
||||
//$pdf->MultiCell(10, 5, $delivery->lignes[$i]->tva_tx, 0, 'C');
|
||||
$pdf->SetXY (10, $curY );
|
||||
|
||||
$pdf->SetXY (145, $curY );
|
||||
$pdf->MultiCell(10, 5, $delivery->lignes[$i]->qty_shipped, 0, 'C');
|
||||
$pdf->MultiCell(20, 5, $delivery->lignes[$i]->ref, 0, 'C');
|
||||
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (156, $curY );
|
||||
//$pdf->MultiCell(18, 5, price($delivery->lignes[$i]->price), 0, 'R', 0);
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (133, $curY );
|
||||
//$pdf->MultiCell(10, 5, $delivery->lignes[$i]->tva_tx, 0, 'C');
|
||||
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (174, $curY );
|
||||
//$total = price($delivery->lignes[$i]->price * $delivery->lignes[$i]->qty_shipped);
|
||||
//$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
|
||||
$pdf->SetXY (145, $curY );
|
||||
$pdf->MultiCell(10, 5, $delivery->lignes[$i]->qty_shipped, 0, 'C');
|
||||
|
||||
$pdf->line(10, $curY, 200, $curY );
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (156, $curY );
|
||||
//$pdf->MultiCell(18, 5, price($delivery->lignes[$i]->price), 0, 'R', 0);
|
||||
|
||||
if ($nexY > 240 && $i < $nblignes - 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
|
||||
$pdf->AddPage();
|
||||
$nexY = $iniY;
|
||||
$this->_pagehead($pdf, $delivery);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','', 10);
|
||||
}
|
||||
// \TODO Field not yet saved in database
|
||||
//$pdf->SetXY (174, $curY );
|
||||
//$total = price($delivery->lignes[$i]->price * $delivery->lignes[$i]->qty_shipped);
|
||||
//$pdf->MultiCell(26, 5, $total, 0, 'R', 0);
|
||||
|
||||
$pdf->line(10, $curY, 200, $curY );
|
||||
|
||||
if ($nexY > 240 && $i < $nblignes - 1)
|
||||
{
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
$pdf->AddPage();
|
||||
$nexY = $iniY;
|
||||
$this->_pagehead($pdf, $delivery, $outputlangs);
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','', 10);
|
||||
}
|
||||
}
|
||||
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY);
|
||||
|
||||
$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
|
||||
|
||||
$pdf->Output($file);
|
||||
return 1;
|
||||
}
|
||||
@ -249,7 +264,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
* \brief Affiche la grille des lignes de propales
|
||||
* \param pdf objet PDF
|
||||
*/
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY)
|
||||
function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs)
|
||||
{
|
||||
global $langs,$conf;
|
||||
$langs->load("main");
|
||||
@ -259,17 +274,17 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
$pdf->Text(30,$tab_top + 5,$langs->transnoentities("Designation"));
|
||||
|
||||
// $pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
|
||||
// $pdf->Text(134,$tab_top + 5,$langs->transnoentities("VAT"));
|
||||
// $pdf->line(132, $tab_top, 132, $tab_top + $tab_height);
|
||||
// $pdf->Text(134,$tab_top + 5,$langs->transnoentities("VAT"));
|
||||
|
||||
$pdf->line(144, $tab_top, 144, $tab_top + $tab_height);
|
||||
$pdf->Text(147,$tab_top + 5,$langs->transnoentities("QtyShipped"));
|
||||
|
||||
// $pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
|
||||
// $pdf->Text(160,$tab_top + 5,$langs->transnoentities("PriceU"));
|
||||
// $pdf->line(156, $tab_top, 156, $tab_top + $tab_height);
|
||||
// $pdf->Text(160,$tab_top + 5,$langs->transnoentities("PriceU"));
|
||||
|
||||
// $pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
|
||||
// $pdf->Text(187,$tab_top + 5,$langs->transnoentities("Total"));
|
||||
// $pdf->line(174, $tab_top, 174, $tab_top + $tab_height);
|
||||
// $pdf->Text(187,$tab_top + 5,$langs->transnoentities("Total"));
|
||||
|
||||
// $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top);
|
||||
$pdf->Rect(10, $tab_top, 190, $tab_height);
|
||||
@ -277,91 +292,102 @@ class pdf_sirocco extends ModelePDFDeliveryOrder
|
||||
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','',10);
|
||||
// $titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentities("Currency".$conf->monnaie));
|
||||
// $pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
||||
// $titre = $langs->transnoentities("AmountInCurrency",$langs->transnoentities("Currency".$conf->monnaie));
|
||||
// $pdf->Text(200 - $pdf->GetStringWidth($titre), 98, $titre);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Affiche en-tete propale
|
||||
* \param pdf objet PDF
|
||||
* \param fac objet propale
|
||||
* \param showadress 0=non, 1=oui
|
||||
*/
|
||||
function _pagehead(&$pdf, $delivery)
|
||||
function _pagehead(&$pdf, $delivery, $outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
$langs->load("deliveries");
|
||||
$pdf->SetXY(10,5);
|
||||
if (defined("MAIN_INFO_SOCIETE_NOM"))
|
||||
{
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->SetFont('Arial','B',14);
|
||||
$pdf->MultiCell(76, 8, MAIN_INFO_SOCIETE_NOM, 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(70,70,170);
|
||||
if (defined("FAC_PDF_ADRESSE"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',12);
|
||||
$pdf->MultiCell(76, 5, FAC_PDF_ADRESSE);
|
||||
}
|
||||
if (defined("FAC_PDF_TEL"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(76, 5, "Tel : ".FAC_PDF_TEL);
|
||||
}
|
||||
if (defined("MAIN_INFO_SIREN"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
|
||||
}
|
||||
$outputlangs->load("deliveries");
|
||||
$pdf->SetXY(10,5);
|
||||
if (defined("MAIN_INFO_SOCIETE_NOM"))
|
||||
{
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->SetFont('Arial','B',14);
|
||||
$pdf->MultiCell(76, 8, MAIN_INFO_SOCIETE_NOM, 0, 'L');
|
||||
}
|
||||
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
{
|
||||
$pdf->SetXY(100,5);
|
||||
$pdf->SetFont('Arial','B',14);
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->MultiCell(100, 10, FAC_PDF_INTITULE2, '' , 'R');
|
||||
}
|
||||
/*
|
||||
* Adresse Client
|
||||
*/
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$client = new Societe($this->db);
|
||||
/*
|
||||
* if a delivery address is used, use that, else use the client address
|
||||
*/
|
||||
if ($commande->adresse_livraison_id>0) {
|
||||
$client->fetch_adresse_livraison($commande->adresse_livraison_id);
|
||||
} else {
|
||||
$client->fetch($delivery->socid);
|
||||
}
|
||||
$delivery->client = $client;
|
||||
$pdf->SetTextColor(70,70,170);
|
||||
if (defined("FAC_PDF_ADRESSE"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',12);
|
||||
$pdf->MultiCell(76, 5, FAC_PDF_ADRESSE);
|
||||
}
|
||||
if (defined("FAC_PDF_TEL"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(76, 5, "Tel : ".FAC_PDF_TEL);
|
||||
}
|
||||
if (defined("MAIN_INFO_SIREN"))
|
||||
{
|
||||
$pdf->SetFont('Arial','',10);
|
||||
$pdf->MultiCell(76, 5, "SIREN : ".MAIN_INFO_SIREN);
|
||||
}
|
||||
|
||||
$pdf->SetXY(102,42);
|
||||
$pdf->MultiCell(96,5, $delivery->client->nom);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
$pdf->SetXY(102,47);
|
||||
$pdf->MultiCell(96,5, $delivery->client->adresse . "\n" . $delivery->client->cp . " " . $delivery->client->ville);
|
||||
$pdf->rect(100, 40, 100, 40);
|
||||
if (defined("FAC_PDF_INTITULE2"))
|
||||
{
|
||||
$pdf->SetXY(100,5);
|
||||
$pdf->SetFont('Arial','B',14);
|
||||
$pdf->SetTextColor(0,0,200);
|
||||
$pdf->MultiCell(100, 10, FAC_PDF_INTITULE2, '' , 'R');
|
||||
}
|
||||
/*
|
||||
* Adresse Client
|
||||
*/
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$client = new Societe($this->db);
|
||||
/*
|
||||
* if a delivery address is used, use that, else use the client address
|
||||
*/
|
||||
if ($commande->adresse_livraison_id>0)
|
||||
{
|
||||
$client->fetch_adresse_livraison($commande->adresse_livraison_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$client->fetch($delivery->socid);
|
||||
}
|
||||
$delivery->client = $client;
|
||||
|
||||
$pdf->SetXY(102,42);
|
||||
$pdf->MultiCell(96,5, $delivery->client->nom);
|
||||
$pdf->SetFont('Arial','B',11);
|
||||
$pdf->SetXY(102,47);
|
||||
$pdf->MultiCell(96,5, $delivery->client->adresse . "\n" . $delivery->client->cp . " " . $delivery->client->ville);
|
||||
$pdf->rect(100, 40, 100, 40);
|
||||
|
||||
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Text(11, 88, $langs->transnoentities("Date")." : " . dolibarr_print_date($delivery->date_valid,"day"));
|
||||
$pdf->Text(11, 94, $langs->transnoentities("DeliveryOrder")." ".$delivery->ref);
|
||||
|
||||
$pdf->SetFont('Arial','B',9);
|
||||
$commande = new Commande ($this->db);
|
||||
if ($commande->fetch($delivery->commande_id) >0) {
|
||||
$pdf->Text(11, 98, $langs->transnoentities("RefOrder")." ".$commande->ref);
|
||||
}
|
||||
|
||||
$pdf->SetTextColor(200,0,0);
|
||||
$pdf->SetFont('Arial','B',12);
|
||||
$pdf->Text(11, 88, $outputlangs->transnoentities("Date")." : " . dolibarr_print_date($delivery->date_valid,"day"));
|
||||
$pdf->Text(11, 94, $outputlangs->transnoentities("DeliveryOrder")." ".$delivery->ref);
|
||||
|
||||
$pdf->SetFont('Arial','B',9);
|
||||
$commande = new Commande ($this->db);
|
||||
if ($commande->fetch($delivery->commande_id) >0)
|
||||
{
|
||||
$pdf->Text(11, 98, $outputlangs->transnoentities("RefOrder")." ".$commande->ref);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche le pied de page
|
||||
* \param pdf objet PDF
|
||||
*/
|
||||
function _pagefoot(&$pdf,$outputlangs)
|
||||
{
|
||||
return pdf_pagefoot($pdf,$outputlangs,'DELIVERY_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -113,6 +113,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
global $user,$langs,$conf;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
// Force output charset to ISO, because, FPDF expect text encoded in ISO
|
||||
$outputlangs->charset_output=$outputlangs->character_set_client='ISO-8859-1';
|
||||
|
||||
$outputlangs->load("main");
|
||||
$outputlangs->load("dict");
|
||||
$outputlangs->load("companies");
|
||||
@ -382,7 +385,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Affiche en-tete bon livraison
|
||||
* \param pdf objet PDF
|
||||
* \param fac objet propale
|
||||
|
||||
@ -43,8 +43,8 @@ class Translate {
|
||||
|
||||
var $cache_labels=array(); // Cache for labels
|
||||
|
||||
var $charset_inputfile='ISO-8859-1'; // Codage used to encode lang files (used if CHARSET not found in file)
|
||||
var $charset_output='UTF-8'; // Codage used by defaut for "trans" method output if $conf->character_set_client not defined (character_set_client in conf.php)
|
||||
var $charset_inputfile='ISO-8859-1'; // Codage used by default to encode lang files (used if CHARSET not found in file)
|
||||
var $charset_output='UTF-8'; // Codage used by default for "trans" method output if $conf->character_set_client not defined (character_set_client in conf.php)
|
||||
|
||||
|
||||
/**
|
||||
@ -155,10 +155,12 @@ class Translate {
|
||||
|
||||
|
||||
/**
|
||||
* \brief Charge en memoire le tableau de traduction pour un domaine particulier
|
||||
* Si le domaine est deja charge, la fonction ne fait rien
|
||||
* \param domain Nom du domain (fichier lang) a charger
|
||||
* \param alt Utilise le fichier alternatif meme si fichier dans la langue est trouvee
|
||||
* \brief Load in a memory array, translation key-value for a particular file.
|
||||
* If data for file already loaded, do nothing.
|
||||
* All data in translation array are stored in ISO-8859-1 format.
|
||||
* \\TODO Store data arrays in UTF-8 format.
|
||||
* \param domain File name to load (.lang file)
|
||||
* \param alt Use alternate file even if file in target language is found
|
||||
* \return int <0 if KO, >0 if OK
|
||||
* \remarks tab_loaded is completed with $domain key.
|
||||
* Value for key is: 1:Loaded from disk, 2:Not found, 3:Loaded from cache
|
||||
|
||||
Loading…
Reference in New Issue
Block a user