X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fcontacts.html;h=22594c5e271ba217f2d86181eb12faf179ceba22;hb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;hp=9c2b38f9acb7fb5e60addf0ac56c3d9b69098911;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html index 9c2b38f9a..22594c5e2 100644 --- a/httemplate/view/cust_main/contacts.html +++ b/httemplate/view/cust_main/contacts.html @@ -1,122 +1,47 @@ -% -% my( $cust_main ) = @_; -% my $conf = new FS::Conf; -% +% my %which = ( +% '' => 'Billing', +% 'ship_' => 'Service', +% ); +% foreach my $which ( '', 'ship_' ) { +% my $pre = $cust_main->get("${which}last") ? $which : ''; - -Billing address -<% ntable("#cccccc") %><% ntable("#cccccc",2) %> - - Contact name - - <% $cust_main->last. ', '. $cust_main->first %> - -% if ( $conf->exists('show_ss') ) { - - SS# - <% $cust_main->ss || ' ' %> -% } - - - - Company - <% $cust_main->company %> - - - Address - <% $cust_main->address1 %> - -% if ( $cust_main->address2 ) { - - -   - <% $cust_main->address2 %> - -% } - - - City - <% $cust_main->city %> - State - <% state_label($cust_main->state, $cust_main->country) %> - Zip - <% $cust_main->zip %> - - - Country - <% code2country($cust_main->country) %> - -% -% my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ -% ? 'Day Phone' -% : FS::Msgcat::_gettext('daytime'); -% my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/ -% ? 'Night Phone' -% : FS::Msgcat::_gettext('night'); -% - - - <% $daytime_label %> - - <% include('/elements/phonenumber.html', - $cust_main->daytime, - 'callable'=>1 - ) - %> - - - - <% $night_label %> - - <% include('/elements/phonenumber.html', - $cust_main->night, - 'callable'=>1 - ) - %> - - - - Fax - - <% $cust_main->fax || ' ' %> - - - -% if ( defined $cust_main->dbdef_table->column('ship_last') ) { -% my $pre = $cust_main->ship_last ? 'ship_' : ''; -% - - -
-Service address +<% $which{$which} %> address <% ntable("#cccccc") %><% ntable("#cccccc",2) %> Contact name <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") %> +% if ( $which eq '' && $conf->exists('show_ss') ) { + SS# + <% $cust_main->masked('ss') || ' ' %> +% } Company - <% $cust_main->get("${pre}company") %> + <% $cust_main->get("${pre}company") %> Address - <% $cust_main->get("${pre}address1") %> + <% $cust_main->get("${pre}address1") %> % if ( $cust_main->get("${pre}address2") ) {   - <% $cust_main->get("${pre}address2") %> + <% $cust_main->get("${pre}address2") %> % } City <% $cust_main->get("${pre}city") %> +% if ( $cust_main->get("${pre}county") ) { + County + <% $cust_main->get("${pre}county") %> +% } State - <% $cust_main->get("${pre}state") %> + <% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) %> Zip <% $cust_main->get("${pre}zip") %> @@ -126,7 +51,7 @@ Service address <% $daytime_label %> - + <% include('/elements/phonenumber.html', $cust_main->get("${pre}daytime"), 'callable'=>1 @@ -136,7 +61,7 @@ Service address <% $night_label %> - + <% include('/elements/phonenumber.html', $cust_main->get("${pre}night"), 'callable'=>1 @@ -146,10 +71,44 @@ Service address Fax - + <% $cust_main->get("${pre}fax") || ' ' %> +% if ( $which eq '' && $conf->exists('show_stateid') ) { + + <% $stateid_label %> + <% $cust_main->masked('stateid') || ' ' %> + <% $stateid_state_label %> + <% $cust_main->stateid_state || ' ' %> + +% } +% if ( $which ne 'ship_' ) { +
+% } % } +<%once> + +my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/ + ? 'Day Phone' + : FS::Msgcat::_gettext('daytime'); +my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/ + ? 'Night Phone' + : FS::Msgcat::_gettext('night'); +my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/ + ? 'Driver’s License' + : FS::Msgcat::_gettext('stateid'); +my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/ + ? 'Driver’s License State' + : FS::Msgcat::_gettext('stateid_state'); + + +<%init> + +my( $cust_main ) = @_; +my $conf = new FS::Conf; + + +