-% my %which = (
-% '' => emt('Billing'),
-% 'ship_' => emt('Service'),
-% );
-% foreach my $which ( '', 'ship_' ) {
-% my $pre = $cust_main->get("${which}last") ? $which : '';
-
-<% $which{$which} %> <% mt('address') |h %>
-<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
-<TR>
- <TD ALIGN="right"><% mt('Contact name') |h %></TD>
- <TD COLSPAN=5 BGCOLOR="#ffffff">
- <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %>
- </TD>
-% if ( $which eq '' && $conf->exists('show_ss') ) {
- <TD ALIGN="right"><% mt('SS#') |h %></TD>
- <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || ' ' %></TD>
-% }
-</TR>
-% if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
-<TR>
- <TD ALIGN="right"><% mt('Email invoices') |h %></TD>
- <TD BGCOLOR="#ffff00">
- <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
- </TD>
-</TR>
+% my %addr_label = ('bill' => 'Billing address', 'ship' => 'Service address');
+
+%# Locations (possibly break this out)
+% my @which = ('bill', 'ship');
+% while (@which) {
+% my $this = shift @which;
+% my $method = $this.'_location';
+% my $location = $cust_main->$method;
+<FONT CLASS="fsinnerbox-title"><% mt( $addr_label{$this} ) |h %>
+% if ( $this eq 'ship' and
+% $cust_main->bill_locationnum == $cust_main->ship_locationnum )
+% {
+ (<% mt('same as billing') %>)
+% }
+</FONT>
+% if (
+% ($this eq 'ship')
+% && $cust_main->invoice_ship_address
+% && !$conf->exists('invoice-ship_address') #it's always on, so hide per-cust config
+% ) {
+<SPAN STYLE="padding-left: .25em;">(<% emt('included on invoices') %>)</SPAN>
+% }
+<TABLE CLASS="fsinnerbox">
+
+% if ( $this eq 'bill' ) {
+% #billing contact fields
+ <TR>
+ <TH ALIGN="right"><% mt('Contact name') |h %></TH>
+ <TD COLSPAN=5><% $cust_main->contact |h %></TD>
+% if ( $conf->exists('show_ss') ) {
+ <TH ALIGN="right"><% mt('SS#') |h %></TH>
+ <TD><% $conf->exists('unmask_ss')
+ ? $cust_main->ss
+ : $cust_main->masked('ss') || ' ' %></TD>
+% }
+ </TR>
+% if ( $conf->exists('cust_main-enable_spouse') and
+% ($cust_main->spouse_last or $cust_main->spouse_first) ) {
+ <TR>
+ <TH ALIGN="right"><% mt('Spouse') |h %></TH>
+ <TD COLSPAN=5>
+ <% join(', ', grep $_,
+ $cust_main->spouse_last, $cust_main->spouse_first) %>
+ </TD>
+ </TR>