X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=fa392bbb7af0e838430eff43c2b99ec93cd79107;hp=fcd8f017c645343d03cdfd8c6f11db195f2e5802;hb=a4d4d3df88b33a6db30b565921f6d62efb252351;hpb=6615733676adb431ae48c78ce24758fe571614c1 diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index fcd8f017c..fa392bbb7 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -1,123 +1,7 @@ -%if ( $payby_default eq 'HIDE' ) { -% $cust_main->payby('BILL') unless $cust_main->payby; -% my $payby = $cust_main->payby; - - - - - -% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate billday )) { - - - -% } - -% #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!* !; -
<% mt('Billing information') |h %> - <% &ntable("#cccccc") %> - - - <%$r%><% mt('Billing type') |h %> - - <& /elements/init_overlib.html &> - -% my $payby = $cust_main->payby; -% my $paytype = $cust_main->paytype; -% my( $account, $aba ) = split('@', $payinfo); -% my $branch = ''; -% ($branch,$aba) = split('\.',$aba) -% if $conf->config('echeck-country') eq 'CA'; -% -% 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 $disable_payauto = $conf->exists('disable_payauto_default'); -% my $CARD_payauto_checked = $payby eq 'DCRD' ? '' -% : $payby eq 'CARD' ? 'CHECKED' -% : $disable_payauto ? '' : 'CHECKED'; -% my $CHEK_payauto_checked = $payby eq 'DCHK' ? '' -% : $payby eq 'CHEK' ? 'CHECKED' -% : $disable_payauto ? '' : 'CHECKED'; -% -% sub billday_options { -% my $curr_value = shift; -% my $ret = ''; -% for my $billday ( 1 .. 28 ) { -% my $sel = ''; -% $sel = "SELECTED='SELECTED'" if $curr_value == $billday; -% $ret .= ""; -% } -% $ret; -% } -% -% my $card_billday_style = $payby eq 'CARD' ? '' : 'style="color: #999999"'; -% my $chek_billday_style = $payby eq 'CHEK' ? '' : 'style="color: #999999"'; -% my $card_billday_select_disabled = $payby eq 'CARD' ? '' : 'DISABLED'; -% my $chek_billday_select_disabled = $payby eq 'CHEK' ? '' : 'DISABLED'; -% -% #false laziness w/view/cust_main/billing.html and misc/payment.cgi -% my $routing_label = $conf->config('echeck-country') eq 'US' -% ? 'ABA/Routing number' -% : 'Routing number'; -% my $routing_size = $conf->config('echeck-country') eq 'CA' ? 4 : 10; -% my $routing_maxlength = $conf->config('echeck-country') eq 'CA' ? 3 : 9; -% -% -% my %payby = ( -% -% 'CARD' => -% -% ''. -% -% qq!!. -% qq!!. -% -% qq!!. -% ''. -% -% qq!!. -% '!. -% '!. -% -% qq!!. -% qq!!. -% -% qq!'. -% -% ( $conf->exists('cust_main-select-billday') ? -% qq!! -% : '' -% ). -% -% '
${r}!.emt('Card number').qq!
${r}!.emt('Expiration').qq! '. -% -% include('/elements/select-month_year.html', -% 'prefix' => 'CARD_exp', -% 'selected_date' => -% ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ), -% ). -% -% '
!.emt('CVV2').qq! !. -% -% qq!(!.emt('help').qq!)!. -% qq!'. -% -% qq!
!.emt('Start date').qq! '. -% -% include('/elements/select-month_year.html', -% 'prefix' => 'CARD_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!!.emt('or Issue number').qq! !. -% '
${r}!.emt('Exact name on card').qq!
!. -% qq! !. -% emt('Charge future payments to this [_1] automatically','credit card').'
-% Charge on this day of each month   -%
', -% -% 'CHEK' => -% -% ''. -% -% qq!!. -% qq!'. -% qq!!. -% -% qq!!. -% qq!!. -% -% qq!!. -% qq!!. -% -% ( $conf->config('echeck-country') eq 'CA' ? -% qq!! : '' ). -% -% qq!!. -% qq!!. -% ( $conf->exists('show_bankstate') ? -% qq!!. -% qq!" -% : '' -% ). -% -% -% qq!'. -% -% ( $conf->exists('cust_main-select-billday') ? -% qq!! -% : '' -% ). -% -% '
${r}!.emt('Account number').qq! !.emt('Type').qq!
${r}!.emt($routing_label).qq! !. -% qq!(!.emt('help').qq!)!. -% qq!
$r !.emt('Branch number').qq! -%
${r}!.emt('Bank name').qq!
$paystate_label!. -% include('/elements/select-state.html', -% 'empty' => emt('(choose)'), -% 'state' => $cust_main->paystate, -% 'country' => $cust_main->country, -% 'prefix' => 'CHEK_pay', -% ). "
!. -% qq! !. -% emt('Charge future payments to this [_1] automatically','electronic check').'
-% Charge on this day of each month   -%
', -% -% 'LECB' => -% -% ''. -% -% qq!!. -% qq!!. -% -% qq!!. -% qq!!. -% qq!!. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
${r}!.emt('Phone number').qq!
 
 
 
 
 
 
', -% -% 'BILL' => -% -% ''. -% -% qq!!. -% qq!!. -% -% qq!!. -% qq!!. -% -% qq!!. -% qq!!. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
!.emt('P.O.').qq!
!.emt('Attention').qq!
 
 
 
 
 
', -% -% 'COMP' => -% -% ''. -% -% qq!!. -% qq!!. -% -% qq!!. -% ''. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
${r}!.emt('Approved by').qq!
${r}!.emt('Expiration').qq! '. -% -% include('/elements/select-month_year.html', -% 'prefix' => 'COMP_exp', -% 'selected_date' => -% ( $payby eq 'COMP' ? $cust_main->paydate : '' ), -% ). -% -% '
 
 
 
 
 
', -% -% 'CASH' => -% -% ''. -% -% qq!!. -% qq!!. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
${r}!.emt('Amount').qq!
 
 
 
 
 
 
', -% -% 'WEST' => -% -% ''. -% -% qq!!. -% qq!!. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
${r}!.emt('Amount').qq!
 
 
 
 
 
 
', -% -% 'MCRD' => -% -% ''. -% -% qq!!. -% qq!!. -% -% ''. -% ''. -% ''. -% ''. -% ''. -% ''. -% -% '
${r}!.emt('Amount').qq!
 
 
 
 
 
 
', -% -% ); -% -% #this should use FS::payby -% my @allopt = qw( CARD CHEK LECB BILL CASH WEST MCRD COMP ); -% -% my %allopt = map { $_ => FS::payby->shortname($_) } @allopt; -% -% if ( $cust_main->custnum ) { -% #don't offer CASH/WEST/MCRD initial payment types when editing customer -% delete $allopt{$_} for qw(CASH WEST MCRD); -% } -% -% my @options = grep exists( $allopt{$_} ), @payby; -% -% my %payby2option = ( -% ( map { $_ => $_ } @options ), -% 'DCRD' => 'CARD', -% 'DCHK' => 'CHEK', -% ); - - - <& /elements/selectlayers.html, - 'field' => 'payby', - 'curr_value' => $payby2option{$payby || $payby_default || $payby[0] }, - 'options' => \@options, - 'labels' => \%allopt, - 'html_between' => '', - 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, - 'onchange' => 'init_payauto_changed();', - &> +
<% mt('Billing information') |h %> <% &ntable("#cccccc") %> -   - % my $curuser = $FS::CurrentUser::CurrentUser; % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups'); % if ( $conf->exists('cust_class-tax_exempt') @@ -490,18 +63,6 @@ - - > <% mt('Fax invoices') |h %> - - - - % } @@ -544,6 +105,26 @@ % } + <% mt('Charge card/e-check on this day of the month') |h %> + + + + + +% sub billday_options { +% my $curr_value = shift; +% my $ret = ''; +% for my $billday ( 1 .. 28 ) { +% my $sel = ''; +% $sel = "SELECTED='SELECTED'" if $curr_value == $billday; +% $ret .= ""; +% } +% $ret; +% } + + <% mt('Invoice terms') |h %> <& /elements/select-terms.html, @@ -673,27 +254,17 @@ function toggle(obj) { % } +
- <% $r %><% mt('required fields') |h %> -% } - - - -<%once> - -my $paystate_label = FS::Msgcat::_gettext('paystate'); -$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/; + <% mt('Payment information') |h %> + <& cust_payby.html, 'cust_main'=>$cust_main, &> - <%init> my( $cust_main, %options ) = @_; my @invoicing_list = @{ $options{'invoicing_list'} }; my $payinfo = $options{'payinfo'}; my $conf = new FS::Conf; -my $payby_default = $conf->config('payby-default'); my $money_char = $conf->config('money_char') || '$';