1 <% include('/elements/header-popup.html', 'Enter Credit') %>
3 <% include('/elements/error.html') %>
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 %>">
13 <% ntable("#cccccc", 2) %>
16 <TD ALIGN="right">Date</TD>
17 <TD BGCOLOR="#ffffff"><% time2str($date_format, $_date) %></TD>
21 <TD ALIGN="right">Amount</TD>
22 <TD BGCOLOR="#ffffff">$<INPUT TYPE="text" NAME="amount" VALUE="<% $amount |h %>" SIZE=8 MAXLENGTH=8></TD>
26 %#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
29 <% include( '/elements/tr-select-reason.html',
30 'field' => 'reasonnum',
31 'reason_class' => 'R',
32 'control_button' => "document.getElementById('confirm_credit_button')",
38 <TD ALIGN="right">Additional info</TD>
40 <INPUT TYPE="text" NAME="addlinfo" VALUE="<% $cgi->param('addlinfo') |h %>">
44 <TD ALIGN="right">Auto-apply<BR>to invoices</TD>
45 <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>
48 % if ( $conf->exists('pkg-balances') ) {
49 <% include('/elements/tr-select-cust_pkg-balances.html',
50 'custnum' => $custnum,
55 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
62 <CENTER><INPUT TYPE="submit" ID="confirm_credit_button" VALUE="Enter credit" DISABLED></CENTER>
69 my $conf = new FS::Conf;
70 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
73 unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
75 my $custnum = $cgi->param('custnum');
76 my $amount = $cgi->param('amount');
78 my $otaker = getotaker;