Merge branch 'rt_28256'
[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=16 MULTIPLE>
34
35 %#        <OPTION VALUE=""><% mt('all') |h %></OPTION>
36 %#        <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
37
38         <OPTION VALUE="CARD-VisaMC" SELECTED><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
39         <OPTION VALUE="CARD-Amex" SELECTED><% mt('credit card (American Express)') |h %></OPTION>
40         <OPTION VALUE="CARD-Discover" SELECTED><% mt('credit card (Discover)') |h %></OPTION>
41         <OPTION VALUE="CARD-Maestro" SELECTED><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
42         <OPTION VALUE="CARD-Tokenized" SELECTED><% mt('credit card (Tokenized)') |h %></OPTION>
43
44         <OPTION VALUE="CHEK" SELECTED><% mt('electronic check / ACH') |h %></OPTION>
45         <OPTION VALUE="BILL" SELECTED><% mt('check') |h %></OPTION>
46         <OPTION VALUE="CASH" SELECTED><% mt('cash') |h %></OPTION>
47         <OPTION VALUE="PPAL" SELECTED><% mt('Paypal') |h %></OPTION>
48         <OPTION VALUE="APPL" SELECTED><% mt('Apple Store') |h %></OPTION>
49         <OPTION VALUE="ANRD" SELECTED><% mt('Android Market') |h %></OPTION>
50
51         <OPTION VALUE="PREP" SELECTED><% mt('prepaid card') |h %></OPTION>
52         <OPTION VALUE="WIRE" SELECTED><% mt('wire transfer') |h %></OPTION>
53         <OPTION VALUE="WEST" SELECTED><% mt('Western Union') |h %></OPTION>
54         <OPTION VALUE="EDI" SELECTED><% mt('Electronic Debit (EDI)') |h %></OPTION>
55         <OPTION VALUE="MCRD" SELECTED><% mt('manual credit card') |h %></OPTION>
56         <OPTION VALUE="MCHK" SELECTED><% mt('manual electronic check') |h %></OPTION>
57       </SELECT>
58     </TD>
59   </TR>
60
61   <TR>
62     <TD ALIGN="right"><% mt('Check #:') |h %> </TD>
63     <TD>
64       <INPUT TYPE="text" ID="payinfo" NAME="payinfo">
65     </TD>
66   </TR>
67   <TR>
68     <TD ALIGN="right"><% mt('Transaction #:') |h %> </TD>
69     <TD>
70       <INPUT TYPE="text" ID="ccpay" NAME="ccpay">
71     </TD>
72   </TR>
73
74   <& /elements/tr-select-user.html &>
75
76   <TR>
77     <TD ALIGN="right" VALIGN="center"><% mt(ucfirst($name_singular). ' date') |h %></TD>
78     <TD>
79       <TABLE>
80         <& /elements/tr-input-beginning_ending.html,
81                       layout     => 'horiz',
82                       input_time => $conf->exists('report-cust_pay-select_time'),
83         &>
84       </TABLE>
85     </TD>
86   </TR>
87
88 % if ( $void ) {
89     <TR>
90       <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
91       <TD>
92         <TABLE>
93           <& /elements/tr-input-beginning_ending.html,
94                         prefix => 'void',
95                         layout => 'horiz',
96           &>
97         </TABLE>
98       </TD>
99     </TR>
100 % }
101
102 % if ( $table eq 'cust_pay' ) {
103
104 % # payment batch
105 % #  <& /elements/tr-select-batchnum.html &>
106
107 % #payment "entry" batch (should probably just all become the same thing)
108   <& /elements/tr-select-paybatch.html &>
109
110 % }
111
112   <& /elements/tr-input-lessthan_greaterthan.html,
113                 'label' => emt('Amount'),
114                 'field' => 'paid',
115   &>
116
117
118 </TABLE>
119 <BR>
120
121
122 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
123
124   <TR>
125     <TH CLASS="background" COLSPAN=2 ALIGN="left">
126       <FONT SIZE="+1"><% mt('Customer search options') |h %></FONT>
127     </TH>
128   </TR>
129
130   <& /elements/tr-select-agent.html,
131                  'curr_value'    => scalar($cgi->param('agentnum')),
132                  'label'         => emt('Agent'),
133                  'disable_empty' => 0,
134   &>
135
136   <& /elements/tr-select-cust_class.html,
137        'label'        => emt('Customer class'),
138        'field'        => 'cust_classnum',
139        'multiple'     => 1,
140        'pre_options'  => [ '' => emt('(none)') ],
141        'all_selected' => 1,
142   &>
143
144 </TABLE>
145
146 % if ( $table eq 'cust_pay' ) { 
147
148   <BR>
149   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
150
151   <TR>
152     <TH CLASS="background" COLSPAN=2 ALIGN="left">
153       <FONT SIZE="+1"><% mt('Display options') |h %></FONT>
154     </TH>
155   </TR>
156
157   <& /elements/tr-checkbox.html,
158                 'label' => emt('Include tax names'),
159                 'field' => 'tax_names',
160                 'value' => 1,
161   &>
162
163 </TABLE>
164
165 % }
166
167 <BR>
168 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
169
170 </FORM>
171
172 <& /elements/footer.html &>
173 <%init>
174
175 my %opt = @_;
176 my $table = 'cust_'.$opt{'thing'};
177 my $name_singular = $opt{'name_singular'};
178
179 die "access denied"
180   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
181
182 my $conf = new FS::Conf;
183
184 my $void = $cgi->param('void') ? 1 : 0;
185 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
186
187 my $title = $void ? "Voided $name_singular report" :
188             $unapplied ? "Unapplied $name_singular report" :
189             "\u$name_singular report" ;
190 $table .= '_void' if $void;
191
192 </%init>