summaryrefslogtreecommitdiff
path: root/httemplate/search/report_receivables.html
blob: 20a98bef6590f80720d9fcefaf2f3c1a1eeb9541 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<& /elements/header.html, mt('Accounts Receivable Aging Summary') &>

<FORM NAME="OneTrueForm" ACTION="report_receivables.cgi" METHOD="GET">

<TABLE BGCOLOR="#cccccc" CELLSPACING=0>

  <TR>
    <TH CLASS="background" COLSPAN=2 ALIGN="left">
      <FONT SIZE="+1"><% mt('Search options') |h %></FONT>
    </TH>
  </TR>

  <& /elements/tr-select-agent.html, 'disable_empty'=>0  &>

  <& /elements/tr-select-cust_main-status.html,
                'label' => emt('Customer Status'),
  &>

  <& /elements/tr-select-cust_class.html,
     'label'        => emt('Customer class'),
     'field'        => 'cust_classnum',
     'multiple'     => 1,
     'pre_options'  => [ '' => emt('(none)') ],
     'all_selected' => 1,
  &>

  <TR>
    <TD ALIGN="right"><% mt('Customers') |h %></TD>
    <TD>
      <SCRIPT TYPE="text/javascript">
function toggle(obj) {
  var f = document.OneTrueForm;
  var val = (obj.value == obj.checked);
  f.days.disabled = val;
  f.negative.disabled = val;
  f.days.style.backgroundColor = val ? '#dddddd' : '#ffffff';
}
      </SCRIPT>
      <TABLE STYLE="padding: 0px">
        <TR>
            <TD><INPUT TYPE="radio" NAME="all_customers" VALUE="1" onClick="toggle(this)"></TD>
            <TD><% mt('All customers (even those without an outstanding balance)') |h %></TD>
        </TR>
        <TR>
            <TD><INPUT TYPE="radio" NAME="all_customers" VALUE="0" CHECKED onClick="toggle(this)"></TD>
            <TD>
%       my $daysinput = qq!<INPUT NAME="days" TYPE="text" SIZE=4 MAXLENGTH=3 VALUE="0">!;
%       my $str = emt("Customers with a balance over [_1] days old",'XXXDAYSXXX'); # yeah it's a hack
%       $str =~ s/XXXDAYSXXX/$daysinput/;
            <% $str %>
            </TD>
        </TR>
        <TR>
            <TD></TD>
            <TD><INPUT TYPE="checkbox" NAME="negative" VALUE="1">&nbsp;<% mt('Including customers with credit balances') |h %></TD>
        </TR>
      </TABLE>
    </TD>
  </TR>
  <& /elements/tr-input-date-field.html, {
                'name'      => 'as_of',
                'value'     => time,
                'label'     => emt('At the end of date '),
                'format'    => FS::Conf->new->config('date_format') || '%m/%d/%Y',
                } 
  &>

  <TR>
    <TH CLASS="background" COLSPAN=2>&nbsp;</TH>
  </TR>

  <TR>
    <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1"><% mt('Display options') |h %></FONT></TH>
  </TR>
  <& /elements/tr-select-cust-fields.html &>

</TABLE>

<BR><INPUT TYPE="submit" VALUE="Get Report">
</FORM>

<& /elements/footer.html &>

<%init>

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

</%init>