add customer class to payment report, RT#25282
[freeside.git] / httemplate / search / elements / report_cust_pay_or_refund.html
1 <%doc>
2
3 Examples:
4
5   include( 'elements/report_cust_pay_or_refund.html',
6                'thing'          => 'pay',
7                'name_singular'  => 'payment',
8          )
9
10   include( 'elements/report_cust_pay_or_refund.html',
11                'thing'          => 'refund',
12                'name_singular'  => 'refund',
13          )
14
15 </%doc>
16 <& /elements/header.html, mt($title) &>
17
18 <FORM ACTION="<% $table %>.html" METHOD="GET">
19 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
20 <INPUT TYPE="hidden" NAME="unapplied" VALUE="<% $unapplied %>">
21
22 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
23
24   <TR>
25     <TH CLASS="background" COLSPAN=2 ALIGN="left">
26       <FONT SIZE="+1"><% mt('Payment search options') |h %></FONT>
27     </TH>
28   </TR>
29
30   <TR>
31     <TD ALIGN="right"><% ucfirst(PL($name_singular)) %> of type: </TD>
32     <TD>
33       <SELECT NAME="payby" SIZE=10 MULTIPLE>
34 %#        <OPTION VALUE=""><% mt('all') |h %></OPTION>
35 %#        <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
36         <OPTION VALUE="CARD-VisaMC" SELECTED><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
37         <OPTION VALUE="CARD-Amex" SELECTED><% mt('credit card (American Express)') |h %></OPTION>
38         <OPTION VALUE="CARD-Discover" SELECTED><% mt('credit card (Discover)') |h %></OPTION>
39         <OPTION VALUE="CARD-Maestro" SELECTED><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
40         <OPTION VALUE="CARD-Tokenized" SELECTED><% mt('credit card (Tokenized)') |h %></OPTION>
41         <OPTION VALUE="CHEK" SELECTED><% mt('electronic check / ACH') |h %></OPTION>
42         <OPTION VALUE="BILL" SELECTED><% mt('check') |h %></OPTION>
43         <OPTION VALUE="PREP" SELECTED><% mt('prepaid card') |h %></OPTION>
44         <OPTION VALUE="CASH" SELECTED><% mt('cash') |h %></OPTION>
45         <OPTION VALUE="WEST" SELECTED><% mt('Western Union') |h %></OPTION>
46         <OPTION VALUE="MCRD" SELECTED><% mt('manual credit card') |h %></OPTION>
47       </SELECT>
48     </TD>
49   </TR>
50
51   <TR>
52     <TD ALIGN="right"><% mt('Check #:') |h %> </TD>
53     <TD>
54       <INPUT TYPE="text" ID="payinfo" NAME="payinfo">
55     </TD>
56   </TR>
57   <TR>
58     <TD ALIGN="right"><% mt('Transaction #:') |h %> </TD>
59     <TD>
60       <INPUT TYPE="text" ID="ccpay" NAME="ccpay">
61     </TD>
62   </TR>
63
64   <& /elements/tr-select-user.html &>
65
66   <TR>
67     <TD ALIGN="right" VALIGN="center"><% mt(ucfirst($name_singular). ' date') |h %></TD>
68     <TD>
69       <TABLE>
70         <& /elements/tr-input-beginning_ending.html,
71                       layout     => 'horiz',
72                       input_time => $conf->exists('report-cust_pay-select_time'),
73         &>
74       </TABLE>
75     </TD>
76   </TR>
77
78 % if ( $void ) {
79     <TR>
80       <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
81       <TD>
82         <TABLE>
83           <& /elements/tr-input-beginning_ending.html,
84                         prefix => 'void',
85                         layout => 'horiz',
86           &>
87         </TABLE>
88       </TD>
89     </TR>
90 % }
91
92   <& /elements/tr-input-lessthan_greaterthan.html,
93                 'label' => emt('Amount'),
94                 'field' => 'paid',
95   &>
96
97
98 </TABLE>
99 <BR>
100
101
102 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
103
104   <TR>
105     <TH CLASS="background" COLSPAN=2 ALIGN="left">
106       <FONT SIZE="+1"><% mt('Customer search options') |h %></FONT>
107     </TH>
108   </TR>
109
110   <& /elements/tr-select-agent.html,
111                  'curr_value'    => scalar($cgi->param('agentnum')),
112                  'label'         => emt('Agent'),
113                  'disable_empty' => 0,
114   &>
115
116   <& /elements/tr-select-cust_class.html,
117        'label'        => emt('Customer class'),
118        'field'        => 'cust_classnum',
119        'multiple'     => 1,
120        'pre_options'  => [ '' => emt('(none)') ],
121        'all_selected' => 1,
122   &>
123
124 </TABLE>
125
126 % if ( $table eq 'cust_pay' ) { 
127
128   <BR>
129   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
130
131   <TR>
132     <TH CLASS="background" COLSPAN=2 ALIGN="left">
133       <FONT SIZE="+1"><% mt('Display options') |h %></FONT>
134     </TH>
135   </TR>
136
137   <& /elements/tr-checkbox.html,
138                 'label' => emt('Include tax names'),
139                 'field' => 'tax_names',
140                 'value' => 1,
141   &>
142
143 </TABLE>
144
145 % }
146
147 <BR>
148 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
149
150 </FORM>
151
152 <& /elements/footer.html &>
153 <%init>
154
155 my %opt = @_;
156 my $table = 'cust_'.$opt{'thing'};
157 my $name_singular = $opt{'name_singular'};
158
159 die "access denied"
160   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
161
162 my $conf = new FS::Conf;
163
164 my $void = $cgi->param('void') ? 1 : 0;
165 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
166
167 my $title = $void ? "Voided $name_singular report" :
168             $unapplied ? "Unapplied $name_singular report" :
169             "\u$name_singular report" ;
170 $table .= '_void' if $void;
171
172 </%init>