Fix search on accounting account when option to padd 0 is on.

This commit is contained in:
Laurent Destailleur 2020-01-21 22:26:37 +01:00
parent 8f1737952d
commit 80648db7fc

View File

@ -217,7 +217,11 @@ if (strlen(trim($search_account))) {
}
//var_dump($search_account); exit;
if ($search_account_tmp) {
if ($weremovedsomezero) $sql .= " AND aa.account_number LIKE '%".$search_account_tmp."'";
if ($weremovedsomezero) {
$startchar = '%';
if (strpos('^', $search_account_tmp) === 0) $startchar = '';
else $sql .= " AND aa.account_number LIKE '".$startchar.$search_account_tmp."'";
}
else $sql .= natural_search("aa.account_number", $search_account_tmp);
}
}