<% my( $cust_main ) = @_; my $conf = new FS::Conf; my $payby_default = $conf->config('payby-default'); if ( $payby_default eq 'HIDE' ) { $cust_main->payby('BILL') unless $cust_main->payby; %>
<% # XXX key %> <% foreach my $field (qw( payinfo payname paycvv paystart_month paystart_year payissue payip )) { %> <% } %> <% #false laziness w/elements/select-month_year.html & view/cust_main/billing.html my( $mon, $year ); my $date = $cust_main->paydate || '12-2037'; if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format ( $mon, $year ) = ( $2, $1 ); } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) { ( $mon, $year ) = ( $1, $3 ); } else { die "unrecognized expiration date format: $date"; } %>
<% } else { my @invoicing_list = $cust_main->invoicing_list; my $r = qq!* !; %>
Billing information <%= &ntable("#cccccc") %> <%=$r%>Billing type <% my($payby, $payinfo, $payname)=( $cust_main->payby, $cust_main->payinfo, $cust_main->payname, ); 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' => ''. qq!!. qq!!. qq!!. ''. qq!!. '!. '!. qq!!. qq!!. qq!'. '
${r}Card number
${r}Expiration '. include('/elements/select-month_year.html', 'prefix' => 'exp', 'selected_date' => ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), ). '
CVV2 !. qq!(help)!. qq!'. qq!
Start date '. 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! or Issue number !. '
${r}Exact name on card
Charge future payments to this card automatically
', 'CHEK' => ''. qq!!. qq!'. qq!!. qq!!. qq!!. qq!!. qq!!. qq!!. qq!'. ''. ''. ''. '
${r}Account number
${r}ABA/Routing number !. qq!(help)!. qq!
${r}Bank name
Charge future payments to this electronic check automatically
 
 
 
', 'LECB' => ''. qq!!. qq!!. qq!!. qq!!. qq!!. ''. ''. ''. ''. ''. ''. '
${r}Phone number
 
 
 
 
 
 
', 'BILL' => ''. qq!!. qq!!. qq!!. qq!!. qq!!. qq!!. ''. ''. ''. ''. ''. '
P.O.
Attention
 
 
 
 
 
', 'COMP' => ''. qq!!. qq!!. qq!!. ''. ''. ''. ''. ''. ''. '
${r}Approved by
${r}Expiration '. include('/elements/select-month_year.html', 'prefix' => 'exp', 'selected_date' => ( $payby eq 'COMP' ? $cust_main->paydate : '' ), ). '
 
 
 
 
 
', ); tie my %options, 'Tie::IxHash', 'CARD' => 'Credit card', 'CHEK' => 'Electronic check', 'LECB' => 'Phone bill billing', 'BILL' => 'Billing', 'COMP' => 'Complimentary', ; 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' => '', 'selected_layer' => $payby2option{$payby} || 'CARD', 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, ); %> <%= $widget->html %>
<%= &ntable("#cccccc") %>   tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt exists('disablepostalinvoicedefault') ) || grep { $_ eq 'POST' } @invoicing_list ) ? 'CHECKED' : '' %>> Postal mail invoice > Fax invoice Email invoice
<%= $r %> required fields <% } %>