X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_credit_bill_pkg.html;h=a57a5ae1ab74c8e036d8f2635946ea245c4de7e9;hb=f2e7b5d30a04b6f050e0a82afd8b95c81730bc0c;hp=4612118a281ec837d693aad4093ca7f9e4077205;hpb=65acf1fd9746f1dd98e061044657c185367f7903;p=freeside.git diff --git a/httemplate/search/cust_credit_bill_pkg.html b/httemplate/search/cust_credit_bill_pkg.html index 4612118a2..a57a5ae1a 100644 --- a/httemplate/search/cust_credit_bill_pkg.html +++ b/httemplate/search/cust_credit_bill_pkg.html @@ -1,10 +1,10 @@ <% include( 'elements/search.html', - 'title' => 'Tax credits', #well, actually application of - 'name' => 'tax credits', # credit to line item - 'query' => $query, - 'count_query' => $count_query, - 'count_addl' => [ $money_char. '%.2f total', ], - 'header' => [ + 'title' => 'Credit application detail', #to line item + 'name_singular' => 'credit application', + 'query' => $query, + 'count_query' => $count_query, + 'count_addl' => [ $money_char. '%.2f total', ], + 'header' => [ #'#', 'Amount', @@ -21,8 +21,8 @@ 'Invoice', 'Date', FS::UI::Web::cust_header(), - ], - 'fields' => [ + ], + 'fields' => [ #'creditbillpkgnum', sub { sprintf($money_char.'%.2f', shift->amount ) }, @@ -37,8 +37,8 @@ 'invnum', sub { time2str('%b %d %Y', shift->_date ) }, \&FS::UI::Web::cust_fields, - ], - 'sort_fields' => [ + ], + 'sort_fields' => [ 'amount', 'cust_credit_date', '', #'otaker', @@ -47,8 +47,8 @@ 'invnum', '_date', #cust fields - ], - 'links' => [ + ], + 'links' => [ '', '', '', @@ -59,9 +59,9 @@ ( map { $_ ne 'Cust. Status' ? $clink : '' } FS::UI::Web::cust_header() ), - ], - 'align' => 'rrlllrr'.FS::UI::Web::cust_aligns(), - 'color' => [ + ], + 'align' => 'rrlllrr'.FS::UI::Web::cust_aligns(), + 'color' => [ '', '', '', @@ -71,7 +71,7 @@ '', FS::UI::Web::cust_colors(), ], - 'style' => [ + 'style' => [ '', '', '', @@ -80,7 +80,7 @@ '', '', FS::UI::Web::cust_styles(), - ], + ], ) %> <%init> @@ -106,6 +106,10 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { push @where, "cust_main.agentnum = $1"; } +if ( $cgi->param('billpkgnum') =~ /^(\d+)$/ ) { + push @where, "billpkgnum = $1"; +} + #classnum # not specified: all classes # 0: empty class @@ -346,7 +350,7 @@ if ( $cgi->param('cust_tax') ) { push @where, $cust_exempt; } -my $count_query = "SELECT COUNT(DISTINCT billpkgnum), +my $count_query = "SELECT COUNT(DISTINCT creditbillpkgnum), SUM(cust_credit_bill_pkg.amount)"; my $join_cust = @@ -412,8 +416,8 @@ my $join_credit = ' LEFT JOIN cust_credit_bill USING ( creditbillnum ) LEFT JOIN cust_credit USING ( crednum ) '; $count_query .= " FROM cust_credit_bill_pkg - $join_pkg $join_cust_bill_pkg + $join_pkg $join_credit $join_cust $where"; @@ -430,8 +434,8 @@ push @select, 'cust_main.custnum', my $query = { 'table' => 'cust_credit_bill_pkg', - 'addl_from' => "$join_pkg - $join_cust_bill_pkg + 'addl_from' => "$join_cust_bill_pkg + $join_pkg $join_credit $join_cust", 'hashref' => {},