+% die "unknown payby $payby";
+% }
+%
+% my $custpaybynum = length(scalar($cgi->param('custpaybynum')))
+% ? scalar($cgi->param('custpaybynum'))
+% : scalar(@cust_payby) && $cust_payby[0]->custpaybynum;
+
+% if ( !$cust_payby ) {
+ <& /elements/tr-select-cust_payby.html,
+ 'cust_payby' => \@cust_payby,
+ 'curr_value' => $custpaybynum,
+ 'onchange' => 'cust_payby_changed(this)',
+ &>
+% }
+
+% if ($payby eq "CARD" || $payby eq "DCRD") {
+ <INPUT TYPE="hidden" NAME="batch" VALUE="">
+% }
+% elsif ( $conf->exists("batch-enable")
+% || grep $payby eq $_, $conf->config('batch-enable_payby')
+% ) {
+% if ( grep $payby eq $_, $conf->config('realtime-disable_payby') ) {
+ <INPUT TYPE="hidden" NAME="batch" VALUE="1">
+% } else {
+ <TR>
+ <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="batch" VALUE="1" ID="batch" <% ($batchnum || $batch) ? 'checked' : '' %> ></TD>
+ <TH ALIGN="left"> <% mt('Add to current batch') |h %></TH>
+ </TR>
+% }
+% }
+
+ </TABLE>
+<P>
+
+% if ( !$cust_payby ) {
+<DIV ID="cust_payby"
+ <% $custpaybynum ? 'STYLE="display:none"'
+ : ''
+ %>
+>
+<TABLE class="fsinnerbox">
+
+ <& /elements/cust_payby_new.html,
+ 'cust_payby' => \@cust_payby,
+ 'curr_value' => $custpaybynum,
+ &>
+
+</TABLE>
+</DIV>
+% } # end if cust_payby
+
+% } else {