summaryrefslogtreecommitdiff
path: root/httemplate/search/report_future_autobill.html
blob: 28f589ee7d3536e031e471b2dac08a57d40e784a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<%doc>

Display pre-report page for the Future Auto Bill Transactions report

Report runs in the queue.  Once the report is generated, user is
redirected to the report results.

</%doc>
<% include('/elements/header.html', $report_title ) %>


% if ( FS::TaxEngine->new->info->{batch} ) {

  <div style="font-color: red">
  NOTE: This report is disabled due to tax engine configuration
  </div>

% } else {

  <FORM NAME="future_autobill" ID="future_autobill">
    <TABLE>
    <& /elements/tr-input-date-field.html,
      {
        name     => 'target_date',
        value    => $target_date,
        label    => emt('Target billing date').': ',
        required => 1
      }
    &>

    <% include('/elements/tr-select-agent.html',
                'label'         => 'For agent: ',
                'disable_empty' => 0,
              )
    %>
    </TABLE>
    <BR>

    <INPUT ID="future_autobill_submit" TYPE="submit" VALUE="<% mt('Get Report') |h %>">
  </FORM>

  <% include( '/elements/progress-init.html',
              'future_autobill',
              [ qw( agentnum target_date ) ],
              'report_future_autobill-queued_job.html',
            )
  %>

  <script type="text/javascript">
    $('#future_autobill').submit( function( event ) {
      $('#future_autobill').prop( 'disabled', true );
      $('#future_autobill_submit').prop( 'disabled', true );
      event.preventDefault();
      process();
    });
  </script>

% }

<% include('/elements/footer.html') %>

<%init>
use FS::cust_payby;
use FS::CurrentUser;

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');

my $target_date = DateTime->now->add(days => 1)->mdy('/');
my $report_title = FS::cust_payby->future_autobill_report_title;

</%init>