Skip to content

Commit

Permalink
Fix: Search on contract ref
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 31, 2013
1 parent 22447cd commit ecfca85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion htdocs/contrat/liste.php
Expand Up @@ -80,7 +80,7 @@
if ($socid) $sql.= " AND s.rowid = ".$socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'";
if ($search_contract) $sql.= " AND (".(is_numeric($search_contract)?"c.rowid = '".$db->escape($search_contract)."' OR ":'')." c.ref = '".$db->escape($search_contract)."')";
if ($sall) $sql.= " AND (s.nom LIKE '%".$db->escape($sall)."%' OR cd.label LIKE '%".$db->escape($sall)."%' OR cd.description LIKE '%".$db->escape($sall)."%')";
$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,";
$sql.= " s.nom, s.rowid";
Expand Down

0 comments on commit ecfca85

Please sign in to comment.