From b4c8822281adfaa9c3499160abdbce46381ccee1 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Tue, 5 Jul 2016 16:27:14 +0200
Subject: [PATCH] Fix style of text after ref on invoices

---
 htdocs/compta/facture.php             |  6 +++---
 htdocs/core/class/html.form.class.php | 11 +++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 14f3ea7075f..9b2d39c4487 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2930,16 +2930,16 @@ else if ($id > 0 || ! empty($ref))
 	// Ref
 	print '<tr><td width="20%">' . $langs->trans('Ref') . '</td>';
 	print '<td colspan="5">';
-	$morehtmlref = '';
+	$morehtmlright = '';
 	$discount = new DiscountAbsolute($db);
 	$result = $discount->fetch(0, $object->id);
 	if ($result > 0) {
-		$morehtmlref = ' (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
+		$morehtmlright = '&nbsp; (' . $langs->trans("CreditNoteConvertedIntoDiscount", $discount->getNomUrl(1, 'discount')) . ')';
 	}
 	if ($result < 0) {
 		dol_print_error('', $discount->error);
 	}
-	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', '', '', 0, '', '', $morehtmlright);
 	print '</td></tr>';
 
 	// Ref customer
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d4267eccfb1..507f45a12f8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5582,10 +5582,11 @@ class Form
      *    @param	string	$moreparam  	More param to add in nav link url.
      *	  @param	int		$nodbprefix		Do not include DB prefix to forge table name
      *	  @param	string	$morehtmlleft	More html code to show before ref
-     *	  @param	string	$morehtmlright	More html code to show before navigation arrows
+     *	  @param	string	$morehtmlstatus	More html code to show under navigation arrows (status place)
+     *	  @param	string	$morehtmlright	More html code to show after ref
      * 	  @return	string    				Portion HTML avec ref + boutons nav
      */
-    function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlright='')
+    function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
     {
     	global $langs,$conf;
 
@@ -5604,7 +5605,7 @@ class Form
         //print "xx".$previous_ref."x".$next_ref;
         $ret.='<div style="vertical-align: middle">';
         
-		$ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
+		if ($morehtmlleft) $ret.='<div class="inline-block floatleft">'.$morehtmlleft.'</div>';
         
         $ret.='<div class="inline-block floatleft valignmiddle refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
 
@@ -5624,6 +5625,8 @@ class Form
         }
 		$ret.='</div>';
 
+		if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
+		
         if ($previous_ref || $next_ref || $morehtml)
         {
         	$ret.='<div class="pagination"><ul>';
@@ -5641,7 +5644,7 @@ class Form
         {
             $ret.='</ul></div>';
         }
-		if ($morehtmlright) $ret.='<div class="statusref">'.$morehtmlright.'</div>';
+		if ($morehtmlstatus) $ret.='<div class="statusref">'.$morehtmlstatus.'</div>';
         $ret.='</div>';
 		
         return $ret;
-- 
GitLab