'',
],
#'align' => 'rlccrrrrr',
- 'align' => $align,
+ 'align' => FS::UI::Web::cust_aligns(). 'rrrrr',
#'size' => [ '', '', '-1', '-1', '', '', '', '', '', ],
#'style' => [ '', '', 'b', 'b', '', '', '', '', 'b', ],
'size' => [ ( map '', FS::UI::Web::cust_header() ),
)
%>
-<%init>
-
-die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+<%once>
sub owed {
my($start, $end, %opt) = @_;
}
+</%once>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
my @ranges = (
[ 0, 30 ],
[ 30, 60 ],
( $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+)$/ ) {
my $conf = new FS::Conf;
my $money_char = $conf->config('money_char') || '$';
-#my $align = join('', map { /#/ ? 'r' : 'l' } FS::UI::Web::cust_header() ).
-# 'crrrrr';
-my $align = FS::UI::Web::cust_aligns().
- 'rrrrr';
-
my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ];
my $status_statuscol = sub {