RT# 73964 - Added biling event action to send an email to phone nunber, and updated...
[freeside.git] / httemplate / misc / xmlhttp-cust_main-search.cgi
index 16f7cd2..40697f1 100644 (file)
@@ -5,31 +5,30 @@
 %                                  # cust_main-agent_custid-format') eq 'ww?d+'
 %      $return = findbycustnum_or_agent_custid($1);
 %   }
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % } elsif ( $sub eq 'smart_search' ) {
 %
 %   my $string = $cgi->param('arg');
-%   my @cust_main = smart_search( 'search' => $string,
-%                                 'no_fuzzy_on_exact' => 1, #pref?
-%                               );
+%   my @cust_main = smart_search( 'search' => $string );
 %   my $return = [ map [ $_->custnum,
 %                        $_->name,
 %                        $_->balance,
-%                        $_->ucfirst_status,
+%                        $_->status_label,
 %                        $_->statuscolor,
-%                        scalar($_->open_cust_bill)
+%                        scalar($_->open_cust_bill),
+%                        $_->display_custnum,
 %                      ],
 %                    @cust_main
 %                ];
 %     
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % } elsif ( $sub eq 'invnum_search' ) {
 %
 %   my $string = $cgi->param('arg');
 %   if ( $string =~ /^(\d+)$/ ) {
 %     my $inv = qsearchs('cust_bill', { 'invnum' => $1 });
 %     my $return = $inv ? findbycustnum($inv->custnum) : [];
-<% objToJson($return) %>
+<% encode_json($return) %>\
 %   } else { #return nothing
 []
 %   }
@@ -47,7 +46,7 @@
 %       city => $_->city,
 %     };
 %   }
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % }
 <%init>
 
@@ -64,9 +63,10 @@ sub findbycustnum {
   [ $c->custnum,
     $c->name,
     $c->balance,
-    $c->ucfirst_status,
+    $c->status_label,
     $c->statuscolor,
-    scalar($c->open_cust_bill)
+    scalar($c->open_cust_bill),
+    $c->display_custnum,
   ];
 }
 
@@ -91,9 +91,10 @@ sub findbycustnum_or_agent_custid {
   [ map [ $_->custnum,
           $_->name,
           $_->balance,
-          $_->ucfirst_status,
+          $_->status_label,
           $_->statuscolor,
           scalar($_->open_cust_bill),
+          $_->display_custnum,
         ],
 
       qsearch({