diff options
Diffstat (limited to 'httemplate/edit/cust_main')
-rw-r--r-- | httemplate/edit/cust_main/after_bill_location.html | 12 | ||||
-rw-r--r-- | httemplate/edit/cust_main/before_bill_location.html | 10 | ||||
-rw-r--r-- | httemplate/edit/cust_main/billing.html | 84 | ||||
-rw-r--r-- | httemplate/edit/cust_main/birthdate.html | 31 | ||||
-rw-r--r-- | httemplate/edit/cust_main/bottomfixup.js | 28 | ||||
-rw-r--r-- | httemplate/edit/cust_main/company.html | 7 | ||||
-rw-r--r-- | httemplate/edit/cust_main/fax.html | 5 | ||||
-rw-r--r-- | httemplate/edit/cust_main/name.html | 53 | ||||
-rw-r--r-- | httemplate/edit/cust_main/phones.html | 29 | ||||
-rw-r--r-- | httemplate/edit/cust_main/stateid.html | 39 | ||||
-rw-r--r-- | httemplate/edit/cust_main/top_misc.html | 27 |
11 files changed, 266 insertions, 59 deletions
diff --git a/httemplate/edit/cust_main/after_bill_location.html b/httemplate/edit/cust_main/after_bill_location.html new file mode 100644 index 000000000..2f4c3b51c --- /dev/null +++ b/httemplate/edit/cust_main/after_bill_location.html @@ -0,0 +1,12 @@ +% if ( ! $conf->exists('cust-edit-alt-field-order') ) { + <& phones.html, $cust_main &> + <& fax.html, $cust_main &> +% } else { + <& fax.html, $cust_main &> + <& company.html, $cust_main &> +% } +<& stateid.html, $cust_main &> +<%init> +my $cust_main = shift; +my $conf = FS::Conf->new; +</%init> diff --git a/httemplate/edit/cust_main/before_bill_location.html b/httemplate/edit/cust_main/before_bill_location.html new file mode 100644 index 000000000..973201ecb --- /dev/null +++ b/httemplate/edit/cust_main/before_bill_location.html @@ -0,0 +1,10 @@ +<& name.html, $cust_main &> +% if ( ! $conf->exists('cust-edit-alt-field-order') ) { + <& company.html, $cust_main &> +% } else { + <& phones.html, $cust_main &> +% } +<%init> +my $cust_main = shift; +my $conf = FS::Conf->new; +</%init> diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 18c7ae9a6..d7082f23a 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -117,6 +117,15 @@ //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; + } + } </SCRIPT> @@ -437,14 +446,28 @@ % my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups'); - <TR> - <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" <% $cust_main->tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %></TD> - </TR> +% if ( $conf->exists('cust_class-tax_exempt') +% || $conf->exists('tax-cust_exempt-groups-require_individual_nums') +% ) +% { + + <INPUT TYPE="hidden" NAME="tax" VALUE="<% $cust_main->tax eq 'Y' ? 'Y' : '' %>"> + +% } else { + + <TR> + <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" <% $cust_main->tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %></TD> + </TR> + +% } % 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")); <TR> - <TD WIDTH="608" COLSPAN="2"> <INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" VALUE="Y" <% $cust_main->tax_exemption($exempt_group) ? 'CHECKED' : '' %>> Tax Exempt (<% $exempt_group %> taxes)<TD> + <TD> <INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" ID="tax_<% $exempt_group %>" VALUE="Y" <% $checked ? 'CHECKED' : '' %> onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)</TD> + <TD> - Exemption number <INPUT TYPE="text" NAME="tax_<% $exempt_group %>_num" ID="tax_<% $exempt_group %>_num" VALUE="<% $cgi->param("tax_$exempt_group".'_num') || ( $cust_main_exemption ? $cust_main_exemption->exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>></TD> </TR> % } @@ -458,7 +481,7 @@ ? 'CHECKED' : '' - %>> <% mt('Postal mail invoice') |h %> + %>> <% mt('Postal mail invoices') |h %> </TD> </TR> @@ -470,15 +493,27 @@ ? 'CHECKED' : '' - %>> <% mt('Fax invoice') |h %> + %>> <% mt('Fax invoices') |h %> </TD> </TR> % } -% unless ( $conf->exists('cust-email-high-visibility')) { <TR> + <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoice_email" VALUE="Y" <% + + ( $cust_main->invoice_noemail eq 'Y' ) + ? '' + : 'CHECKED' + + %>> <% mt('Email invoices') |h %> + + </TD> + </TR> + +% unless ( $conf->exists('cust-email-high-visibility')) { + <TR> <TD ALIGN="right" WIDTH="200"> <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) ? $r : '' %>Email address(es) @@ -562,20 +597,25 @@ function toggle(obj) { %my @available_locales = $conf->config('available-locales'); %if ( scalar(@available_locales) ) { -% push @available_locales, ''; -% my %locale_labels = map { -% my %ll; -% my %info = FS::Locales->locale_info($_); -% $ll{$_} = $info{name} . " (" . $info{country} . ")"; -% %ll; -% } FS::Locales->locales; - <& /elements/tr-select.html, - 'label' => emt('Invoicing locale'), - 'field' => 'locale', - 'options' => \@available_locales, - 'labels' => \%locale_labels, - 'curr_value' => $cust_main->locale, - &> +% 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, + &> % } </TABLE> diff --git a/httemplate/edit/cust_main/birthdate.html b/httemplate/edit/cust_main/birthdate.html index b4e78e3b9..5d6a123b1 100644 --- a/httemplate/edit/cust_main/birthdate.html +++ b/httemplate/edit/cust_main/birthdate.html @@ -1,16 +1,33 @@ <% ntable("#cccccc", 2) %> - <% include( '/elements/tr-input-date-field.html', - 'birthdate', - $cust_main->birthdate, - 'Date of Birth', - ( $conf->config('date_format') || "%m/%d/%Y" ), - 1 - ) +% # maybe put after the contact names? +% if ( $conf->exists('cust_main-enable_birthdate') ) { + <% include( '/elements/tr-input-date-field.html', { + 'name' => 'birthdate', + 'value' => $cust_main->birthdate, + 'label' => 'Date of Birth', + 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ), + 'usedatetime' => 1, + 'noinit' => $noinit++, + }) %> +% } +% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) { + <% include( '/elements/tr-input-date-field.html', { + 'name' => 'spouse_birthdate', + 'value' => $cust_main->spouse_birthdate, + 'label' => 'Spouse Date of Birth', + 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ), + 'usedatetime' => 1, + 'noinit' => $noinit++, + }) + %> +% } </TABLE> <%init> my( $cust_main, %opt ) = @_; my $conf = new FS::Conf; +my $noinit = 0; + </%init> diff --git a/httemplate/edit/cust_main/bottomfixup.js b/httemplate/edit/cust_main/bottomfixup.js index 800864bc8..77d4294a6 100644 --- a/httemplate/edit/cust_main/bottomfixup.js +++ b/httemplate/edit/cust_main/bottomfixup.js @@ -66,21 +66,25 @@ function copy_payby_fields() { %# call submit_continue() on completion... %# otherwise not touching standardize_locations for now <% include( '/elements/standardize_locations.js', - 'callback' => 'submit_continue();' + 'callback' => 'submit_continue();', + 'main_prefix' => 'bill_', + 'no_company' => 1, ) %> +var prefix; function fetch_censustract() { //alert('fetch census tract data'); + prefix = document.getElementById('same').checked ? 'bill_' : 'ship_'; var cf = document.CustomerForm; - var state_el = cf.elements['ship_state']; + var state_el = cf.elements[prefix + 'state']; var census_data = new Array( 'year', <% $conf->config('census_year') || '2012' %>, - 'address1', cf.elements['ship_address1'].value, - 'city', cf.elements['ship_city'].value, + 'address1', cf.elements[prefix + 'address1'].value, + 'city', cf.elements[prefix + 'city'].value, 'state', state_el.options[ state_el.selectedIndex ].value, - 'zip', cf.elements['ship_zip'].value + 'zip', cf.elements[prefix + 'zip'].value ); censustract( census_data, update_censustract ); @@ -109,19 +113,21 @@ function update_censustract(arg) { set_censustract = function () { - cf.elements['censustract'].value = newcensus; + cf.elements[prefix + 'censustract'].value = newcensus; submit_continue(); } - if (error || cf.elements['censustract'].value != newcensus) { + if (error || cf.elements[prefix + 'censustract'].value != newcensus) { // popup an entry dialog if (error) { newcensus = error; } newcensus.replace(/.*ndefined.*/, 'Not found'); - var latitude = cf.elements['latitude' ].value || '<% $company_latitude %>'; - var longitude= cf.elements['longitude'].value || '<% $company_longitude %>'; + var latitude = cf.elements[prefix + 'latitude'].value + || '<% $company_latitude %>'; + var longitude= cf.elements[prefix + 'longitude'].value + || '<% $company_longitude %>'; var choose_censustract = '<CENTER><BR><B>Confirm censustract</B><BR>' + @@ -132,14 +138,14 @@ function update_censustract(arg) { '" target="_blank">Map service module location</A><BR>' + '<A href="http://maps.ffiec.gov/FFIECMapper/TGMapSrv.aspx?' + 'census_year=<% $conf->config('census_year') || '2012' %>' + - '&zip_code=' + cf.elements['ship_zip'].value + + '&zip_code=' + cf.elements[prefix + 'zip'].value + '" target="_blank">Map zip code center</A><BR><BR>' + '<TABLE>'; choose_censustract = choose_censustract + '<TR><TH style="width:50%">Entered census tract</TH>' + '<TH style="width:50%">Calculated census tract</TH></TR>' + - '<TR><TD>' + cf.elements['censustract'].value + + '<TR><TD>' + cf.elements[prefix + 'censustract'].value + '</TD><TD>' + newcensus + '</TD></TR>' + '<TR><TD> </TD><TD> </TD></TR>'; diff --git a/httemplate/edit/cust_main/company.html b/httemplate/edit/cust_main/company.html new file mode 100644 index 000000000..8a6ed0bbf --- /dev/null +++ b/httemplate/edit/cust_main/company.html @@ -0,0 +1,7 @@ +% my $cust_main = shift; +<TR ID="company_row" <% $cust_main->company ? '' : 'STYLE="display:none"' %>> + <TD ALIGN="right"><% mt('Company') |h %></TD> + <TD COLSPAN=6><INPUT TYPE="text" NAME="company" ID="company" SIZE=60 + VALUE="<% $cust_main->company |h %>"> + </TD> +</TR> diff --git a/httemplate/edit/cust_main/fax.html b/httemplate/edit/cust_main/fax.html new file mode 100644 index 000000000..237d4be44 --- /dev/null +++ b/httemplate/edit/cust_main/fax.html @@ -0,0 +1,5 @@ +% my $cust_main = shift; +<TR> + <TD ALIGN="right"><% mt('Fax') |h %></TD> + <TD><INPUT TYPE="text" NAME="fax" VALUE="<% $cust_main->fax %>" SIZE=18></TD> +</TR> diff --git a/httemplate/edit/cust_main/name.html b/httemplate/edit/cust_main/name.html new file mode 100644 index 000000000..2641ec930 --- /dev/null +++ b/httemplate/edit/cust_main/name.html @@ -0,0 +1,53 @@ +<%def .namepart> +% my ($field, $value, $label, $extra) = @_; +<TD> + <INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>> + <BR><FONT SIZE=-1><% mt($label) %></FONT> +</TD> +</%def> + +<TR> + <TH VALIGN="top" ALIGN="right"><%$r%><% mt('Contact name') |h %></TH> + <TD COLSPAN=6> + <TABLE CELLSPACING=0 CELLPADDING=0> + <TR> + <& .namepart, 'last', $cust_main->last, 'Last' &> + <TD VALIGN="top"> , </TD> + <& .namepart, 'first', $cust_main->first, 'First' &> +% if ( $conf->exists('show_ss') ) { + <TD> </TD> + <& .namepart, 'ss', $ss, 'SS#', "SIZE=11" &> +% } else { + <INPUT TYPE="hidden" NAME="ss" VALUE="<% $ss %>"> +% } + </TR> + </TABLE> + </TD> +</TR> + +% if ( $conf->exists('cust-email-high-visibility') ) { +<TR> + <TD ALIGN="right"> + <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) + ? $r + : '' %>Email address(es) + </TD> + <TD BGCOLOR="#FFFF00"> + <INPUT TYPE="text" NAME="invoicing_list" + VALUE=<% $cust_main->invoicing_list_emailonly_scalar %>> + </TD> +</TR> +% } +<%init> +my $cust_main = shift; +my $agentnum = $cust_main->agentnum if $cust_main->custnum; +my $conf = FS::Conf->new; +my $r = '<font color="#ff0000">*</font> '; +my $ss; + +if ( $cgi->param('error') or $conf->exists('unmask_ss') ) { + $ss = $cust_main->ss; +} else { + $ss = $cust_main->masked('ss'); +} +</%init> diff --git a/httemplate/edit/cust_main/phones.html b/httemplate/edit/cust_main/phones.html new file mode 100644 index 000000000..9b23e0716 --- /dev/null +++ b/httemplate/edit/cust_main/phones.html @@ -0,0 +1,29 @@ +<TR> + <TD VALIGN="top" ALIGN="right"><% mt('Phones') |h %></TD> + <TD COLSPAN=6> + <TABLE CELLSPACING=0 CELLPADDING=0> + <TR> +% foreach my $phone (qw(daytime night mobile)) { + <TD> + <INPUT TYPE="text" + NAME="<% $phone %>" + VALUE="<% $cust_main->get($phone) %>" + SIZE=18 + > + <BR><FONT SIZE=-1><% mt($phone_label{$phone}) |h %></FONT> + </TD> + <TD> </TD> +% } + </TR> + </TABLE> + </TD> +</TR> +<%init> +my $cust_main = shift; +my $conf = FS::Conf->new; +my %phone_label = ( + daytime => 'Day Phone', + night => 'Night Phone', + mobile => 'Mobile', +); +</%init> diff --git a/httemplate/edit/cust_main/stateid.html b/httemplate/edit/cust_main/stateid.html new file mode 100644 index 000000000..2655f5142 --- /dev/null +++ b/httemplate/edit/cust_main/stateid.html @@ -0,0 +1,39 @@ +% if ( $conf->exists('show_stateid') ) { +<TR> + <TD ALIGN="right"><% $stateid_label %></TD> + <TD><INPUT TYPE="text" NAME="stateid" VALUE="<% $stateid %>" SIZE=12></TD> + <TD><& /elements/select-state.html, + state => $cust_main->stateid_state, + country => $cust_main->country, # how does this work on new customer? + prefix => 'stateid_', + disable_countyupdate => 1, + &></TD> +</TR> +% } else { +<INPUT TYPE="hidden" NAME="stateid" VALUE="<% $stateid %>"> +<INPUT TYPE="hidden" NAME="stateid_state" VALUE="<% $cust_main->stateid_state %>"> +% } + +<%init> +my $cust_main = shift; +my $conf = FS::Conf->new; +my $stateid; +if ( $cgi->param('error') ) { + $stateid = $cust_main->stateid; +} elsif ( $cust_main->custnum ) { + $stateid = $cust_main->masked('stateid'); +} else { + $stateid = ''; +} +$cust_main->set('stateid_state' => $cust_main->state) + unless $cust_main->stateid_state; + +my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/ + ? 'Driver’s License' + : FS::Msgcat::_gettext('stateid') || 'Driver’s License'; + +my $stateid_state_label = + FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/ + ? 'Driver’s License State' + : FS::Msgcat::_gettext('stateid') || 'Driver’s License State'; +</%init> diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html index 7ba167b7f..7ce283c6c 100644 --- a/httemplate/edit/cust_main/top_misc.html +++ b/httemplate/edit/cust_main/top_misc.html @@ -20,27 +20,16 @@ <% $cust_main->residential_commercial eq 'Commercial' ? 'CHECKED' : '' %> ></TD> </TR> - <SCRIPT TYPE="text/javascript"> - function rescom_changed() { - var f = document.CustomerForm; - - if ( f.residential_commercial_Residential.checked ) { - document.getElementById('contacts_div').style.display = 'none'; - } else { // if ( f.residential_commercial_Commercial.checked ) { - document.getElementById('contacts_div').style.display = ''; - } - - if ( f.residential_commercial_Residential.checked && ! f.company.value.length ) { - document.getElementById('company_row').style.display = 'none' - } else { // if ( f.residential_commercial_Commercial.checked ) { + function rescom_changed(what) { + if ( what.checked == (what.value == 'Commercial' ) ) { document.getElementById('company_row').style.display = ''; - } - - if ( f.residential_commercial_Residential.checked && ! f.ship_company.value.length ) { - document.getElementById('ship_company_row').style.display = 'none' - } else { // if ( f.residential_commercial_Commercial.checked ) { - document.getElementById('ship_company_row').style.display = ''; + document.getElementById('contacts_div').style.display = ''; + } else { + if ( document.getElementById('company').value.length == 0 ) { + document.getElementById('company_row').style.display = 'none'; + } + document.getElementById('contacts_div').style.display = 'none'; } } </SCRIPT> |