select quick payment entry batch in payment report, RT#26343
[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 % if ( $table eq 'cust_pay' ) {
93
94 % # payment batch
95 % #  <& /elements/tr-select-batchnum.html &>
96
97 % #payment "entry" batch (should probably just all become the same thing)
98   <& /elements/tr-select-paybatch.html &>
99
100 % }
101
102   <& /elements/tr-input-lessthan_greaterthan.html,
103                 'label' => emt('Amount'),
104                 'field' => 'paid',
105   &>
106
107
108 </TABLE>
109 <BR>
110
111
112 <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
113
114   <TR>
115     <TH CLASS="background" COLSPAN=2 ALIGN="left">
116       <FONT SIZE="+1"><% mt('Customer search options') |h %></FONT>
117     </TH>
118   </TR>
119
120   <& /elements/tr-select-agent.html,
121                  'curr_value'    => scalar($cgi->param('agentnum')),
122                  'label'         => emt('Agent'),
123                  'disable_empty' => 0,
124   &>
125
126   <& /elements/tr-select-cust_class.html,
127        'label'        => emt('Customer class'),
128        'field'        => 'cust_classnum',
129        'multiple'     => 1,
130        'pre_options'  => [ '' => emt('(none)') ],
131        'all_selected' => 1,
132   &>
133
134 </TABLE>
135
136 % if ( $table eq 'cust_pay' ) { 
137
138   <BR>
139   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
140
141   <TR>
142     <TH CLASS="background" COLSPAN=2 ALIGN="left">
143       <FONT SIZE="+1"><% mt('Display options') |h %></FONT>
144     </TH>
145   </TR>
146
147   <& /elements/tr-checkbox.html,
148                 'label' => emt('Include tax names'),
149                 'field' => 'tax_names',
150                 'value' => 1,
151   &>
152
153 </TABLE>
154
155 % }
156
157 <BR>
158 <INPUT TYPE="submit" VALUE="<% mt('Get Report') |h %>">
159
160 </FORM>
161
162 <& /elements/footer.html &>
163 <%init>
164
165 my %opt = @_;
166 my $table = 'cust_'.$opt{'thing'};
167 my $name_singular = $opt{'name_singular'};
168
169 die "access denied"
170   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
171
172 my $conf = new FS::Conf;
173
174 my $void = $cgi->param('void') ? 1 : 0;
175 my $unapplied = $cgi->param('unapplied') ? 1 : 0;
176
177 my $title = $void ? "Voided $name_singular report" :
178             $unapplied ? "Unapplied $name_singular report" :
179             "\u$name_singular report" ;
180 $table .= '_void' if $void;
181
182 </%init>