From e6e8dc5e54e3183ef8bc5889ddcdc1b84d4f9178 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 20 Jun 2006 14:18:52 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20le=20tableau=20=E9tait=20d=E9cal=E9=20su?= =?UTF-8?q?r=20les=20pages=20du=20milieu=20si=20pdf=20de=20plus=20de=202?= =?UTF-8?q?=20pages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/commande/pdf_einstein.modules.php | 26 +++++++++++++------ .../modules/facture/pdf_crabe.modules.php | 21 ++++++++++----- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index e7e7606b1b6..562b3724d94 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -187,6 +187,7 @@ class pdf_einstein extends ModelePDFCommandes $tab_top = 90; $tab_top_newpage = 50; $tab_height = 110; + $tab_height_newpage = 170; $iniY = $tab_top + 8; $curY = $tab_top + 8; @@ -264,23 +265,32 @@ class pdf_einstein extends ModelePDFCommandes // Collecte des totaux par valeur de tva // dans le tableau tva["taux"]=total_tva - $tvaligne=$com->lignes[$i]->price * $com->lignes[$i]->qty; - if ($com->remise_percent) $tvaligne-=($tvaligne*$com->remise_percent)/100; - $this->tva[ (string)$com->lignes[$i]->tva_tx ] += $tvaligne; + $tvaligne=$com->lignes[$i]->price * $com->lignes[$i]->qty; + if ($com->remise_percent) $tvaligne-=($tvaligne*$com->remise_percent)/100; + $this->tva[ (string)$com->lignes[$i]->tva_tx ] += $tvaligne; $nexY+=2; // Passe espace entre les lignes if ($nexY > 200 && $i < ($nblignes - 1)) - { - $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY); - $this->_pagefoot($pdf); + { + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY); + } + + $this->_pagefoot($pdf); // Nouvelle page $pdf->AddPage(); $pagenb++; $this->_pagehead($pdf, $com, 0); - - $nexY = $tab_top_newpage + 8; + + $nexY = $tab_top_newpage + 8; + $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','', 10); } diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index f1e14f73882..f8547a10408 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -193,6 +193,7 @@ class pdf_crabe extends ModelePDFFactures $tab_top = 90; $tab_top_newpage = 50; $tab_height = 110; + $tab_height_newpage = 180; // Affiche notes if ($fac->note_public) @@ -215,7 +216,7 @@ class pdf_crabe extends ModelePDFFactures else { $height_note=0; - } + } $iniY = $tab_top + 8; $curY = $tab_top + 8; @@ -287,7 +288,7 @@ class pdf_crabe extends ModelePDFFactures // Remise sur ligne $pdf->SetXY ($this->posxdiscount, $curY); if ($fac->lignes[$i]->remise_percent) - { + { $pdf->MultiCell(14, 4, $fac->lignes[$i]->remise_percent."%", 0, 'R'); } @@ -298,15 +299,23 @@ class pdf_crabe extends ModelePDFFactures // Collecte des totaux par valeur de tva // dans le tableau tva["taux"]=total_tva - $tvaligne=$fac->lignes[$i]->price * $fac->lignes[$i]->qty; - if ($fac->remise_percent) $tvaligne-=($tvaligne*$fac->remise_percent)/100; - $this->tva[ (string)$fac->lignes[$i]->tva_taux ] += $tvaligne; + $tvaligne=$fac->lignes[$i]->price * $fac->lignes[$i]->qty; + if ($fac->remise_percent) $tvaligne-=($tvaligne*$fac->remise_percent)/100; + $this->tva[ (string)$fac->lignes[$i]->tva_taux ] += $tvaligne; $nexY+=2; // Passe espace entre les lignes if ($nexY > ($tab_top+$tab_height) && $i < ($nblignes - 1)) { - $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs); + } + else + { + $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs); + } + $this->_pagefoot($pdf,$outputlangs); // Nouvelle page