param('all_customers') ) {
-$user = getotaker;
+ my $days = 0;
+ if ( $cgi->param('days') =~ /^\s*(\d+)\s*$/ ) {
+ $days = $1;
+ }
-print $cgi->header( '-expires' => '-2m' ),
- header('Current Receivables Report Results');
+ push @where, balance($days, 0, 'no_as'=>1). ' > 0'; # != 0';
-open (REPORT, "/usr/bin/freeside-receivables-report -v $user |");
+}
-print '';
-while() {
- print $_;
+if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+ my $agentnum = $1;
+ push @where, "agentnum = $agentnum";
}
-print '
';
-print '