add (unfinished) credit card surcharge, part 1
[freeside.git] / httemplate / edit / cust_credit.cgi
1 <% include('/elements/header-popup.html', 'Enter Credit') %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM NAME="credit_popup" ACTION="<% $p1 %>process/cust_credit.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="crednum" VALUE="">
7 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum |h %>">
8 <INPUT TYPE="hidden" NAME="paybatch" VALUE="">
9 <INPUT TYPE="hidden" NAME="_date" VALUE="<% $_date %>">
10 <INPUT TYPE="hidden" NAME="credited" VALUE="">
11 <INPUT TYPE="hidden" NAME="otaker" VALUE="<% $otaker %>">
12
13 <% ntable("#cccccc", 2) %>
14
15   <TR>
16     <TD ALIGN="right">Date</TD>
17     <TD BGCOLOR="#ffffff"><% time2str($date_format, $_date) %></TD>
18   </TR>
19
20   <TR>
21     <TD ALIGN="right">Amount</TD>
22     <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="amount" VALUE="<% $amount |h %>" SIZE=8 MAXLENGTH=8></TD>
23   </TR>
24
25 %
26 %#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
27 %
28
29 <% include( '/elements/tr-select-reason.html',
30               'field'          => 'reasonnum',
31               'reason_class'   => 'R',
32               'control_button' => "document.getElementById('confirm_credit_button')",
33               'cgi'            => $cgi,
34            )
35 %>
36
37   <TR>
38     <TD ALIGN="right">Additional info</TD>
39     <TD>
40       <INPUT TYPE="text" NAME="addlinfo" VALUE="<% $cgi->param('addlinfo') |h %>">
41     </TD>
42
43   <TR>
44     <TD ALIGN="right">Auto-apply<BR>to invoices</TD>
45     <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>
46   </TR>
47
48 % if ( $conf->exists('pkg-balances') ) {
49   <% include('/elements/tr-select-cust_pkg-balances.html',
50                'custnum' => $custnum,
51                'cgi'     => $cgi
52             )
53   %>
54 % } else {
55   <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
56 % }
57
58 </TABLE>
59
60 <BR>
61
62 <CENTER><INPUT TYPE="submit" ID="confirm_credit_button" VALUE="Enter credit" DISABLED></CENTER>
63
64 </FORM>
65 </BODY>
66 </HTML>
67 <%init>
68
69 my $conf = new FS::Conf;
70 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
71
72 die "access denied"
73   unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
74
75 my $custnum = $cgi->param('custnum');
76 my $amount  = $cgi->param('amount');
77 my $_date   = time;
78 my $otaker  = getotaker;
79 my $p1      = popurl(1);
80
81 </%init>