|
@@ -63,6 +63,8 @@ class pdf_squille extends ModelePdfReception
|
|
|
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
|
|
|
|
|
|
$this->option_logo = 1; // Display logo
|
|
|
+ $this->option_draft_watermark = 1; // Support add of a watermark on drafts
|
|
|
+ $this->watermark = '';
|
|
|
|
|
|
// Get source company
|
|
|
$this->emetteur = $mysoc;
|
|
@@ -105,7 +107,7 @@ class pdf_squille extends ModelePdfReception
|
|
|
/**
|
|
|
* Function to build pdf onto disk
|
|
|
*
|
|
|
- * @param Object $object Object reception to generate (or id if old method)
|
|
|
+ * @param Reception $object Object reception to generate (or id if old method)
|
|
|
* @param Translate $outputlangs Lang output object
|
|
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
|
|
* @param int $hidedetails Do not show line details
|
|
@@ -130,6 +132,11 @@ class pdf_squille extends ModelePdfReception
|
|
|
|
|
|
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "propal", "deliveries", "receptions", "productbatch", "sendings"));
|
|
|
|
|
|
+ // Show Draft Watermark
|
|
|
+ if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->RECEPTION_DRAFT_WATERMARK))) {
|
|
|
+ $this->watermark = $conf->global->RECEPTION_DRAFT_WATERMARK;
|
|
|
+ }
|
|
|
+
|
|
|
$nblines = count($object->lines);
|
|
|
|
|
|
// Loop on each lines to detect if there is at least one image to show
|
|
@@ -817,11 +824,6 @@ class pdf_squille extends ModelePdfReception
|
|
|
|
|
|
pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
|
|
|
|
|
|
- // Show Draft Watermark
|
|
|
- if ($object->statut == 0 && (!empty($conf->global->RECEPTION_DRAFT_WATERMARK))) {
|
|
|
- pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->RECEPTION_DRAFT_WATERMARK);
|
|
|
- }
|
|
|
-
|
|
|
//Prepare la suite
|
|
|
$pdf->SetTextColor(0, 0, 60);
|
|
|
$pdf->SetFont('', 'B', $default_font_size + 3);
|
|
@@ -1055,6 +1057,6 @@ class pdf_squille extends ModelePdfReception
|
|
|
{
|
|
|
global $conf;
|
|
|
$showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
|
|
|
- return pdf_pagefoot($pdf, $outputlangs, 'RECEPTION_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
|
|
|
+ return pdf_pagefoot($pdf, $outputlangs, 'RECEPTION_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);
|
|
|
}
|
|
|
}
|