<& /elements/header-popup.html, mt('Enter Credit') &> <& /elements/error.html &>
<% ntable("#cccccc", 2) %> % my %date_args = ( % 'name' => '_date', % 'label' => emt('Date'), % 'value' => $_date, % 'format' => $date_format. ' %r', % ); % if ( $FS::CurrentUser::CurrentUser->access_right('Backdate credit') ) { <& /elements/tr-input-date-field.html, \%date_args &> % } else { <& /elements/tr-fixed-date.html, \%date_args &> % } <% mt('Amount') |h %> <% $money_char |h %> <& /elements/tr-select-reason.html, 'field' => 'reasonnum', 'reason_class' => 'R', 'control_button' => 'confirm_credit_button', 'cgi' => $cgi, &> <% mt('Additional info') |h %> % if ( $conf->exists('credits-auto-apply-disable') ) { % } else { <% mt('Auto-apply to invoices') |h %> % } % if ( $conf->exists('pkg-balances') ) { <& /elements/tr-select-cust_pkg-balances.html, 'custnum' => $custnum, 'cgi' => $cgi &> % } else { % }
<%init> my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; my $date_format = $conf->config('date_format') || '%m/%d/%Y'; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Post credit'); my $custnum = $cgi->param('custnum'); my $amount = $cgi->param('amount'); my $_date = time; my $p1 = popurl(1);