From 1f263943c540cf5ca5fb3d52e09e151e156076db Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Nov 2012 19:07:03 +0100 Subject: [PATCH] New: Add option to add slashes lines between lines into PDF. --- ChangeLog | 7 ++++--- .../core/modules/commande/doc/pdf_einstein.modules.php | 9 +++++++++ .../expedition/doc/pdf_expedition_merou.modules.php | 9 +++++++++ .../expedition/doc/pdf_expedition_rouget.modules.php | 9 +++++++++ htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 9 +++++++++ .../core/modules/livraison/pdf/pdf_typhon.modules.php | 10 ++++++++++ .../core/modules/project/pdf/pdf_baleine.modules.php | 9 +++++++++ htdocs/core/modules/propale/doc/pdf_azur.modules.php | 9 +++++++++ .../supplier_invoice/pdf/pdf_canelle.modules.php | 9 +++++++++ .../supplier_order/pdf/pdf_muscadet.modules.php | 9 +++++++++ 10 files changed, 86 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 877bd292c05..42cd19157a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,9 +50,10 @@ For users: - New: Allow to search product from barcodes directly from invoices, proposals... through AJAX. - New: Can make one invoice for several orders. - New: POS module can works with only one payment method (cach, chq, credit card). -- New: Add possibility to defined position/job of a user -- New: [ task #210 ] Can choose cash account during POS login -- New: [ task #104 ] Can create an invoice from several orders +- New: Add possibility to defined position/job of a user. +- New: Add hidden option to add slashes between lines into PDF. +- New: [ task #210 ] Can choose cash account during POS login. +- New: [ task #104 ] Can create an invoice from several orders. - New: Update libs/tools/logo for DoliWamp (now use PHP 5.3). - New: Added ODT Template tag {object_total_discount} - New: Add new import options: Third parties bank details, warehouses and stocks, categories and suppliers prices diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 1d56eb79635..9e3a9de7889 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -381,6 +381,15 @@ class pdf_einstein extends ModelePDFCommandes $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index e65d09453e8..bdd85bb2abc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -243,6 +243,15 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetXY(170, $curY); $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0); + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index 37f3ffc6538..8e6cc244598 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -262,6 +262,15 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxqtytoship, $curY); $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxqtytoship), 3, $object->lines[$i]->qty_shipped,'','C'); + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 77d09e85691..5a6e8d4a695 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -382,6 +382,15 @@ class pdf_crabe extends ModelePDFFactures $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 420fce5653c..bc6e474b36c 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -305,6 +305,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; $this->tva[ (string) $object->lines[$i]->tva_tx ] += $tvaligne; */ + + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index 2a9048804c3..62606ab68b6 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -226,6 +226,15 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $nexY = $pdf->GetY(); + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 77d9d849d2a..7db7e29fb71 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -379,6 +379,15 @@ class pdf_azur extends ModelePDFPropales $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index b0a2b33e2e7..458b277a735 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -337,6 +337,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index fdc97727658..00e1dd8e5e1 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -354,6 +354,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; + // Add line + if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES)) + { + $pdf->SetLineStyle(array('dash'=>'1,1','color'=>array(210,210,210))); + //$pdf->SetDrawColor(190,190,200); + $pdf->line($this->marge_gauche, $nexY+1, $this->page_largeur - $this->marge_droite, $nexY+1); + $pdf->SetLineStyle(array('dash'=>0)); + } + $nexY+=2; // Passe espace entre les lignes // Detect if some page were added automatically and output _tableau for past pages