From 9d189b3c04686a5a852f3dfffd122a042f276f6e Mon Sep 17 00:00:00 2001
From: Juanjo Menent <jmenent@2byte.es>
Date: Sun, 3 Apr 2016 12:14:51 +0200
Subject: [PATCH] NEW #3510 : Working

---
 htdocs/admin/chequereceipts.php                            | 1 -
 htdocs/compta/paiement/cheque/class/remisecheque.class.php | 3 ++-
 htdocs/core/modules/cheque/doc/pdf_blochet.class.php       | 2 +-
 htdocs/core/modules/cheque/mod_chequereceipt_thyme.php     | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index 819f322b853..f319692f27d 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -183,7 +183,6 @@ foreach ($dirmodels as $reldir)
 							print '</td>'."\n";
 
 							print '<td align="center">';
-							//print "> ".$conf->global->PAYMENT_ADDON." - ".$file;
 							if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file)
 							{
 								print img_picto($langs->trans("Activated"),'switch_on');
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index c3366ea7497..6d9132f8519 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -345,7 +345,8 @@ class RemiseCheque extends CommonObject
 
 		$this->db->begin();
 
-		$numref=$this->getNextNumber();
+		//$numref=$this->getNextNumber();
+		$numref = $this->getNextNumRef();
 
 		if ($this->errno == 0 && $numref)
 		{
diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
index 0abf3c89767..042f71e628d 100644
--- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
+++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php
@@ -225,7 +225,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
 		$pdf->MultiCell(22,2,$outputlangs->transnoentities("Ref"),0,'L');
         $pdf->SetXY(32,15);
 		$pdf->SetFont('','', $default_font_size);
-        $pdf->MultiCell(60, 2, $outputlangs->convToOutputCharset($this->number.($this->ref_ext?" - ".$this->ref_ext:'')), 0, 'L');
+        $pdf->MultiCell(60, 2, $outputlangs->convToOutputCharset($this->ref.($this->ref_ext?" - ".$this->ref_ext:'')), 0, 'L');
 
 		$pdf->SetFont('','', $default_font_size);
         $pdf->SetXY(10,20);
diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
index ef0552c7e77..6df8f8a7125 100644
--- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
+++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php
@@ -52,7 +52,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 		$texte.= '<input type="hidden" name="action" value="updateMask">';
-		$texte.= '<input type="hidden" name="maskconstpayment" value="PAYMENT_THYME_MASK">';
+		$texte.= '<input type="hidden" name="maskconstchequereceipts" value="CHEQUERECEIPTS_THYME_MASK">';
 		$texte.= '<table class="nobordernopadding" width="100%">';
 
 		$tooltip=$langs->trans("GenericMaskCodes",$langs->transnoentities("Order"),$langs->transnoentities("Order"));
@@ -63,7 +63,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
 
 		// Parametrage du prefix
 		$texte.= '<tr><td>'.$langs->trans("Mask").':</td>';
-		$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskpayment" value="'.$conf->global->PAYMENT_THYME_MASK.'">',$tooltip,1,1).'</td>';
+		$texte.= '<td align="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskchequereceipts" value="'.$conf->global->CHEQUERECEIPTS_THYME_MASK.'">',$tooltip,1,1).'</td>';
 
 		$texte.= '<td align="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
 
@@ -110,7 +110,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
 		require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
 
 		// We get cursor rule
-		$mask=$conf->global->PAYMENT_THYME_MASK;
+		$mask=$conf->global->CHEQUERECEIPTS_THYME_MASK;
 
 		if (! $mask)
 		{
-- 
GitLab