1 <% include( 'elements/cust_main_dayranges.html',
2 #'title' => 'Prepaid Balance Aging Summary', #???
3 'title' => 'Unapplied Payments Aging Summary',
4 'range_sub' => \&unapplied_payments,
9 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
16 # my $balance = balance(
18 # 'no_as' => 1, #set to true when using in a WHERE clause (supress AS clause)
19 # #or 0 / omit when using in a SELECT clause as a column
20 # # ("AS balance_$start_$end")
21 # 'sum' => 1, #set to true to get a SUM() of the values, for totals
23 # #obsolete? options for totals (passed to cust_main::balance_date_sql)
24 # 'total' => 1, #set to true to remove all customer comparison clauses
25 # 'join' => $join, #JOIN clause
26 # 'where' => \@where, #WHERE clause hashref (elements "AND"ed together)
30 sub unapplied_payments {
31 my($start, $end, %opt) = @_;
34 # #handle start and end ranges (86400 = 24h * 60m * 60s)
35 # my $str2time = str2time_sql;
36 # my $closing = str2time_sql_closing;
37 # $start = $start ? "( $str2time now() $closing - ".($start * 86400). ' )' : '';
38 # $end = $end ? "( $str2time now() $closing - ".($end * 86400). ' )' : '';
40 # #$opt{'unapplied_date'} = 1;
42 # FS::cust_main->balance_date_sql( $start, $end, %opt ).