From 443badfbcf3d8ba4c51bc0efb6dd5e6b9e4cc691 Mon Sep 17 00:00:00 2001
From: Maxime Kohlhaas <maxime@atm-consulting.fr>
Date: Sun, 10 May 2015 17:39:57 +0200
Subject: [PATCH] New : Signature area on proposal PDF

---
 .../modules/propale/doc/pdf_azur.modules.php  | 33 +++++++++++++++++++
 htdocs/langs/en_US/propal.lang                |  1 +
 2 files changed, 34 insertions(+)

diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index c519a0adff3..fc7bcfb3d3a 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -644,6 +644,9 @@ class pdf_azur extends ModelePDFPropales
 					$posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
 				}
 				*/
+				
+				// Customer signature area
+				$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
 
 				// Pied de page
 				$this->_pagefoot($pdf,$object,$outputlangs);
@@ -1531,5 +1534,35 @@ class pdf_azur extends ModelePDFPropales
 		return pdf_pagefoot($pdf,$outputlangs,'PROPALE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
 	}
 
+	/**
+	 *	Show area for the customer to sign
+	 *
+	 *	@param	PDF			$pdf            Object PDF
+	 *	@param  Facture		$object         Object invoice
+	 *	@param	int			$posy			Position depart
+	 *	@param	Translate	$outputlangs	Objet langs
+	 *	@return int							Position pour suite
+	 */
+	function _signature_area(&$pdf, $object, $posy, $outputlangs)
+	{
+		$default_font_size = pdf_getPDFFontSize($outputlangs);
+		$tab_top = $posy + 4;
+		$tab_hl = 4;
+		$pdf->SetFont('','', $default_font_size - 1);
+
+		$posx = 120;
+		$largcol = ($this->page_largeur - $this->marge_droite - $posx);
+		$useborder=0;
+		$index = 0;
+		// Total HT
+		$pdf->SetFillColor(255,255,255);
+		$pdf->SetXY($posx, $tab_top + 0);
+		$pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1);
+		
+		$pdf->SetXY($posx, $tab_top + $tab_hl);
+		$pdf->MultiCell($largcol, $tab_hl*6, '', 1, 'R');
+		
+		return ($tab_hl*7);
+	}
 }
 
diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang
index c57e9c38324..168f98a2789 100644
--- a/htdocs/langs/en_US/propal.lang
+++ b/htdocs/langs/en_US/propal.lang
@@ -98,3 +98,4 @@ DocModelJauneDescription=Jaune proposal model
 DefaultModelPropalCreate=Default model creation
 DefaultModelPropalToBill=Default template when closing a business proposal (to be invoiced)
 DefaultModelPropalClosed=Default template when closing a business proposal (unbilled)
+ProposalCustomerSignature=Written acceptance, company stamp, date and signature
\ No newline at end of file
-- 
GitLab