X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main%2Fbilling.html;h=3f873174fe3d08c28604c3d51f05232939c03b19;hb=a68564e6856a7ea63763eeaf7962a5cb2df649af;hp=07266b9a6fc8ed4d94ca723d73d2b12a6191dc57;hpb=b5dbd9e1bcbb701a20ed23e723b1e0105fd7c1a1;p=freeside.git
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 07266b9a6..3f873174f 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") %>
@@ -95,14 +95,38 @@
return true;
}
+ function init_payauto_changed(){
+ var f = document.getElementById('CARD_payauto');
+ if(f != null) payauto_changed(f);
+ f = document.getElementById('CHEK_payauto');
+ if(f != null) payauto_changed(f);
+ }
+
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 = 'inline';
- 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;
+ }
+ }
+
<& /elements/init_overlib.html &>
@@ -110,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"';
@@ -129,7 +156,7 @@
%
% sub billday_options {
% my $curr_value = shift;
-% my $ret = ' ';
+% my $ret = '';
% for my $billday ( 1 .. 28 ) {
% my $sel = '';
% $sel = "SELECTED='SELECTED'" if $curr_value == $billday;
@@ -137,8 +164,19 @@
% }
% $ret;
% }
-% my $billday_card_display = $payby eq 'CARD' ? 'inline' : 'none';
-% my $billday_chek_display = $payby eq 'CHEK' ? 'inline' : '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 = (
%
@@ -190,12 +228,15 @@
% qq! ${r}!.emt('Exact name on card').qq! !.
% qq! !.
%
-% qq! !.emt('Charge future payments to this card automatically').qq! !.
+% qq!!.
+% qq! !.
+% emt('Charge future payments to this [_1] automatically','credit card').' '.
%
% ( $conf->exists('cust_main-select-billday') ?
-% qq!
-% Charge on the !
-% . billday_options($cust_main->billday) . qq! day of each month !
+% qq!
+% Charge on this day of each month
+% !
+% . billday_options($cust_main->billday) . qq! !
% : ''
% ).
%
@@ -211,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') ?
@@ -235,19 +280,18 @@
% ).
%
%
-% qq! !.emt('Charge future payments to this electronic check automatically').qq! !.
+% qq!!.
+% qq! !.
+% emt('Charge future payments to this [_1] automatically','electronic check').' '.
%
% ( $conf->exists('cust_main-select-billday') ?
-% qq!
-% Charge on the !
-% . billday_options($cust_main->billday) . qq! day of each month !
+% qq!
+% Charge on this day of each month
+% !
+% . billday_options($cust_main->billday) . qq! !
% : ''
% ).
%
-% ' '.
-% ' '.
-% ' '.
-%
% '',
%
% 'LECB' =>
@@ -393,6 +437,7 @@
'labels' => \%allopt,
'html_between' => '',
'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
+ 'onchange' => 'init_payauto_changed();',
&>
<% &ntable("#cccccc") %>
@@ -401,14 +446,28 @@
% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
-
- tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %>
-
+% if ( $conf->exists('cust_class-tax_exempt')
+% || $conf->exists('tax-cust_exempt-groups-require_individual_nums')
+% )
+% {
+
+
+
+% } else {
+
+
+ tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %>
+
+
+% }
% foreach my $exempt_group ( @exempt_groups ) {
-% #escape $exempt_group for NAME
+% 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"));
- tax_exemption($exempt_group) ? 'CHECKED' : '' %>> Tax Exempt (<% $exempt_group %> taxes)
+ onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)
+ - Exemption number exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>>
% }
@@ -441,12 +500,15 @@
% }
+% 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)
+% }
<% mt('Invoice terms') |h %>
@@ -480,7 +542,7 @@ 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 {
@@ -521,11 +583,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');
@@ -554,4 +643,6 @@ if ( $cust_main->custnum ) {
$show_term = $term_sth->fetchrow_arrayref->[0];
}
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
+
%init>