add "Tokenized" card type to searches, RT#22953
[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('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-agent.html,
65                  'curr_value'    => scalar($cgi->param('agentnum')),
66                  'label'         => emt('for agent: '),
67                  'disable_empty' => 0,
68   &>
69
70   <& /elements/tr-select-user.html &>
71
72   <TR>
73     <TD ALIGN="right" VALIGN="center"><% mt('Payment') |h %></TD>
74     <TD>
75       <TABLE>
76         <& /elements/tr-input-beginning_ending.html,
77                       layout     => 'horiz',
78                       input_time => $conf->exists('report-cust_pay-select_time'),
79         &>
80       </TABLE>
81     </TD>
82   </TR>
83
84 % if ( $void ) {
85     <TR>
86       <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
87       <TD>
88         <TABLE>
89           <& /elements/tr-input-beginning_ending.html,
90                         prefix => 'void',
91                         layout => 'horiz',
92           &>
93         </TABLE>
94       </TD>
95     </TR>
96 % }
97
98   <& /elements/tr-input-lessthan_greaterthan.html,
99                 'label' => emt('Amount'),
100                 'field' => 'paid',
101   &>
102
103 % if ( $table eq 'cust_pay' ) { 
104   <& /elements/tr-checkbox.html,
105                 'label' => emt('Include tax names'),
106                 'field' => 'tax_names',
107                 'value' => 1,
108   &>
109 % }
110
111 </TABLE>
112
113 <BR>
114 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
115
116 </FORM>
117
118 <& /elements/footer.html &>
119 <%init>
120
121 my %opt = @_;
122 my $table = 'cust_'.$opt{'thing'};
123 my $name_singular = $opt{'name_singular'};
124
125 die "access denied"
126   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
127
128 my $conf = new FS::Conf;
129
130 my $void = $cgi->param('void') ? 1 : 0;
131 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
132
133 my $title = $void ? "Voided $name_singular report" :
134             $unapplied ? "Unapplied $name_singular report" :
135             "\u$name_singular report" ;
136 $table .= '_void' if $void;
137
138 </%init>