- var achwindow = -1;
- function achopen(filename,windowname,properties) {
- achclose();
- achwindow = window.open(filename,windowname,properties);
- }
- function achclose() {
- if ( achwindow != -1 )
- achwindow.close();
- achwindow = -1;
- }
-
- function card_changed(what) {
- if (
- what.form.payinfo.value.substring(0, 4) == '4093'
- || what.form.payinfo.value.substring(0, 4) == '4911'
- || what.form.payinfo.value.substring(0, 4) == '4936'
- || what.form.payinfo.value.substring(0, 6) == '564132'
- || what.form.payinfo.value.substring(0, 2) == '63'
- || what.form.payinfo.value.substring(0, 2) == '67'
- )
- {
- what.form.paystart_month.disabled = false;
- what.form.paystart_year.disabled = false;
- what.form.payissue.disabled = false;
- what.form.paystart_month.style.backgroundColor = '#ffffff';
- what.form.paystart_year.style.backgroundColor = '#ffffff';
- what.form.payissue.style.backgroundColor = '#ffffff';
- document.getElementById('paystart_label').style.color = '#000000';
- document.getElementById('payissue_label').style.color = '#000000';
- } else {
- what.form.paystart_month.disabled = true;
- what.form.paystart_year.disabled = true;
- what.form.payissue.disabled = true;
- what.form.paystart_month.style.backgroundColor = '#dddddd';
- what.form.paystart_year.style.backgroundColor = '#dddddd';
- what.form.payissue.style.backgroundColor = '#dddddd';
- document.getElementById('paystart_label').style.color = '#999999';
- document.getElementById('payissue_label').style.color = '#999999';
- }
- return true;
- }
-
- </SCRIPT>
-
- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
- <SCRIPT TYPE="text/javascript">
- function OLiframeContent(src, width, height, name) {
- return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
- +(name?' name="'+name+'" id="'+name+'"':'')+' scrolling="auto">'
- +'<div>[iframe not supported]</div></iframe>');
- }
- </SCRIPT>
-
-% my $payby = $cust_main->payby;
-% my $paytype = $cust_main->paytype;
-% my( $account, $aba ) = split('@', $payinfo);
-%
-% my $disabled = 'DISABLED style="background-color: #dddddd"';
-% my $text_disabled = 'style="color: #999999"';
-%
-% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) {
-% $disabled = 'style="background-color: #ffffff"';
-% $text_disabled = 'style="color: #000000";'
-% }
-%
-% my %payby = (
-%
-% 'CARD' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Card number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $payinfo : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'exp',
-% 'selected_date' =>
-% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ),
-% ).
-%
-% '</TD></TR>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">CVV2 !.
-%
-% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
-% qq!</TD>!.
-% '<TD WIDTH="408"><INPUT TYPE="text" NAME="paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ && !$cust_main->is_encrypted($cust_main->paycvv) ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'.
-%
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200"><SPAN ID="paystart_label" $text_disabled>Start date </SPAN></TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'paystart',
-% 'disabled' => $disabled,
-% 'empty_option' => 1,
-% 'start_year' => 2000,
-% 'end_year' => (localtime())[5] + 1900,
-% 'selected_date' => (
-% ( $payby =~ /^(CARD|DCRD)$/
-% && cardtype($payinfo) =~ /^(Switch|Solo)$/ )
-% ? $cust_main->paystart_month. '-'.
-% $cust_main->paystart_year
-% : ''
-% )
-% ).
-%
-% qq!<SPAN ID="payissue_label" $text_disabled> or Issue number </SPAN>!.
-% '<INPUT TYPE="text" NAME="payissue" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payissue : '' ). qq!" SIZE=3 MAXLENGTH=2 $disabled></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Exact name on card </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-%
-% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCRD' ? '' : 'CHECKED' ). '> Charge future payments to this card automatically</TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'CHEK' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Account number </TD>!.
-% qq!<TD><INPUT TYPE="text" SIZE=12 NAME="payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD>'.
-% qq!<TD ALIGN="right">Type</TD><TD><SELECT NAME="paytype">!.
-% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes).
-% qq!</SELECT></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}ABA/Routing number </TD>!.
-% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
-% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
-% qq!</TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Bank name </TD>!.
-% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-% ( $conf->exists('show_bankstate') ?
-% qq!<TR><TD ALIGN="right" WIDTH="200">$paystate_label</TD>!.
-% qq!<TD COLSPAN="3" WIDTH="408">!.
-% include('select-state.html',
-% 'empty' => '(choose)',
-% 'state' => $cust_main->paystate,
-% 'country' => $cust_main->country,
-% 'prefix' => 'pay',
-% ). "</TD></TR>"
-% : '<INPUT TYPE="hidden" NAME="paystate" VALUE="'.
-% $cust_main->paystate. '">'
-% ).
-%
-%
-% qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'LECB' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Phone number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->payinfo : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-% qq!<INPUT TYPE="hidden" NAME="payname" VALUE="">!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'BILL' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">P.O. </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payinfo : '' ). qq!"></TD></TR>!.
-%
-% qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">Attention </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payname : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'COMP' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Approved by </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE=""></TD></TR>!.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
-% '<TD WIDTH="408">'.
-%
-% include('/elements/select-month_year.html',
-% 'prefix' => 'exp',
-% 'selected_date' =>
-% ( $payby eq 'COMP' ? $cust_main->paydate : '' ),
-% ).
-%
-% '</TD></TR>'.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'CASH' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'CASH' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'WEST' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'WEST' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% 'MCRD' =>
-%
-% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
-%
-% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'MCRD' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
-%
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-% '<TR><TD> </TD></TR>'.
-%
-% '</TABLE>',
-%
-% );
-%
-% #this should use FS::payby
-% my %allopt = (
-% 'CARD' => 'Credit card',
-% 'CHEK' => 'Electronic check',
-% 'LECB' => 'Phone bill billing',
-% 'BILL' => 'Billing',
-% 'CASH' => 'Cash', # initial payment, then billing',
-% 'WEST' => 'Western Union', # initial payment, then billing',
-% 'MCRD' => 'Manual credit card', # initial payment, then billing',
-% 'COMP' => 'Complimentary',
-% );
-% if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types
-% # when editing customer
-% delete $allopt{$_} for qw(CASH WEST MCRD);
-% }
-%
-% tie my %options, 'Tie::IxHash',
-% map { $_ => $allopt{$_} }
-% grep { exists $allopt{$_} }
-% @payby;
-%
-% my %payby2option = (
-% ( map { $_ => $_ } keys %options ),
-% 'DCRD' => 'CARD',
-% 'DCHK' => 'CHEK',
-% );
-%
-% my $widget = new HTML::Widgets::SelectLayers(
-% 'options' => \%options,
-% #'form_name' => 'dummy',
-% #'form_action' => 'nothingyet',
-% #chops bottom of page in IE# 'under_position' => 'absolute',
-% 'html_between' => '</TD></TR></TABLE>',
-% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
-% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
-% );
-%
-%