From 372b583e50cd46054e67bd5bf41a9d65b91649d1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 16 Jan 2022 19:21:59 +0100 Subject: [PATCH] Debug template of warehouse --- .../stock/doc/pdf_standard.modules.php | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index 1597ee32c18..17e2c6b532b 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -179,6 +179,8 @@ class pdf_standard extends ModelePDFStock $this->localtax2 = array(); $this->atleastoneratenotnull = 0; $this->atleastonediscount = 0; + + $this->tabTitleHeight = 11; } @@ -321,7 +323,6 @@ class pdf_standard extends ModelePDFStock $i = 0; $nblines = $num; - $this->tabTitleHeight = 10; $nexY = $tab_top + $this->tabTitleHeight; for ($i = 0; $i < $nblines; $i++) { @@ -733,7 +734,7 @@ class pdf_standard extends ModelePDFStock if (empty($hidetop)) { $pdf->SetDrawColor(200, 200, 200); $pdf->SetLineStyle(array('dash' => '0', 'color' => array(200, 200, 200))); - $pdf->line($this->marge_gauche, $tab_top + 10, $this->page_largeur - $this->marge_droite, $tab_top + 10); + $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight); $pdf->SetLineStyle(array('dash' => 0)); } } @@ -767,8 +768,8 @@ class pdf_standard extends ModelePDFStock pdf_pagehead($pdf, $outputlangs, $this->page_hauteur); // Show Draft Watermark - if ($object->statut == 0 && (!empty($conf->global->COMMANDE_DRAFT_WATERMARK))) { - pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK); + if ($object->statut == 0 && (!empty($conf->global->STOCK_DRAFT_WATERMARK))) { + pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->STOCK_DRAFT_WATERMARK); } $pdf->SetTextColor(0, 0, 60); @@ -780,6 +781,7 @@ class pdf_standard extends ModelePDFStock $pdf->SetXY($this->marge_gauche, $posy); // Logo + $height = 0; $logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { if (is_readable($logo)) { @@ -796,29 +798,19 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); } + $yafterleft = $pdf->GetY() + $height; + $pdf->SetFont('', 'B', $default_font_size + 3); $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $title = $outputlangs->transnoentities("Warehouse"); - $pdf->MultiCell(100, 3, $title, '', 'R'); - $pdf->SetFont('', 'B', $default_font_size); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Warehouse").' '.$outputlangs->convToOutputCharset($object->label), '', 'R'); - $posy += 5; - $pdf->SetXY($posx, $posy); - $pdf->SetTextColor(0, 0, 60); - - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($object->label), '', 'R'); - - $posy += 5; + $posy += 6; $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($posx, $posy); $pdf->SetTextColor(0, 0, 60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("LocationSummary").' :', '', 'R'); - - $posy += 4; - $pdf->SetXY($posx - 50, $posy); - $pdf->MultiCell(150, 3, $object->lieu, '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Label").' : '.$object->lieu, '', 'R'); $posy += 4; $pdf->SetXY($posx, $posy); @@ -836,8 +828,10 @@ class pdf_standard extends ModelePDFStock $pdf->MultiCell(150, 3, $e->label, '', 'R'); } + $yafterright = $pdf->GetY(); + // Description - $nexY = $pdf->GetY(); + $nexY = max($yafterleft, $yafterright); $nexY += 5; $pdf->SetXY($posx, $posy); $pdf->writeHTMLCell(190, 2, $this->marge_gauche, $nexY, ''.$outputlangs->transnoentities("Description").' : '.nl2br($object->description), 0, 1);