X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=78a2002a4bc38b862bf9d413476a14ee9121a99a;hp=790f41f001aa20f995076a8025088308f31d9b9e;hb=3ce7691203a7737406bf2d4442f7fd84b81f847e;hpb=15e561850b61b10a92a46d8f3e316d53d4970087 diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 790f41f00..78a2002a4 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -1,70 +1,71 @@ -<% - -my( $cust_main, %options ) = @_; -my @invoicing_list = @{ $options{'invoicing_list'} }; -my $conf = new FS::Conf; -my $payby_default = $conf->config('payby-default'); - -my @payby = grep /\w/, $conf->config('payby'); -#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) - unless @payby; - -if ( $payby_default eq 'HIDE' ) { - - $cust_main->payby('BILL') unless $cust_main->payby; - -%> - - +% +% +%my( $cust_main, %options ) = @_; +%my @invoicing_list = @{ $options{'invoicing_list'} }; +%my $conf = new FS::Conf; +%my $payby_default = $conf->config('payby-default'); +% +%my @payby = grep /\w/, $conf->config('payby'); +%#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +%@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) +% unless @payby; +% +%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 )) { %> + +% # 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"; +% } +% - <% - #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 $r = qq!* !; +% +% -<% } else { - - my $r = qq!* !; - -%>
Billing information - <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %> - <%=$r%>Billing type + <%$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 : '' ), - ). - - '
 
 
 
 
 
', - - 'CASH' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'WEST' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - 'MCRD' => - - ''. - - qq!!. - qq!!. - - ''. - ''. - ''. - ''. - ''. - ''. - - '
${r}Amount
 
 
 
 
 
 
', - - ); - - #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' => '', - 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, - 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, - ); - - %> - - <%= $widget->html %> +% +% +% 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 : '' ), +% ). +% +% '
 
 
 
 
 
', +% +% 'CASH' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'WEST' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% 'MCRD' => +% +% ''. +% +% qq!!. +% qq!!. +% +% ''. +% ''. +% ''. +% ''. +% ''. +% ''. +% +% '
${r}Amount
 
 
 
 
 
 
', +% +% ); +% +% #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' => '', +% 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, +% 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, +% ); +% +% + + + <% $widget->html %>
- <%= &ntable("#cccccc") %> + <% &ntable("#cccccc") %>   - tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt + tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt - exists('disablepostalinvoicedefault') @@ -417,7 +418,7 @@ if ( $payby_default eq 'HIDE' ) { - Email invoice - + +% if ( $conf->exists('voip-cust_cdr_spools') ) { - <% if ( $conf->exists('voip-cust_cdr_spools') ) { %> - spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs + spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs - <% } else { %> - - <% } %> +% } else { + + +% } +
- <%= $r %> required fields + <% $r %> required fields +% } -<% } %>