From 509db87bd528fdb6bea716bf501e44ff854a485c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 5 Feb 2007 13:10:16 +0000 Subject: [PATCH] add "over X days" option to receivables report --- httemplate/search/report_receivables.cgi | 19 ++++++++++++++----- 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 } + +<%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
-- 2.11.0