% my %which = ( % '' => 'Billing', % 'ship_' => 'Service', % ); % foreach my $which ( '', 'ship_' ) { % my $pre = $cust_main->get("${which}last") ? $which : ''; <% $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") %> Address <% $cust_main->get("${pre}address1") %> % if ( $cust_main->get("${pre}address2") ) { % my $address2_label = % ( $conf->exists('cust_main-require_address2') % && ! ( $pre xor $cust_main->has_ship_address ) % ) % ? 'Unit #' % : ' '; <% $address2_label %> <% $cust_main->get("${pre}address2") %> % } City <% $cust_main->get("${pre}city") %> % if ( $cust_main->get("${pre}county") ) { County <% $cust_main->get("${pre}county") %> % } State <% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) %> Zip <% $cust_main->get("${pre}zip") %> Country <% code2country( $cust_main->get("${pre}country") ) %> <% $daytime_label %> <% include('/elements/phonenumber.html', $cust_main->get("${pre}daytime"), 'callable'=>1 ) %> <% $night_label %> <% include('/elements/phonenumber.html', $cust_main->get("${pre}night"), 'callable'=>1 ) %> 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;