From: ivan Date: Mon, 5 Feb 2007 13:10:16 +0000 (+0000) Subject: add "over X days" option to receivables report X-Git-Tag: TRIXBOX_2_6~677 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=509db87bd528fdb6bea716bf501e44ff854a485c add "over X days" option to receivables report --- 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 } + +<%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 = <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 @@ - <% include( '/elements/tr-select-agent.html' ) %> + <% include( '/elements/tr-select-agent.html' ) %> + + + + +
Over days