X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=48114079317c93195e8d3834cae875c8bb5578d9;hb=992573160bf2fc89b1d957973109e03d2abf0a47;hp=0b0dd4ffe85d22cd9d312bf2607c273c118a10d6;hpb=6a38629bcb54a2ad9b8a5de6cac9f478bc4a7e66;p=freeside.git
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 0b0dd4ffe..481140793 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -150,15 +150,15 @@
% ? qq!!. encode_entities($company). ''
% : ' ';
%
-% my $status = $cust_main->status;
-% my $statuscol = $cust_main->statuscolor;
+% my $status_label = $cust_main->status_label;
+% my $statuscolor = $cust_main->statuscolor;
>
<% $cust_main->display_custnum %>
|
>
- <% ucfirst($status) %>
+ <% $status_label %>
|
>
<% "$last, $first" |h %>
@@ -341,7 +341,12 @@ if ( $cgi->param('browse')
if ( $query eq 'custnum' ) {
if ( $conf->exists('cust_main-default_agent_custid') ) {
$sortby=\*display_custnum_sort;
- $orderby = "ORDER BY CASE WHEN agent_custid IS NOT NULL AND agent_custid != '' THEN CAST(agent_custid AS BIGINT) ELSE custnum END";
+ $orderby = "ORDER BY CASE WHEN agent_custid IS NOT NULL
+ AND agent_custid != ''
+ AND agent_custid ". regexp_sql. " '^[0-9]+\$'
+ THEN CAST(agent_custid AS BIGINT)
+ ELSE custnum
+ END";
} else {
$sortby=\*custnum_sort;
$orderby = "ORDER BY custnum";
@@ -471,9 +476,6 @@ if ( $cgi->param('browse')
$orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )";
push @cust_main, smart_search(
'search' => scalar($cgi->param('search_cust')),
- 'no_fuzzy_on_exact' => ! ( $curuser->option('enable_fuzzy_on_exact')
- || $conf->exists('enable_fuzzy_on_exact')
- ),
);
}
|