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=0d830826c9115b4eb19012dccc739963600a90e5;hb=11bbf29de447fe39e9d7155fe280a0df70fa8c3c;hpb=a7ec2c2a6b5fcc26e8da765abdf4d459cc41a20a diff --git a/httemplate/misc/xmlhttp-cust_main-email_search.html b/httemplate/misc/xmlhttp-cust_main-email_search.html index 0d830826c..eb9ecc8f6 100644 --- a/httemplate/misc/xmlhttp-cust_main-email_search.html +++ b/httemplate/misc/xmlhttp-cust_main-email_search.html @@ -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), });