[freeside-commits] branch master updated. 7c08f01e1a05fe4bab903bd44277b5c3784aebc5

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


The branch, master has been updated
       via  7c08f01e1a05fe4bab903bd44277b5c3784aebc5 (commit)
      from  a863f6dc3cb00b50c497f836af7255d8999be455 (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 7c08f01e1a05fe4bab903bd44277b5c3784aebc5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Dec 7 10:54:32 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