stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / edit / cust_credit.cgi
1 <& /elements/header-popup.html, mt('Enter Credit') &>
2
3 <& /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="credited" VALUE="">
10
11 <% ntable("#cccccc", 2) %>
12
13 % my %date_args = (
14 %   'name'   =>  '_date',
15 %   'label'  => emt('Date'),
16 %   'value'  => $_date,
17 %   'format' => $date_format. ' %r',
18 % );
19 % if ( $FS::CurrentUser::CurrentUser->access_right('Backdate credit') ) {
20
21   <& /elements/tr-input-date-field.html, \%date_args &>
22
23 % } else {
24
25   <& /elements/tr-fixed-date.html, \%date_args &>
26
27 % }
28
29   <TR>
30     <TD ALIGN="right"><% mt('Amount') |h %></TD>
31     <TD BGCOLOR="#ffffff"><% $money_char |h %><INPUT TYPE="text" NAME="amount" VALUE="<% $amount |h %>" SIZE=8 MAXLENGTH=9></TD>
32   </TR>
33
34 <& /elements/tr-select-reason.html,
35               'field'          => 'reasonnum',
36               'reason_class'   => 'R',
37               'control_button' => 'confirm_credit_button',
38               'cgi'            => $cgi,
39 &>
40
41   <TR>
42     <TD ALIGN="right"><% mt('Additional info') |h %></TD>
43     <TD>
44       <INPUT TYPE="text" NAME="addlinfo" VALUE="<% $cgi->param('addlinfo') |h %>">
45     </TD>
46   </TR>
47
48 % if ( $conf->exists('credits-auto-apply-disable') ) {
49         <INPUT TYPE="HIDDEN" NAME="apply" VALUE="no">
50 % } else {
51   <TR>
52     <TD ALIGN="right"><% mt('Auto-apply to invoices') |h %></TD>
53     <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED><% mt('yes') |h %><OPTION><% mt('no') |h %></SELECT></TD>
54   </TR>
55 % }
56
57 % if ( $conf->exists('pkg-balances') ) {
58   <& /elements/tr-select-cust_pkg-balances.html,
59                'custnum' => $custnum,
60                'cgi'     => $cgi
61   &>
62 % } else {
63   <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
64 % }
65
66 </TABLE>
67
68 <BR>
69
70 <CENTER><INPUT TYPE="submit" ID="confirm_credit_button" VALUE="<% mt('Enter credit') |h %>" DISABLED></CENTER>
71
72 </FORM>
73 </BODY>
74 </HTML>
75 <%init>
76
77 my $conf = new FS::Conf;
78
79 my $money_char  = $conf->config('money_char')  || '$';
80 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
81
82 die "access denied"
83   unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
84
85 my $custnum = $cgi->param('custnum');
86 my $amount  = $cgi->param('amount');
87 my $_date   = time;
88 my $p1      = popurl(1);
89
90 </%init>