1 <& /elements/header-popup.html, mt('Enter Credit') &>
3 <& /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="credited" VALUE="">
10 <INPUT TYPE="hidden" NAME="otaker" VALUE="<% $otaker %>">
12 <% ntable("#cccccc", 2) %>
16 % 'label' => emt('Date'),
18 % 'format' => $date_format. ' %r',
20 % if ( $FS::CurrentUser::CurrentUser->access_right('Backdate credit') ) {
22 <& /elements/tr-input-date-field.html, \%date_args &>
26 <& /elements/tr-fixed-date.html, \%date_args &>
31 <TD ALIGN="right"><% mt('Amount') |h %></TD>
32 <TD BGCOLOR="#ffffff"><% $money_char |h %><INPUT TYPE="text" NAME="amount" VALUE="<% $amount |h %>" SIZE=8 MAXLENGTH=9></TD>
35 <& /elements/tr-select-reason.html,
36 'field' => 'reasonnum',
37 'reason_class' => 'R',
38 'control_button' => 'confirm_credit_button',
43 <TD ALIGN="right"><% mt('Additional info') |h %></TD>
45 <INPUT TYPE="text" NAME="addlinfo" VALUE="<% $cgi->param('addlinfo') |h %>">
49 % if ( $conf->exists('credits-auto-apply-disable') ) {
50 <INPUT TYPE="HIDDEN" NAME="apply" VALUE="no">
53 <TD ALIGN="right"><% mt('Auto-apply to invoices') |h %></TD>
54 <TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED><% mt('yes') |h %><OPTION><% mt('no') |h %></SELECT></TD>
58 % if ( $conf->exists('pkg-balances') ) {
59 <& /elements/tr-select-cust_pkg-balances.html,
60 'custnum' => $custnum,
64 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="">
71 <CENTER><INPUT TYPE="submit" ID="confirm_credit_button" VALUE="<% mt('Enter credit') |h %>" DISABLED></CENTER>
78 my $conf = new FS::Conf;
80 my $money_char = $conf->config('money_char') || '$';
81 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
84 unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
86 my $custnum = $cgi->param('custnum');
87 my $amount = $cgi->param('amount');
89 my $otaker = getotaker;