ff2f85715389e8cb40dd950af29cbb1c1a60dab1
[freeside.git] / httemplate / search / report_future_autobill.html
1 <%doc>
2
3 Display date selector for the future_autobill.html report
4
5 </%doc>
6 <% include('/elements/header.html', $report_title ) %>
7
8
9 % if ( FS::TaxEngine->new->info->{batch} ) {
10
11   <div style="font-color: red">
12   NOTE: This report is disabled due to tax engine configuration
13   </div>
14
15 % } else {
16
17   <FORM ACTION="future_autobill.html" METHOD="GET">
18   <TABLE>
19   <& /elements/tr-input-date-field.html,
20     {
21       name     => 'target_date',
22       value    => $target_date,
23       label    => emt('Target billing date').': ',
24       required => 1
25     }
26   &>
27
28   </TABLE>
29
30   <BR>
31
32   <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
33
34   </FORM>
35
36 % }
37
38 <% include('/elements/footer.html') %>
39
40 <%init>
41 use FS::cust_payby;
42
43 die "access denied"
44   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
45
46 my $target_date = DateTime->now->add(days => 1)->mdy('/');
47
48 # Dynamic report title
49 my $title_types = '';
50 my $card_count = FS::cust_payby->count_autobill_cards;
51 my $check_count = FS::cust_payby->count_autobill_checks;
52 if ( $card_count && $check_count ) {
53   $title_types = 'Card and Check';
54 } elsif ( $card_count ) {
55   $title_types = 'Card';
56 } elsif ( $check_count ) {
57   $title_types = 'Check';
58 }
59
60 my $report_title = sprintf(
61   'Upcoming Auto Bill %s Transactions',
62   $title_types,
63 );
64
65 </%init>
66