default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / search / report_receivables.cgi
1 <& elements/cust_main_dayranges.html,
2                  'title'       => emt('Accounts Receivable Aging Summary'),
3                  'range_sub'   => \&balance,
4                  'payment_links' => 1,
5                  'email_checkboxes' => 1,
6 &>
7 <%init>
8
9 die "access denied"
10   unless $FS::CurrentUser::CurrentUser->access_right('Receivables report')
11       or $FS::CurrentUser::CurrentUser->access_right('Financial reports');
12
13 </%init>
14 <%once>
15
16 #Example:
17 #
18 # my $balance = balance(
19 #   $start, $end, $offset,
20 #   'no_as'  => 1, #set to true when using in a WHERE clause (supress AS clause)
21 #                 #or 0 / omit when using in a SELECT clause as a column
22 #                 #  ("AS balance_$start_$end")
23 #   'sum'    => 1, #set to true to get a SUM() of the values, for totals
24 #
25 #   #obsolete? options for totals (passed to cust_main::balance_date_sql)
26 #   'total'  => 1, #set to true to remove all customer comparison clauses
27 #   'join'   => $join,   #JOIN clause
28 #   'where'  => \@where, #WHERE clause hashref (elements "AND"ed together)
29 # )
30
31 sub balance {
32   my($start, $end, $cutoff) = @_; #, %opt ?
33
34   FS::cust_main->balance_date_sql( $start, $end, 
35         'cutoff' => $cutoff,
36         'unapplied_date'=>1,
37   );
38 }
39
40 </%once>