This commit was generated by cvs2svn to compensate for changes in r9232,
[freeside.git] / httemplate / search / unapplied_cust_pay.html
1 <% include( 'elements/cust_main_dayranges.html',
2                  #'title'       => 'Prepaid Balance Aging Summary', #???
3                  'title'       => 'Unapplied Payments Aging Summary',
4                  'range_sub'   => \&unapplied_payments,
5           )
6 %>
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
11
12 </%init>
13 <%once>
14
15 sub unapplied_payments {
16   my($start, $end, $offset) = @_;
17
18   #handle start and end ranges (86400 = 24h * 60m * 60s)
19   my $str2time = str2time_sql;
20   my $closing = str2time_sql_closing;
21   $start = "( $str2time now() $closing - ".($start + $offset) * 86400 . ' )';
22   $end = $end ? 
23            "( $str2time now() $closing - ".($end   + $offset) * 86400 . ' )'
24            : '';
25
26   FS::cust_main->unapplied_payments_date_sql( $start, $end );
27
28 }
29
30 </%once>