[freeside-commits] branch FREESIDE_4_BRANCH updated. 11d5740bd96b166b6cd4f90fde22b556f93b5caf

Ivan ivan at 420.am
Mon Dec 7 10:54:36 PST 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  11d5740bd96b166b6cd4f90fde22b556f93b5caf (commit)
      from  00fb90f744ceddb3b36bf2820b7279742cd3ae43 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 11d5740bd96b166b6cd4f90fde22b556f93b5caf
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Dec 7 10:54:35 2015 -0800

    fix customer browse in the presense of non-numeric agent_custid, RT#31388

diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index f48ea3f..5a574bc 100755
--- 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;
-        $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";

-----------------------------------------------------------------------

Summary of changes:
 httemplate/search/cust_main.cgi |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list