move credit card transaction results out of paybatch and into real fields, #18548
[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" onChange="payby_changed(this)">
34         <OPTION VALUE=""><% mt('all') |h %></OPTION>
35         <OPTION VALUE="CARD"><% mt('credit card (all)') |h %></OPTION>
36         <OPTION VALUE="CARD-VisaMC"><% mt('credit card (Visa/MasterCard)') |h %></OPTION>
37         <OPTION VALUE="CARD-Amex"><% mt('credit card (American Express)') |h %></OPTION>
38         <OPTION VALUE="CARD-Discover"><% mt('credit card (Discover)') |h %></OPTION>
39         <OPTION VALUE="CARD-Maestro"><% mt('credit card (Maestro/Switch/Solo)') |h %></OPTION>
40         <OPTION VALUE="CHEK"><% mt('electronic check / ACH') |h %></OPTION>
41         <OPTION VALUE="BILL"><% mt('check') |h %></OPTION>
42         <OPTION VALUE="PREP"><% mt('prepaid card') |h %></OPTION>
43         <OPTION VALUE="CASH"><% mt('cash') |h %></OPTION>
44         <OPTION VALUE="WEST"><% mt('Western Union') |h %></OPTION>
45         <OPTION VALUE="MCRD"><% mt('manual credit card') |h %></OPTION>
46       </SELECT>
47     </TD>
48   </TR>
49
50   <SCRIPT TYPE="text/javascript">
51   
52     function payby_changed(what) {
53       if ( what.value == 'BILL' ) {
54         show('payinfo');
55         hide('ccpay');
56       } else if ( what.value.match(/^CARD/) ) {
57         hide('payinfo');
58         show('ccpay');
59       } else {
60         hide('payinfo');
61         hide('ccpay');
62       }
63     }
64
65     function show(what) {
66       document.getElementById(what+'_caption').style.color = '#000000';
67       document.getElementById(what).disabled = false;
68       document.getElementById(what).style.backgroundColor = '#ffffff';
69     }
70
71     function hide(what) {
72       document.getElementById(what+'_caption').style.color = '#bbbbbb';
73       document.getElementById(what).disabled = true;
74       document.getElementById(what).style.backgroundColor = '#dddddd';
75     }
76
77
78
79   </SCRIPT>
80
81   <TR>
82     <TD ALIGN="right"><FONT ID="payinfo_caption" COLOR="#bbbbbb"><% mt('Check #:') |h %> </FONT></TD>
83     <TD>
84       <INPUT TYPE="text" ID="payinfo" NAME="payinfo" DISABLED STYLE="background-color: #dddddd">
85     </TD>
86   </TR>
87   <TR>
88     <TD ALIGN="right">
89       <FONT ID="ccpay_caption" COLOR="#bbbbbb">
90         <% mt('Transaction #') |h %>
91       </FONT>
92     </TD>
93     <TD>
94       <INPUT TYPE="text" ID="ccpay" NAME="ccpay" DISABLED STYLE="background-color: #dddddd">
95     </TD>
96   </TR>
97
98   <& /elements/tr-select-agent.html,
99                  'curr_value'    => scalar($cgi->param('agentnum')),
100                  'label'         => emt('for agent: '),
101                  'disable_empty' => 0,
102   &>
103
104   <& /elements/tr-select-user.html &>
105
106   <TR>
107     <TD ALIGN="right" VALIGN="center"><% mt('Payment') |h %></TD>
108     <TD>
109       <TABLE>
110         <& /elements/tr-input-beginning_ending.html,
111                       layout   => 'horiz',
112         &>
113       </TABLE>
114     </TD>
115   </TR>
116
117 % if ( $void ) {
118     <TR>
119       <TD ALIGN="right" VALIGN="center"><% mt('Voided') |h %></TD>
120       <TD>
121         <TABLE>
122           <& /elements/tr-input-beginning_ending.html,
123                         prefix => 'void',
124                         layout => 'horiz',
125           &>
126         </TABLE>
127       </TD>
128     </TR>
129 % }
130
131   <& /elements/tr-input-lessthan_greaterthan.html,
132                 'label' => emt('Amount'),
133                 'field' => 'paid',
134   &>
135
136 % if ( $table eq 'cust_pay' ) { 
137   <& /elements/tr-checkbox.html,
138                 'label' => emt('Include tax names'),
139                 'field' => 'tax_names',
140                 'value' => 1,
141   &>
142 % }
143
144 </TABLE>
145
146 <BR>
147 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
148
149 </FORM>
150
151 <& /elements/footer.html &>
152 <%init>
153
154 my %opt = @_;
155 my $table = 'cust_'.$opt{'thing'};
156 my $name_singular = $opt{'name_singular'};
157
158 die "access denied"
159   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
160
161 my $void = $cgi->param('void') ? 1 : 0;
162 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
163
164 my $title = $void ? "Voided $name_singular report" :
165             $unapplied ? "Unapplied $name_singular report" :
166             "\u$name_singular report" ;
167 $table .= '_void' if $void;
168
169 </%init>