summaryrefslogtreecommitdiff
path: root/httemplate/search/report_cust_main.html
blob: 0ef5a5196b30eb1f60931436eff85e7552abf5ac (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<& /elements/header.html, mt('Customer Report') &>

<FORM ACTION="cust_main.html" METHOD="GET">
<INPUT TYPE="hidden" NAME="magic" VALUE="bill">

  <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,
                  'curr_value'    => scalar($cgi->param('agentnum')),
                  'disable_empty' => 0,
    &>

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

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

    <TR>
      <TD ALIGN="right" VALIGN="center"><% mt('Address') |h %></TD>
      <TD><INPUT TYPE="text" NAME="address" SIZE=54></TD>
    </TR>

    <TR>
        <TD ALIGN="right" VALIGN="center"><% mt('Signup date') |h %></TD>
        <TD>
        <TABLE>
            <& /elements/tr-input-beginning_ending.html,
                      prefix   => 'signupdate',
                      layout   => 'horiz',
            &>
        </TABLE>
        </TD>
    </TR>

    <& /elements/tr-select-cust_tag.html,
                  'cgi'		 => $cgi,
                  'is_report'    => 1,
                  'multiple'     => 1,
    &>

    <& /elements/tr-select-payby.html,
                  'payby_type'   => 'cust',
                  'multiple'     => 1,
                  'all_selected' => 1,
    &>

    <TR>
      <TD ALIGN="right"><% mt('Payment expiration before') |h %></TD>
      <TD>
        <SELECT NAME="paydate_month" DISABLED>
%         foreach my $month ( 1 .. 12 ) {
            <OPTION VALUE="<% $month %>"><% $month %></OPTION>
%         }
        </SELECT>
        /
        <SELECT NAME="paydate_year" onChange="paydate_year_changed(this);">
          <OPTION VALUE=""></OPTION>
%         my $lastyear = (localtime(time))[5] + 1899;
%         foreach my $year ( $lastyear .. $lastyear+12 ) {
            <OPTION VALUE="<% $year %>"><% $year %></OPTION>
%         }
        </SELECT>
      </TD>
    </TR>

    <SCRIPT TYPE="text/javascript">
      function paydate_year_changed(what) {
        var value = what.options[what.selectedIndex].value;
        var month_select = what.form.paydate_month;
        if ( value == '' ) {
          month_select.disabled = true;
        } else {
          month_select.disabled = false;
        }
      }
    </SCRIPT>
 
    <TR>
      <TD ALIGN="right"><% mt('Invoice terms') |h %></TD>
      <TD>
        <& /elements/select-terms.html,
                      'pre_options' => [ '' => emt('all') ],
                      'empty_value' => 'NULL',
        &>
      </TD>
    </TR>
    
    <& /elements/tr-input-lessthan_greaterthan.html,
                  label   => emt('Current balance'),
                  field   => 'current_balance',
    &>

    <TR>
      <TD ALIGN="right" VALIGN="center"><% mt('Include cancelled packages') |h %></TD>
        <TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>
    </TR>

    <TR>
      <TD ALIGN="right" VALIGN="center"><% mt('Without census tract') |h %></TD>
        <TD><INPUT TYPE="checkbox" NAME="no_censustract"></TD>
    </TR>

%   if ( $conf->exists('enable_taxproducts') ) {

      <TR>
        <TD ALIGN="right" VALIGN="center"><% mt('With hardcoded tax location') |h %></TD>
          <TD><INPUT TYPE="checkbox" NAME="with_geocode"></TD>
      </TR>

%   }

    <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 &>

    <TR>
      <TD ALIGN="right" VALIGN="center"><% mt('Add package columns') |h %></TD>
        <TD><INPUT TYPE="checkbox" NAME="flattened_pkgs"></TD>
    </TR>
  </TABLE>

<BR>
<INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">

</FORM>

<& /elements/footer.html &>
<%init>

die "access denied"
  unless ( $FS::CurrentUser::CurrentUser->access_right('List customers') &&
           $FS::CurrentUser::CurrentUser->access_right('List packages')
         );

my $conf = new FS::Conf;

</%init>