From 6f435364325c0860e8f5c28511a6c8adc9fee41e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 3 Jan 2011 09:50:07 +0000 Subject: [PATCH] Fix: Better compatibility of PDF with all languages --- .../modules/commande/pdf_edison.modules.php | 25 +++++++++++-------- .../modules/commande/pdf_einstein.modules.php | 6 ++--- .../modules/facture/pdf_crabe.modules.php | 4 +-- .../livraison/pdf/pdf_sirocco.modules.php | 4 +-- .../propale/pdf_propale_azur.modules.php | 6 ++--- .../pdf/pdf_canelle.modules.php | 4 +-- .../pdf/pdf_muscadet.modules.php | 4 +-- 7 files changed, 28 insertions(+), 25 deletions(-) diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php index c566d992e72..05f4d827540 100644 --- a/htdocs/includes/modules/commande/pdf_edison.modules.php +++ b/htdocs/includes/modules/commande/pdf_edison.modules.php @@ -271,7 +271,7 @@ class pdf_edison extends ModelePDFCommandes $tab2_top = 241; $tab2_lh = 4; - $pdf->SetFont('','', $default_font_size + 1); + $pdf->SetFont('','', $default_font_size); $pdf->SetXY (132, $tab2_top + 0); $pdf->MultiCell(42, $tab2_lh, $langs->transnoentities("TotalHT"), 0, 'R', 0); @@ -467,23 +467,26 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetFont('','', $default_font_size - 1); $pdf->SetXY(30,$tab_top + 2); - $pdf->MultiCell(0,4,$outputlangs->transnoentities("Designation"),0,'L'); + $pdf->MultiCell(20,4,$outputlangs->transnoentities("Designation"),0,'L'); - $pdf->line(132, $tab_top, 132, $tab_top + $tab_height); - $pdf->SetXY(134,$tab_top + 2); - $pdf->MultiCell(0,4,$outputlangs->transnoentities("VAT")); + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) + { + $pdf->line(132, $tab_top, 132, $tab_top + $tab_height); + $pdf->SetXY(133,$tab_top + 2); + $pdf->MultiCell(12,4,$outputlangs->transnoentities("VAT"),'','C'); + } $pdf->line(144, $tab_top, 144, $tab_top + $tab_height); - $pdf->SetXY(147,$tab_top + 2); - $pdf->MultiCell(0,4,$outputlangs->transnoentities("Qty")); + $pdf->SetXY(145,$tab_top + 2); + $pdf->MultiCell(12,4,$outputlangs->transnoentities("Qty"),'','C'); $pdf->line(156, $tab_top, 156, $tab_top + $tab_height); - $pdf->SetXY(160,$tab_top + 2); - $pdf->MultiCell(0,4,$outputlangs->transnoentities("PriceU")); + $pdf->SetXY(157,$tab_top + 2); + $pdf->MultiCell(16,4,$outputlangs->transnoentities("PriceUHT"),'','C'); $pdf->line(174, $tab_top, 174, $tab_top + $tab_height); - $pdf->SetXY(187,$tab_top + 2); - $pdf->MultiCell(0,4,$outputlangs->transnoentities("Total")); + $pdf->SetXY(175,$tab_top + 2); + $pdf->MultiCell(30,4,$outputlangs->transnoentities("TotalHT"),'','C'); // $pdf->Rect(10, $tab_top, 190, $nexY - $tab_top); $pdf->Rect(10, $tab_top, 190, $tab_height); diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 4f6170ac4a7..043d2a58607 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -788,7 +788,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->SetXY ($this->posxup-1, $tab_top+1); - $pdf->MultiCell(18,2, $outputlangs->transnoentities("PriceUHT"),'','C'); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->SetXY ($this->posxqty-1, $tab_top+1); @@ -798,7 +798,7 @@ class pdf_einstein extends ModelePDFCommandes if ($this->atleastonediscount) { $pdf->SetXY ($this->posxdiscount-1, $tab_top+1); - $pdf->MultiCell(14,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } if ($this->atleastonediscount) @@ -806,7 +806,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); } $pdf->SetXY ($this->postotalht-1, $tab_top+1); - $pdf->MultiCell(28,2, $outputlangs->transnoentities("TotalHT"),'','C'); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index f949e0354c8..368554c44c1 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -949,7 +949,7 @@ class pdf_crabe extends ModelePDFFactures if ($this->atleastonediscount) { $pdf->SetXY ($this->posxdiscount-1, $tab_top+1); - $pdf->MultiCell($this->postotalht-$this->posxdiscount,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } if ($this->atleastonediscount) @@ -957,7 +957,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); } $pdf->SetXY ($this->postotalht-1, $tab_top+1); - $pdf->MultiCell(26,2, $outputlangs->transnoentities("TotalHT"),'','C'); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); } diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php index 64019db7cb4..18661e9ac9f 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php @@ -208,11 +208,11 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetXY (145, $curY ); $pdf->MultiCell(10, 3, $object->lines[$i]->qty_shipped, 0, 'C'); - // \TODO Field not yet saved in database + // TODO Field not yet saved in database //$pdf->SetXY (156, $curY ); //$pdf->MultiCell(20, 3, price($object->lines[$i]->price), 0, 'R', 0); - // \TODO Field not yet saved in database + // TODO Field not yet saved in database //$pdf->SetXY (174, $curY ); //$total = price($object->lines[$i]->price * $object->lines[$i]->qty_shipped); //$pdf->MultiCell(26, 3, $total, 0, 'R', 0); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index e56085604b1..456de6495a1 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -813,7 +813,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height); $pdf->SetXY ($this->posxup-1, $tab_top+1); - $pdf->MultiCell(20,2, $outputlangs->transnoentities("PriceUHT"),'','C'); + $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); $pdf->SetXY ($this->posxqty-1, $tab_top+1); @@ -823,7 +823,7 @@ class pdf_propale_azur extends ModelePDFPropales if ($this->atleastonediscount) { $pdf->SetXY ($this->posxdiscount-1, $tab_top+1); - $pdf->MultiCell(14,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } if ($this->atleastonediscount) @@ -831,7 +831,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); } $pdf->SetXY ($this->postotalht-1, $tab_top+1); - $pdf->MultiCell(28,2, $outputlangs->transnoentities("TotalHT"),'','C'); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C'); } 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 4b651d77c4f..0460b55ae26 100755 --- a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -530,7 +530,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices if ($this->atleastonediscount) { $pdf->SetXY ($this->posxdiscount-1, $tab_top+2); - $pdf->MultiCell($this->postotalht-$this->posxdiscount,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } if ($this->atleastonediscount) @@ -538,7 +538,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); } $pdf->SetXY ($this->postotalht-1, $tab_top+2); - $pdf->MultiCell(26,2, $outputlangs->transnoentities("TotalHTShort"),'','C'); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C'); } 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 b15fdc4f270..9a9e2e85792 100644 --- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -530,7 +530,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($this->atleastonediscount) { $pdf->SetXY ($this->posxdiscount-1, $tab_top+2); - $pdf->MultiCell($this->postotalht-$this->posxdiscount,2, $outputlangs->transnoentities("ReductionShort"),'','C'); + $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C'); } if ($this->atleastonediscount) @@ -538,7 +538,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); } $pdf->SetXY ($this->postotalht-1, $tab_top+2); - $pdf->MultiCell(26,2, $outputlangs->transnoentities("TotalHTShort"),'','C'); + $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHTShort"),'','C'); }