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') %>)
16 <TABLE CLASS="fsinnerbox">
18 % if ( $this eq 'bill' ) {
19 % #billing contact fields
21 <TD ALIGN="right"><% mt('Contact name') |h %></TD>
22 <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->contact |h %></TD>
23 % if ( $conf->exists('show_ss') ) {
24 <TD ALIGN="right"><% mt('SS#') |h %></TD>
25 <TD BGCOLOR="#ffffff"><% $conf->exists('unmask_ss')
27 : $cust_main->masked('ss') || ' ' %></TD>
30 % if ( $conf->exists('cust_main-enable_spouse') and
31 % ($cust_main->spouse_last or $cust_main->spouse_first) ) {
33 <TD ALIGN="right"><% mt('Spouse') |h %></TD>
34 <TD COLSPAN=5 BGCOLOR="#ffffff">
35 <% join(', ', grep $_,
36 $cust_main->spouse_last, $cust_main->spouse_first) %>
40 % if ( $conf->exists('cust-email-high-visibility') ) {
42 <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
43 <TD BGCOLOR="#ffff00">
44 <% $cust_main->invoicing_list_emailonly_scalar || $no %>
48 % if ( $cust_main->company ) {
50 <TD ALIGN="right"><% mt('Company') |h %></TD>
51 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->company |h %></TD>
54 % } elsif ( $this eq 'ship' ) {
55 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
57 <TD ALIGN="right"><% mt('Company') |h %></TD>
58 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->ship_company |h %></TD>
62 % # now the actual address
64 % if ( $location->locationname ) {
66 <TD ALIGN="right"><% mt('Location ID') |h %></TD>
67 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->locationname |h %></TD>
72 <TD ALIGN="right"><% mt('Address') |h %></TD>
73 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address1 |h %></TD>
76 % if ( $location->get('address2') ) {
77 % my $address2_label = $conf->exists('cust_main-require_address2')
82 <TD ALIGN="right"><% $address2_label %></TD>
83 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address2 |h %></TD>
89 <TD ALIGN="right"><% mt('City') |h %></TD>
90 <TD BGCOLOR="#ffffff"><% $location->city |h %></TD>
91 % if ( $location->county ) {
92 <TD ALIGN="right"><% mt('County') |h %></TD>
93 <TD BGCOLOR="#ffffff"><% $location->county |h %></TD>
95 <TD ALIGN="right"><% mt('State') |h %></TD>
96 <TD BGCOLOR="#ffffff"><% state_label( $location->state, $location->country ) |h %></TD>
97 <TD ALIGN="right"><% mt('Zip') |h %></TD>
98 <TD BGCOLOR="#ffffff"><% $location->zip %></TD>
101 <TD ALIGN="right"><% mt('Country') |h %></TD>
102 <TD BGCOLOR="#ffffff"><% code2country( $location->country ) %></TD>
105 % if ( $location->latitude && $location->longitude ) {
106 <& /elements/tr-coords.html, $location->latitude,
107 $location->longitude,
108 $cust_main->name_short,
109 $cust_main->agentnum,
112 <& /elements/tr-censustract.html, $location &>
114 % if ( $this eq 'bill' ) {
115 % # billing contact phone numbers
116 % foreach my $phone (qw(daytime night mobile)) {
117 % next if !$cust_main->get($phone);
119 <TD ALIGN="right"><% $phone_label{$phone} %></TD>
120 <TD COLSPAN=3 BGCOLOR="#ffffff">
121 <& /elements/phonenumber.html,
122 $cust_main->get($phone),
124 calling_list_exempt => $cust_main->calling_list_exempt,
130 % if ( $cust_main->get('fax') ) {
133 <TD ALIGN="right"><% mt('Fax') |h %></TD>
134 <TD COLSPAN=3 BGCOLOR="#ffffff">
135 <% $cust_main->get('fax') || ' ' %>
141 % if ( $conf->exists('show_stateid') ) {
144 <TD ALIGN="right"><% $stateid_label %></TD>
145 <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || ' ' %></TD>
146 <TD ALIGN="right"><% $stateid_state_label %></TD>
147 <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || ' ' %></TD>
151 % } #if $this eq 'bill'
161 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
163 : FS::Msgcat::_gettext('daytime')
166 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
168 : FS::Msgcat::_gettext('night')
171 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
172 ? 'Mobile Phone'
173 : FS::Msgcat::_gettext('Mobile')
177 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
178 ? 'Driver’s License'
179 : FS::Msgcat::_gettext('stateid');
180 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
181 ? 'Driver’s License State'
182 : FS::Msgcat::_gettext('stateid_state');
187 my $cust_main = shift;
188 my $conf = new FS::Conf;
189 my @invoicing_list = $cust_main->invoicing_list;