1 % my %addr_label = ('bill' => 'Billing address', 'ship' => 'Service address');
3 %# Locations (possibly break this out)
4 % my @which = ('bill', 'ship');
6 % my $this = shift @which;
7 % my $method = $this.'_location';
8 % my $location = $cust_main->$method;
9 <FONT CLASS="fsinnerbox-title"><% mt( $addr_label{$this} ) |h %>
10 % if ( $this eq 'ship' and
11 % $cust_main->bill_locationnum == $cust_main->ship_locationnum )
13 (<% mt('same as billing') %>)
18 % && $cust_main->invoice_ship_address
19 % && !$conf->exists('invoice-ship_address') #it's always on, so hide per-cust config
21 <SPAN STYLE="padding-left: .25em;">(<% emt('included on invoices') %>)</SPAN>
23 <TABLE CLASS="fsinnerbox">
25 % if ( $this eq 'bill' ) {
26 % #billing contact fields
28 <TH ALIGN="right"><% mt('Contact name') |h %></TH>
29 <TD COLSPAN=5><% $cust_main->contact |h %></TD>
30 % if ( $conf->exists('show_ss') ) {
31 <TH ALIGN="right"><% mt('SS#') |h %></TH>
32 <TD><% $conf->exists('unmask_ss')
34 : $cust_main->masked('ss') || ' ' %></TD>
37 % if ( $conf->exists('cust_main-enable_spouse') and
38 % ($cust_main->spouse_last or $cust_main->spouse_first) ) {
40 <TH ALIGN="right"><% mt('Spouse') |h %></TH>
42 <% join(', ', grep $_,
43 $cust_main->spouse_last, $cust_main->spouse_first) %>
47 % if ( $conf->exists('cust-email-high-visibility') ) {
49 <TH ALIGN="right"><% mt('Email address(es)') |h %></TH>
50 <TD BGCOLOR="#ffff00">
51 <% $cust_main->invoicing_list_emailonly_scalar || $no %>
55 % if ( $cust_main->company ) {
57 <TH ALIGN="right"><% mt('Company') |h %></TH>
58 <TD COLSPAN=7><% $cust_main->company |h %></TD>
61 % } elsif ( $this eq 'ship' ) {
62 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
64 <TD ALIGN="right"><% mt('Company') |h %></TD>
65 <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
71 % if ( $location ) { # now the actual address
73 % if ( $location->locationname ) {
75 <TD ALIGN="right"><% mt('Location ID') |h %></TD>
76 <TD COLSPAN=7><% $location->locationname |h %></TD>
81 <TH ALIGN="right"><% mt('Address') |h %></TH>
82 <TD COLSPAN=7><% $location->address1 |h %></TD>
85 % if ( $location->get('address2') ) {
86 % my $address2_label = $conf->exists('cust_main-require_address2')
91 <TH ALIGN="right"><% $address2_label %></TH>
92 <TD COLSPAN=7><% $location->address2 |h %></TD>
99 <TD COLSPAN=5><% $location->city |h %>\
100 % if ( $location->county ) {
101 (<% $location->county |h %> county)\
103 ,<% state_label( $location->state, $location->country ) |h %>
109 <TD><% code2country( $location->country ) %></TD>
112 % if ( $location->latitude && $location->longitude ) {
113 <& /elements/tr-coords.html, $location->latitude,
114 $location->longitude,
115 $cust_main->name_short,
116 $cust_main->agentnum,
119 <& /elements/tr-censustract.html, $location &>
123 % if ( $this eq 'bill' ) {
124 % # billing contact phone numbers
125 % foreach my $phone (qw(daytime night mobile)) {
126 % next if !$cust_main->get($phone);
128 <TH ALIGN="right"><% $phone_label{$phone} %></TD>
130 <& /elements/phonenumber.html,
131 $cust_main->get($phone),
133 calling_list_exempt => $cust_main->calling_list_exempt,
139 % if ( $cust_main->get('fax') ) {
142 <TD ALIGN="right"><% mt('Fax') |h %></TD>
144 <% $cust_main->get('fax') || ' ' %>
150 % if ( $conf->exists('show_stateid') ) {
153 <TD ALIGN="right"><% $stateid_label %></TD>
154 <TD><% $cust_main->masked('stateid') || ' ' %></TD>
155 <TD ALIGN="right"><% $stateid_state_label %></TD>
156 <TD><% $cust_main->stateid_state || ' ' %></TD>
160 % } #if $this eq 'bill'
170 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
172 : FS::Msgcat::_gettext('daytime')
175 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
177 : FS::Msgcat::_gettext('night')
180 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
181 ? 'Mobile Phone'
182 : FS::Msgcat::_gettext('Mobile')
186 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
187 ? 'Driver’s License'
188 : FS::Msgcat::_gettext('stateid');
189 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
190 ? 'Driver’s License State'
191 : FS::Msgcat::_gettext('stateid_state');
196 my $cust_main = shift;
197 my $conf = new FS::Conf;
198 my @invoicing_list = $cust_main->invoicing_list;