X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fxmlhttp-cust_main-email_search.html;h=eb9ecc8f65a0ed185ff2bd3d63bc054bfe1c47ea;hp=d8c8ef44ca5ca4361bf73f361a18bea94c244035;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=06e353b743e7be88afa8fce50ea10f27ebb7adef diff --git a/httemplate/misc/xmlhttp-cust_main-email_search.html b/httemplate/misc/xmlhttp-cust_main-email_search.html index d8c8ef44c..eb9ecc8f6 100644 --- a/httemplate/misc/xmlhttp-cust_main-email_search.html +++ b/httemplate/misc/xmlhttp-cust_main-email_search.html @@ -1,4 +1,4 @@ -<% JSON::to_json(\@result) %>\ +<% encode_json(\@result) %>\ <%init> die 'access denied' unless $FS::CurrentUser::CurrentUser->access_right('Edit customer'); @@ -6,14 +6,14 @@ die 'access denied' my $sub = $cgi->param('sub'); my $email = $cgi->param('arg'); my @where = ( - "cust_main_invoice.dest != 'POST'", - "cust_main_invoice.dest LIKE ".dbh->quote('%'.$email.'%'), + 'contact_email.emailaddress LIKE '.dbh->quote('%'.$email.'%'), $FS::CurrentUser::CurrentUser->agentnums_sql(table => 'cust_main'), ); my @cust_main = qsearch({ 'table' => 'cust_main', - 'select' => 'cust_main.*, cust_main_invoice.dest', - 'addl_from' => 'JOIN cust_main_invoice USING (custnum)', + 'select' => 'cust_main.*', + 'addl_from' => ' JOIN cust_contact USING (custnum) '. + ' JOIN contact_email USING (contactnum)', 'extra_sql' => 'WHERE '.join(' AND ', @where), });