Option to ignore old CDRs, RT#81480
[freeside.git] / httemplate / search / report_future_autobill.html
1 <%doc>
2
3 Display pre-report page for the Future Auto Bill Transactions report
4
5 Report runs in the queue.  Once the report is generated, user is
6 redirected to the report results.
7
8 </%doc>
9 <% include('/elements/header.html', $report_title ) %>
10
11
12 % if ( FS::TaxEngine->new->info->{batch} ) {
13
14   <div style="font-color: red">
15   NOTE: This report is disabled due to tax engine configuration
16   </div>
17
18 % } else {
19
20   <FORM NAME="future_autobill" ID="future_autobill">
21     <TABLE>
22     <& /elements/tr-input-date-field.html,
23       {
24         name     => 'target_date',
25         value    => $target_date,
26         label    => emt('Target billing date').': ',
27         required => 1
28       }
29     &>
30
31     <% include('/elements/tr-select-agent.html',
32                 'label'         => 'For agent: ',
33                 'disable_empty' => 0,
34               )
35     %>
36     </TABLE>
37     <BR>
38
39     <INPUT ID="future_autobill_submit" TYPE="submit" VALUE="<% mt('Get Report') |h %>">
40   </FORM>
41
42   <% include( '/elements/progress-init.html',
43               'future_autobill',
44               [ qw( agentnum target_date ) ],
45               'report_future_autobill-queued_job.html',
46             )
47   %>
48
49   <script type="text/javascript">
50     $('#future_autobill').submit( function( event ) {
51       $('#future_autobill').prop( 'disabled', true );
52       $('#future_autobill_submit').prop( 'disabled', true );
53       event.preventDefault();
54       process();
55     });
56   </script>
57
58 % }
59
60 <% include('/elements/footer.html') %>
61
62 <%init>
63 use FS::cust_payby;
64 use FS::CurrentUser;
65
66 die "access denied"
67   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
68
69 my $target_date = DateTime->now->add(days => 1)->mdy('/');
70 my $report_title = FS::cust_payby->future_autobill_report_title;
71
72 </%init>
73