} );
foreach (qw( address1 address2 city state zip country latitude longitude
- payby payinfo paydate payname paycode ))
+ payby payinfo paydate payname paycode paytype ))
{
$options{$_} = '' unless exists($options{$_});
}
'exp' => $options{paydate} || $self->paydate,
'payname' => $options{payname} || $self->payname,
'amount' => $amount, # consolidating
- 'paycode' => $options{paycode} || $cust_payby->paycode,
+ 'paycode' => $options{paycode} || '',
} );
$cust_pay_batch->paybatchnum($old_cust_pay_batch->paybatchnum)
<BR>Refund
+
<% ntable("#cccccc", 2) %>
<TR>
% }
% elsif ($payby eq 'CHEK') {
%
+<SCRIPT TYPE="text/javascript">
+ function cust_payby_changed (what) {
+ var custpaybynum = what.options[what.selectedIndex].value
+ if ( custpaybynum == '' || custpaybynum == '0' ) {
+ //what.form.payinfo.disabled = false;
+ $('#cust_payby').slideDown();
+ } else {
+ //what.form.payinfo.value = '';
+ //what.form.payinfo.disabled = true;
+ $('#cust_payby').slideUp();
+ }
+ }
+</SCRIPT>
% my @cust_payby = ();
% if ( $payby eq 'CARD' ) {
% @cust_payby = $cust_main->cust_payby('CARD','DCRD');
'onchange' => 'cust_payby_changed(this)',
&>
<INPUT TYPE="hidden" NAME="batch" VALUE="1">
+ </TABLE>
+<P>
+<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>
+
% } else {
<INPUT TYPE="hidden" NAME="payinfo" VALUE="">
+ </TABLE>
% }
+<P>
+<TABLE class="fsinnerbox">
<& /elements/tr-select-reason.html,
'field' => 'reasonnum',
'reason_class' => 'F',
$paycvv = $cust_payby->paycvv; # pass it if we got it, running a transaction will clear it
( $month, $year ) = $cust_payby->paydate_mon_year;
$payname = $cust_payby->payname;
+ $cgi->param(-name=>"paytype", -value=>$cust_payby->paytype) unless $cgi->param("paytype");
} else {
my $refund = "$1$2";
$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
my $paynum = $1;
- my $paydate = $cgi->param('exp_year'). '-'. $cgi->param('exp_month'). '-01';
- $options{'paydate'} = $paydate if $paydate =~ /^\d{2,4}-\d{1,2}-01$/;
+ my $paydate;
+ if ($cust_payby->paydate) { $paydate = "$year-$month-01"; }
+ else { $paydate = "2037-12-01"; }
if ( $cgi->param('batch') ) {
'payby' => $payby,
'amount' => $refund,
'payinfo' => $payinfo,
- 'paydate' => "$year-$month-01",
+ 'paydate' => $paydate,
'payname' => $payname,
'paycode' => 'C',
map { $_ => scalar($cgi->param($_)) }