projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52d332b
)
fix customer browse in the presense of non-numeric agent_custid, RT#31388
author
Ivan Kohler
<ivan@freeside.biz>
Mon, 7 Dec 2015 18:54:37 +0000
(10:54 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Mon, 7 Dec 2015 18:54:37 +0000
(10:54 -0800)
httemplate/search/cust_main.cgi
patch
|
blob
|
history
diff --git
a/httemplate/search/cust_main.cgi
b/httemplate/search/cust_main.cgi
index
ff13f07
..
fb59882
100755
(executable)
--- a/
httemplate/search/cust_main.cgi
+++ b/
httemplate/search/cust_main.cgi
@@
-341,7
+341,12
@@
if ( $cgi->param('browse')
if ( $query eq 'custnum' ) {
if ( $conf->exists('cust_main-default_agent_custid') ) {
$sortby=\*display_custnum_sort;
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";
} else {
$sortby=\*custnum_sort;
$orderby = "ORDER BY custnum";