X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fsearch%2Fcustomer_accounting_summary.html;h=12c896276cad5503e6dac98d36ba2e894222e440;hb=e55892bdf6dc95710a19876087690a9664421215;hp=0e9e24fa6c9b92eae236678bc62e86f560175603;hpb=a72a10f754f7465121d6137bb3dcee0a21ea6443;p=freeside.git diff --git a/httemplate/search/customer_accounting_summary.html b/httemplate/search/customer_accounting_summary.html index 0e9e24fa6..12c896276 100644 --- a/httemplate/search/customer_accounting_summary.html +++ b/httemplate/search/customer_accounting_summary.html @@ -142,8 +142,7 @@ $title .= $sel_part_referral->referral.' ' $title .= 'Customer Accounting Summary Report'; -my @custs = (); -@custs = qsearch('cust_main', {} ); +my @cust_classnums = grep /^\d+$/, $cgi->param('cust_classnum'); my @items = ('netsales', 'cashflow'); my @params = ( [], [] ); @@ -167,6 +166,18 @@ my @custnames = (); my $status = $cgi->param('status'); die "invalid status" unless $status =~ /^\w+|$/; +my %search_hash; +foreach (qw(agentnum refnum status)) { + if ( defined $cgi->param($_) ) { + $search_hash{$_} = $cgi->param($_); + } +} +$search_hash{'classnum'} = [ $cgi->param('cust_classnum') ] + if $cgi->param('cust_classnum'); + +my $query = FS::cust_main::Search->search(\%search_hash); +my @custs = qsearch($query); + foreach my $cust_main ( @custs ) { # XXX should do this in the qsearch next unless ($status eq '' || $status eq $cust_main->status);