From aec39767417701ee275de46591ddb32f3325a11e Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Thu, 27 Aug 2015 22:48:52 +0200
Subject: [PATCH] Fix set ref

---
 htdocs/compta/paiement/cheque/card.php | 8 +++++---
 htdocs/langs/en_US/main.lang           | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index ba7272ef59e..e53aec7bfea 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -577,6 +577,7 @@ else
 	print '</tr>';
 
 	// External ref
+	/* Ext ref are not visible field on standard usage
 	print '<tr><td>';
 
 	print '<table class="nobordernopadding" width="100%"><tr><td>';
@@ -601,7 +602,8 @@ else
 
 	print '</td>';
 	print '</tr>';
-
+	*/
+	
 	print '<tr><td>'.$langs->trans('Account').'</td><td colspan="2">';
 	print $accountstatic->getNomUrl(1);
 	print '</td></tr>';
@@ -622,7 +624,7 @@ else
 	print '</table><br>';
 
 
-	// Liste des cheques
+	// List of cheques
 	$sql = "SELECT b.rowid, b.amount, b.num_chq, b.emetteur,";
 	$sql.= " b.dateo as date, b.datec as datec, b.banque,";
 	$sql.= " p.rowid as pid, ba.rowid as bid, p.statut";
@@ -632,7 +634,7 @@ else
 	$sql.= " WHERE ba.entity IN (".getEntity('bank_account', 1).")";
 	$sql.= " AND b.fk_type= 'CHQ'";
 	$sql.= " AND b.fk_bordereau = ".$object->id;
-	$sql.= " ORDER BY $sortfield $sortorder";
+	$sql.= $db->order($sortfield, $sortorder);
 
 	$resql = $db->query($sql);
 	if ($resql)
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 70f8a980495..7410d86fada 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -746,3 +746,4 @@ ShortFriday=F
 ShortSaturday=S
 ShortSunday=S
 SelectMailModel=Select email template
+SetRef=Set ref
\ No newline at end of file
-- 
GitLab