X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcustomer_accounting_summary.html;h=b48ff21e3d7f47f990504b24fa21fd2fa1d59d4f;hb=a9f4e76c1d2392514c4172dd869fd101e3a9c6ec;hp=0e9e24fa6c9b92eae236678bc62e86f560175603;hpb=e710e07e4451b7c615fb477799dc64bf3490248c;p=freeside.git diff --git a/httemplate/search/customer_accounting_summary.html b/httemplate/search/customer_accounting_summary.html index 0e9e24fa6..b48ff21e3 100644 --- a/httemplate/search/customer_accounting_summary.html +++ b/httemplate/search/customer_accounting_summary.html @@ -142,9 +142,6 @@ $title .= $sel_part_referral->referral.' ' $title .= 'Customer Accounting Summary Report'; -my @custs = (); -@custs = qsearch('cust_main', {} ); - my @items = ('netsales', 'cashflow'); my @params = ( [], [] ); my $setuprecur = ''; @@ -167,6 +164,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 grep { $_ eq 'cust_classnum' } $cgi->param; + +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);