X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_bill.html;fp=httemplate%2Fsearch%2Fcust_bill.html;h=751bef677fef292b194f05e0a100df82f6b96e4c;hp=6f440db7ed7eb144ad648444b2cb1bc7eb3c6852;hb=b0ca0f4c6dc42596f1b1d838f897042589af8252;hpb=978cc3533b38efa38c63898fa7814a4b38efdee3 diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 6f440db7e..751bef677 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -15,7 +15,7 @@ FS::UI::Web::cust_header(), ], 'fields' => [ - 'invnum', + 'display_invnum', sub { sprintf($money_char.'%.2f', shift->get('owed') ) }, sub { sprintf($money_char.'%.2f', shift->get('net') ) }, sub { sprintf($money_char.'%.2f', shift->charged ) }, @@ -69,15 +69,17 @@ my %search; if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) { - $count_query = - "SELECT COUNT(*) FROM cust_bill $join_cust_main". - " WHERE invnum = $2 AND $agentnums_sql"; #agent virtualization + my $invnum_or_invid = "( invnum = $2 OR agent_invid = $2 )"; + my $where = "WHERE $invnum_or_invid AND $agentnums_sql"; + + $count_query = "SELECT COUNT(*) FROM cust_bill $join_cust_main $where"; + $sql_query = { + #'select' => '*', 'table' => 'cust_bill', 'addl_from' => $join_cust_main, - 'hashref' => { 'invnum' => $2 }, - #'select' => '*', - 'extra_sql' => " AND $agentnums_sql", #agent virtualization + 'hashref' => {}, + 'extra_sql' => $where, }; } else {