From 83ef7708932781c4ff4a4bd5e68be29e7c300fa6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Dec 2010 18:40:04 +0000 Subject: [PATCH] Fix: TCPDF compatibility --- .../modules/commande/pdf_edison.modules.php | 32 +++++++++---------- .../modules/commande/pdf_einstein.modules.php | 5 ++- .../pdf/pdf_expedition_rouget.modules.php | 14 +++++--- .../modules/facture/pdf_crabe.modules.php | 3 +- .../modules/facture/pdf_oursin.modules.php | 32 ++++++++++++------- .../modules/fichinter/pdf_soleil.modules.php | 5 +-- .../propale/pdf_propale_azur.modules.php | 3 +- .../propale/pdf_propale_jaune.modules.php | 11 +------ .../pdf/pdf_canelle.modules.php | 3 +- .../pdf/pdf_muscadet.modules.php | 3 +- 10 files changed, 55 insertions(+), 56 deletions(-) diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php index 33b02f2c25e..a93380b8a9d 100644 --- a/htdocs/includes/modules/commande/pdf_edison.modules.php +++ b/htdocs/includes/modules/commande/pdf_edison.modules.php @@ -265,19 +265,10 @@ class pdf_edison extends ModelePDFCommandes // Affiche zone totaux $tab2_top = 241; - $tab2_lh = 7; - $tab2_height = $tab2_lh * 4; + $tab2_lh = 4; $pdf->SetFont('','', 11); - $pdf->Rect(132, $tab2_top, 68, $tab2_height); - - $pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) ); - $pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) ); - $pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh ); - - $pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height); - $pdf->SetXY (132, $tab2_top + 0); $pdf->MultiCell(42, $tab2_lh, $langs->transnoentities("TotalHT"), 0, 'R', 0); @@ -469,19 +460,24 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetFont('','',11); - $pdf->Text(30,$tab_top + 5,$outputlangs->transnoentities("Designation")); + $pdf->SetXY(30,$tab_top + 2); + $pdf->MultiCell(0,4,$outputlangs->transnoentities("Designation"),0,'L'); $pdf->line(132, $tab_top, 132, $tab_top + $tab_height); - $pdf->Text(134,$tab_top + 5,$outputlangs->transnoentities("VAT")); + $pdf->SetXY(134,$tab_top + 2); + $pdf->MultiCell(0,4,$outputlangs->transnoentities("VAT")); $pdf->line(144, $tab_top, 144, $tab_top + $tab_height); - $pdf->Text(147,$tab_top + 5,$outputlangs->transnoentities("Qty")); + $pdf->SetXY(147,$tab_top + 2); + $pdf->MultiCell(0,4,$outputlangs->transnoentities("Qty")); $pdf->line(156, $tab_top, 156, $tab_top + $tab_height); - $pdf->Text(160,$tab_top + 5,$outputlangs->transnoentities("PriceU")); + $pdf->SetXY(160,$tab_top + 2); + $pdf->MultiCell(0,4,$outputlangs->transnoentities("PriceU")); $pdf->line(174, $tab_top, 174, $tab_top + $tab_height); - $pdf->Text(187,$tab_top + 5,$outputlangs->transnoentities("Total")); + $pdf->SetXY(187,$tab_top + 2); + $pdf->MultiCell(0,4,$outputlangs->transnoentities("Total")); // $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top); $pdf->Rect(10, $tab_top, 190, $tab_height); @@ -593,8 +589,10 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetTextColor(200,0,0); $pdf->SetFont('','B',12); - $pdf->Text(11, 88, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs)); - $pdf->Text(11, 94, $outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->ref)); + $pdf->SetXY(11, 88); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs), 0, 'L'); + $pdf->SetXY(11, 94); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Order")." ".$outputlangs->convToOutputCharset($object->ref), 0, 'L'); } /** diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 6e112c3d325..40e25109f9e 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -566,8 +566,7 @@ class pdf_einstein extends ModelePDFCommandes global $conf,$mysoc; $tab2_top = $posy; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', 9); // Tableau total @@ -946,7 +945,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0,0,0); $pdf->SetFont('','',8); $pdf->SetXY($posx+2,$posy-5); - $pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":"); + $pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L'); $pdf->rect($posx, $posy, 100, $hautcadre); // Show recipient name diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php index 26db46c7531..54c39bda3dc 100644 --- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php +++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php @@ -150,8 +150,9 @@ Class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetTextColor(0,0,60); $title=$outputlangs->transnoentities("SendingSheet"); $pdf->MultiCell(100, 4, $title, '' , 'R'); + $posy+=1; - $pdf->SetFont('','B',12); + $pdf->SetFont('','',12); $posy+=5; $pdf->SetXY(100,$posy); @@ -192,13 +193,15 @@ Class pdf_expedition_rouget extends ModelePdfExpedition $result=$newobject->fetch($val[$i]); if ($result >= 0) { - $Yoff = $Yoff+8; - $pdf->SetXY($Xoff,$Yoff); $pdf->SetFont('','',8); $text=$newobject->ref; if ($newobject->ref_client) $text.=' ('.$newobject->ref_client.')'; - $pdf->Text($posx, $Yoff, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text)); - $pdf->Text($posx, $Yoff+4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->commande->date,"%d %b %Y",false,$outputlangs,true)); + $Yoff = $Yoff+8; + $pdf->SetXY($this->page_largeur - $this->marge_droite - 60,$Yoff); + $pdf->MultiCell(60, 4, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R'); + $Yoff = $Yoff+4; + $pdf->SetXY($this->page_largeur - $this->marge_droite - 60,$Yoff); + $pdf->MultiCell(60, 4, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->commande->date,"%d %b %Y",false,$outputlangs,true), 0, 'R'); } } } @@ -231,6 +234,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition $outputlangs->load("products"); $outputlangs->load("propal"); $outputlangs->load("deliveries"); + $outputlangs->load("sendings"); if ($conf->expedition->dir_output) { diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 20344813ad3..25b411aaaeb 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -696,8 +696,7 @@ class pdf_crabe extends ModelePDFFactures $default_font_size = pdf_getPDFFontSize($outputlangs); $tab2_top = $posy; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', $default_font_size - 1); // Tableau total diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index dbd8357b278..0a5f69a64db 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -583,8 +583,7 @@ class pdf_oursin extends ModelePDFFactures $langs->load("bills"); $tab2_top = $this->marges['h']+202; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', 9); // Tableau total @@ -646,7 +645,7 @@ class pdf_oursin extends ModelePDFFactures $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(22,137,210); - $pdf->SetFont('','B', 11); + $pdf->SetFont('','B', 10); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), 0, 'L', 0); $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), 0, 'R', 0); @@ -725,26 +724,37 @@ class pdf_oursin extends ModelePDFFactures $pdf->SetFont('','B',10); - $pdf->Text($this->marges['g']+1,$tab_top + 5, $outputlangs->transnoentities("Designation")); + $pdf->SetXY($this->marges['g'],$tab_top + 2); + $pdf->MultiCell(0, 4, $outputlangs->transnoentities("Designation"), 0, 'L'); if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { - if ($this->franchise!=1) $pdf->Text($this->marges['g']+120, $tab_top + 5, $outputlangs->transnoentities("VAT")); + if ($this->franchise!=1) + { + $pdf->SetXY($this->marges['g']+120,$tab_top + 2); + $pdf->MultiCell(0, 4, $outputlangs->transnoentities("VAT"), 0, 'L'); + } } - $pdf->Text($this->marges['g']+135, $tab_top + 5,$outputlangs->transnoentities("PriceUHT")); - $pdf->Text($this->marges['g']+153, $tab_top + 5, $outputlangs->transnoentities("Qty")); + $pdf->SetXY($this->marges['g']+135,$tab_top + 2); + $pdf->MultiCell(0, 4, $outputlangs->transnoentities("PriceUHT"), 0, 'L'); + $pdf->SetXY($this->marges['g']+153,$tab_top + 2); + $pdf->MultiCell(0, 4, $outputlangs->transnoentities("Qty"), 0, 'L'); $nblignes = sizeof($object->lines); $rem=0; for ($i = 0 ; $i < $nblignes ; $i++) - if ($object->lines[$i]->remise_percent) { - $rem=1; + if ($object->lines[$i]->remise_percent) + { + $rem=1; + } } if ($rem==1) { - $pdf->Text($this->marges['g']+163, $tab_top + 5,$outputlangs->transnoentities("Note")); + $pdf->SetXY($this->marges['g']+165,$tab_top + 2); + $pdf->MultiCell(0, 4, $outputlangs->transnoentities("%"), 0, 'L'); } - $pdf->Text($this->marges['g']+175, $tab_top + 5, $outputlangs->transnoentities("TotalHTShort")); + $pdf->SetXY($this->marges['g']+170,$tab_top + 2); + $pdf->MultiCell(20, 4, $outputlangs->transnoentities("TotalHTShort"), 0, 'R'); return $pdf->GetY(); } diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php index 9c1f5539a1b..5ea11b58c22 100644 --- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php +++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php @@ -245,8 +245,9 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0,0,100); - $pdf->SetFont('','B',14); - $pdf->Text(11, 94, $outputlangs->transnoentities("InterventionCard")." : ".$outputlangs->convToOutputCharset($fichinter->ref)); + $pdf->SetFont('','B',12); + $pdf->SetXY(10,86); + $pdf->MultiCell(120, 4, $outputlangs->transnoentities("InterventionCard")." : ".$outputlangs->convToOutputCharset($fichinter->ref), 0, 'L'); $pdf->SetFillColor(220,220,220); $pdf->SetTextColor(0,0,0); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 507f139f66b..c350c99a865 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -574,8 +574,7 @@ class pdf_propale_azur extends ModelePDFPropales global $conf,$mysoc; $tab2_top = $posy; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', 9); // Tableau total diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index 5dc3b2e2a2e..e3a55a6913c 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -260,19 +260,10 @@ class pdf_propale_jaune extends ModelePDFPropales $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); $tab2_top = 254; - $tab2_lh = 7; - $tab2_height = $tab2_lh * 3; + $tab2_lh = 4; $pdf->SetFont('','', 10); - $pdf->Rect(132, $tab2_top, 68, $tab2_height); - - $pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*3), 200, $tab2_top + $tab2_height - ($tab2_lh*3) ); - $pdf->line(132, $tab2_top + $tab2_height - ($tab2_lh*2), 200, $tab2_top + $tab2_height - ($tab2_lh*2) ); - $pdf->line(132, $tab2_top + $tab2_height - $tab2_lh, 200, $tab2_top + $tab2_height - $tab2_lh ); - - $pdf->line(174, $tab2_top, 174, $tab2_top + $tab2_height); - $pdf->SetXY (132, $tab2_top + 0); $pdf->MultiCell(42, $tab2_lh, $outputlangs->transnoentities("TotalHT"), 0, 'R', 0); diff --git a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php index b1c83f57f90..04797e5709c 100755 --- a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -375,8 +375,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { $tab2_top = $posy; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', 9); $pdf->SetXY ($this->marge_gauche, $tab2_top + 0); diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php index 7dfd7e5ccd8..d2d8b1ee94d 100644 --- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -386,8 +386,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { $tab2_top = $posy; - $tab2_hl = 5; - $tab2_height = $tab2_hl * 4; + $tab2_hl = 4; $pdf->SetFont('','', 9); $pdf->SetXY ($this->marge_gauche, $tab2_top + 0);