diff options
author | ivan <ivan> | 2007-02-05 13:10:16 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-02-05 13:10:16 +0000 |
commit | 509db87bd528fdb6bea716bf501e44ff854a485c (patch) | |
tree | 5918ca9df10e6fc3f4866dde40018e40ca0fcacb | |
parent | 17856ff5c299e4db21da28116f2666655c03f2c7 (diff) |
add "over X days" option to receivables report
-rwxr-xr-x | httemplate/search/report_receivables.cgi | 19 | ||||
-rwxr-xr-x | httemplate/search/report_receivables.html | 7 |
2 files changed, 20 insertions, 6 deletions
diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi index af8e07678..5003e86c0 100755 --- a/httemplate/search/report_receivables.cgi +++ b/httemplate/search/report_receivables.cgi @@ -83,10 +83,7 @@ ) %> -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); +<%once> sub owed { my($start, $end, %opt) = @_; @@ -140,6 +137,12 @@ END } +</%once> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Financial reports'); + my @ranges = ( [ 0, 30 ], [ 30, 60 ], @@ -165,7 +168,13 @@ my $packages_cols = <<END; ( $select_count_pkgs AND $cancelled_sql ) AS cancelled_pkgs END -my $where = "where ". owed(0, 0, 'cust'=>1, 'noas'=>1). " > 0"; +my $days = 0; +if ( $cgi->param('days') =~ /^\s*(\d+)\s*$/ ) { + $days = $1; +} + +#my $where = "where ". owed(0, 0, 'cust'=>1, 'noas'=>1). " > 0"; +my $where = "where ". owed($days, 0, 'cust'=>1, 'noas'=>1). " > 0"; my $agentnum = ''; if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { diff --git a/httemplate/search/report_receivables.html b/httemplate/search/report_receivables.html index 21ca1e185..bb23f1f87 100755 --- a/httemplate/search/report_receivables.html +++ b/httemplate/search/report_receivables.html @@ -4,7 +4,12 @@ <TABLE> - <% include( '/elements/tr-select-agent.html' ) %> + <% include( '/elements/tr-select-agent.html' ) %> + + <TR> + <TD ALIGN="right">Over </TD> + <TD><INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3> days</TD> + </TR> </TABLE> |