[freeside-commits] branch FREESIDE_3_BRANCH updated. f2f7d6f2c69951862436cea6707d54451f6c4c65

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


The branch, FREESIDE_3_BRANCH has been updated
       via  f2f7d6f2c69951862436cea6707d54451f6c4c65 (commit)
      from  52d332b9d4ce7a9aa27ba1da57fefb03275ba9ae (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 f2f7d6f2c69951862436cea6707d54451f6c4c65
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Dec 7 10:54:37 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 ff13f07..fb59882 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