X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=135f636cd68f18dbc4fdc80b36a5d4e1fddc993d;hb=1f551554a6237be1e70573d04ee333f3ccc93c96;hp=d6995af05802e312684838e267c9b6c3fb56afba;hpb=23ceb08c948d848556555840ffde296caebd6df6;p=freeside.git diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index d6995af05..135f636cd 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -6,7 +6,7 @@ -% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate )) { +% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate billday )) { @@ -34,7 +34,7 @@ % % my $r = qq!* !; -
<% mt('Billing information') |h %> +
<% mt('Billing information') |h %> <% &ntable("#cccccc") %> @@ -103,11 +103,28 @@ } function payauto_changed(payauto_field){ - var f = (payauto_field.name == 'CARD_payauto') ? 'card_billday' : 'chek_billday'; - f = document.getElementById(f); - if ( f == null) return; - if(payauto_field.checked) f.style.display = ''; - else f.style.display = 'none'; + var select = (payauto_field.name == 'CARD_payauto') ? 'CARD_billday' : 'CHEK_billday'; + var span = document.getElementById('td_'+select); + select = document.getElementById(select); + if (span == null || select == null) return; + if(payauto_field.checked) { + span.style.color = '#000000'; + select.disabled = false; + } + else { + span.style.color = '#999999'; + select.disabled = true; + //why? select.selectedIndex = 0; + } + } + + function tax_changed(what) { + var num = document.getElementById(what.id + '_num'); + if ( what.checked ) { + num.disabled = false; + } else { + num.disabled = true; + } } @@ -117,6 +134,9 @@ % 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"'; @@ -145,8 +165,18 @@ % $ret; % } % -% my $card_billday_style = $payby eq 'CARD' ? '' : 'style="display: none"'; -% my $chek_billday_style = $payby eq 'CHEK' ? '' : 'style="display: none"'; +% 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 = ( % @@ -200,16 +230,17 @@ % % qq!!. % qq! !. -% emt('Charge future payments to this [_1] automatically','credit card'). +% emt('Charge future payments to this [_1] automatically','credit card').''. % % ( $conf->exists('cust_main-select-billday') ? -% qq!
-% Charge on this day of each month
! +% qq! +% Charge on this day of each month   +% ! % : '' % ). % -% '', +% '', % % 'CHEK' => % @@ -221,14 +252,18 @@ % join('', map { qq!" } @FS::cust_main::paytypes). % qq!!. % -% qq!${r}!.emt('ABA/Routing number').qq! !. -% qq! !. +% qq!${r}!.emt($routing_label).qq! !. +% qq! !. % qq!(!.emt('help').qq!)!. % qq!!. % % qq!!. % qq!!. % +% ( $conf->config('echeck-country') eq 'CA' ? +% qq!$r !.emt('Branch number').qq! +% ! : '' ). +% % qq!${r}!.emt('Bank name').qq! !. % qq!!. % ( $conf->exists('show_bankstate') ? @@ -247,16 +282,17 @@ % % qq!!. % qq! !. -% emt('Charge future payments to this [_1] automatically','electronic check'). +% emt('Charge future payments to this [_1] automatically','electronic check').''. % % ( $conf->exists('cust_main-select-billday') ? -% qq!
-% Charge on this day of each month
! +% qq! +% Charge on this day of each month   +% ! % : '' % ). % -% '', +% '', % % 'LECB' => % @@ -408,17 +444,35 @@   +% my $curuser = $FS::CurrentUser::CurrentUser; % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups'); +% if ( $conf->exists('cust_class-tax_exempt') +% || $conf->exists('tax-cust_exempt-groups-require_individual_nums') +% || $conf->config('tax-cust_exempt-groups-num_req') =~ /\w/ +% || ! $curuser->access_right('Edit customer tax exemptions') +% ) +% { - - tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %> - + + +% } else { -% foreach my $exempt_group ( @exempt_groups ) { -% #escape $exempt_group for NAME -   tax_exemption($exempt_group) ? 'CHECKED' : '' %>> Tax Exempt (<% $exempt_group %> taxes) + tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %> + +% } + +% if ( $curuser->access_right('Edit customer tax exemptions') ) { +% foreach my $exempt_group ( @exempt_groups ) { +% my $cust_main_exemption = $cust_main->tax_exemption($exempt_group); +% #escape $exempt_group for NAME etc. +% my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group")); + +    onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes) + - Exemption number exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>> + +% } % } % unless ( $conf->exists('emailinvoiceonly') ) { @@ -431,7 +485,7 @@ ? 'CHECKED' : '' - %>> <% mt('Postal mail invoice') |h %> + %>> <% mt('Postal mail invoices') |h %> @@ -443,28 +497,82 @@ ? 'CHECKED' : '' - %>> <% mt('Fax invoice') |h %> + %>> <% mt('Fax invoices') |h %> % } -% unless ( $conf->exists('cust-email-high-visibility')) { + invoice_noemail eq 'Y' ) + ? '' + : 'CHECKED' + + %>> <% mt('Email invoices') |h %> + + + + +% unless ( $conf->exists('cust-email-high-visibility')) { + - <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es) + <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) + ? $r : '' %>Email address(es) + + + message_noemail eq 'Y' ) + ? 'CHECKED' + : '' + %>> <% emt('Do not send notices') %> - % } +% if ( $conf->exists('cust_main-select-prorate_day') ) { + + <% mt('Prorate day (1-28)') |h %> + + + <& /elements/checkbox.html, + field => 'force_prorate_day', + value => 'Y', + curr_value => $cust_main->force_prorate_day + &> + + + +% } else { + +% } + <% mt('Invoice terms') |h %> - <& /elements/select-terms.html, - 'curr_value' => $cust_main->invoice_terms, - &> +% if ( $curuser->access_right('Edit customer invoice terms') ) { + <& /elements/select-terms.html, + 'curr_value' => $cust_main->invoice_terms, + 'agentnum' => $cust_main->agentnum, + &> +% } else { +% +% my $terms = +% $cust_main->invoice_terms +% || emt('Default').' ('. +% ( $conf->config('invoice_default_terms', $cust_main->agentnum) +% || emt('Payable upon receipt') +% ). +% ')'; + <% $terms |h %> + + <& /elements/hidden.html, + 'field' => 'invoice_terms', + 'curr_value' => $cust_main->invoice_terms, + &> +% } @@ -476,8 +584,23 @@ function toggle(obj) { obj.form.credit_limit.disabled = obj.checked; } - credit_limit) %><% length($cust_main->credit_limit) ? '' : ' DISABLED' %>> - credit_limit) ? '' : ' CHECKED'%>> <% mt('Unlimited') |h %> + credit_limit) ? '' : ' DISABLED' %> + > +% my $default_credit_limit = $conf->config('default_credit_limit'); + credit_limit) ? '' : ' CHECKED'%> + > <% $default_credit_limit + ? "Default ($money_char". sprintf("%.2f", $default_credit_limit). + ")" + : mt('Unlimited') + |h + %> @@ -491,15 +614,15 @@ function toggle(obj) { % if ( $conf->exists('voip-cust_cdr_squelch') ) { - squelch_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Omit CDRs from printed invoices') |h %> + squelch_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt($conf->exists('voip-cdr_email') ? 'Omit CDRs from printed invoices' : 'Omit CDRs from invoices') |h %> % } else { % } -% if ( $conf->exists('voip-cust_email_csv_cdr') ) { +% if ( my $attach = $conf->config('voip-cdr_email_attach') ) { - email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as CSV to emailed invoices') |h %> + email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as '. uc($attach). ' to emailed invoices') |h %> % } else { @@ -532,11 +655,38 @@ function toggle(obj) { % } +%my @available_locales = $conf->config('available-locales'); +%if ( scalar(@available_locales) ) { +% push @available_locales, '' +% unless $cust_main->locale && $conf->exists('cust_main-require_locale'); +% my %locale_labels = map { +% my %ll; +% my %info = FS::Locales->locale_info($_); +% $ll{$_} = $info{name} . " (" . $info{country} . ")"; +% %ll; +% } FS::Locales->locales; +% +% my $label = ( $conf->exists('cust_main-require_locale') ? $r : '' ). +% emt('Invoicing locale'); + + <& /elements/tr-select.html, + 'label' => $label, + 'field' => 'locale', + 'options' => \@available_locales, + 'labels' => \%locale_labels, + 'curr_value' => $cust_main->locale, + &> +% } + - <% $r %> <% mt('required fields') |h %> + <% $r %><% mt('required fields') |h %> % } + + <%once> my $paystate_label = FS::Msgcat::_gettext('paystate'); @@ -551,6 +701,8 @@ my $payinfo = $options{'payinfo'}; my $conf = new FS::Conf; my $payby_default = $conf->config('payby-default'); +my $money_char = $conf->config('money_char') || '$'; + 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 )) @@ -565,4 +717,6 @@ if ( $cust_main->custnum ) { $show_term = $term_sth->fetchrow_arrayref->[0]; } +my $agentnum = $cust_main->agentnum if $cust_main->custnum; +