X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_credit_bill.html;h=fb71061621ea92979d7f40896eee525358a9b255;hp=9fd6a987aca65262c1399b2dffe771f104f6d6f7;hb=45d8ea4c5d8d66f2945c05a71f2e695c0bf00dac;hpb=64948ee373a03fa156ebc89cb39adfa6d4d2c3d5 diff --git a/httemplate/search/cust_credit_bill.html b/httemplate/search/cust_credit_bill.html index 9fd6a987a..fb7106162 100644 --- a/httemplate/search/cust_credit_bill.html +++ b/httemplate/search/cust_credit_bill.html @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => $title, 'name' => 'net credits', 'query' => $sql_query, @@ -64,8 +64,8 @@ '', FS::UI::Web::cust_styles(), ], - ) -%> + +&> <%init> die "access denied" @@ -79,14 +79,14 @@ my $title = 'Net Credit Search Results'; my @search = (); if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) { - push @search, "agentnum = $1"; + push @search, "cust_main.agentnum = $1"; my $agent = qsearchs('agent', { 'agentnum' => $1 } ); die "unknown agentnum $1" unless $agent; $title = $agent->agent. " $title"; } if ( $cgi->param('refnum') && $cgi->param('refnum') =~ /^(\d+)$/ ) { - push @search, "refnum = $1"; + push @search, "cust_main.refnum = $1"; my $part_referral = qsearchs('part_referral', { 'refnum' => $1 } ); die "unknown refnum $1" unless $part_referral; $title = $part_referral->referral. " $title"; @@ -103,8 +103,8 @@ my $where = 'WHERE '. join(' AND ', @search); # my $count_query = 'SELECT COUNT(*), SUM(amount) FROM cust_credit_bill - LEFT JOIN cust_bill USING ( invnum ) - LEFT JOIN cust_main USING ( custnum ) '. + LEFT JOIN cust_bill USING ( invnum ) '. + FS::UI::Web::join_cust_main('cust_bill') . $where; my $sql_query = { @@ -121,8 +121,8 @@ my $sql_query = { 'hashref' => {}, 'extra_sql' => $where, 'addl_from' => 'LEFT JOIN cust_bill USING ( invnum ) - LEFT JOIN cust_credit USING ( crednum ) - LEFT JOIN cust_main ON ( cust_bill.custnum = cust_main.custnum )', + LEFT JOIN cust_credit USING ( crednum )'. + FS::UI::Web::join_cust_main('cust_bill') }; my $cust_bill_link = sub {