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 <TD ALIGN="right"><% mt('Contact name') |h %></TD>
29 <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->contact |h %></TD>
30 % if ( $conf->exists('show_ss') ) {
31 <TD ALIGN="right"><% mt('SS#') |h %></TD>
32 <TD BGCOLOR="#ffffff"><% $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 <TD ALIGN="right"><% mt('Spouse') |h %></TD>
41 <TD COLSPAN=5 BGCOLOR="#ffffff">
42 <% join(', ', grep $_,
43 $cust_main->spouse_last, $cust_main->spouse_first) %>
47 % if ( $conf->exists('cust-email-high-visibility') ) {
49 <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
50 <TD BGCOLOR="#ffff00">
51 <% $cust_main->invoicing_list_emailonly_scalar || $no %>
55 % if ( $cust_main->company ) {
57 <TD ALIGN="right"><% mt('Company') |h %></TD>
58 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $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 BGCOLOR="#ffffff"><% $cust_main->ship_company |h %></TD>
69 % # now the actual address
71 % if ( $location->locationname ) {
73 <TD ALIGN="right"><% mt('Location ID') |h %></TD>
74 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->locationname |h %></TD>
79 <TD ALIGN="right"><% mt('Address') |h %></TD>
80 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address1 |h %></TD>
83 % if ( $location->get('address2') ) {
84 % my $address2_label = $conf->exists('cust_main-require_address2')
89 <TD ALIGN="right"><% $address2_label %></TD>
90 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address2 |h %></TD>
96 % if ( $location->city ) {
97 <TD ALIGN="right"><% mt('City') |h %></TD>
98 <TD BGCOLOR="#ffffff"><% $location->city |h %></TD>
100 <TD COLSPAN="2"></TD>
102 % if ( $location->county ) {
103 <TD ALIGN="right"><% mt('County') |h %></TD>
104 <TD BGCOLOR="#ffffff"><% $location->county |h %></TD>
106 <TD ALIGN="right"><% mt('State') |h %></TD>
107 <TD BGCOLOR="#ffffff"><% state_label( $location->state, $location->country ) |h %></TD>
108 <TD ALIGN="right"><% mt('Zip') |h %></TD>
109 <TD BGCOLOR="#ffffff"><% $location->zip |h %></TD>
112 <TD ALIGN="right"><% mt('Country') |h %></TD>
113 <TD BGCOLOR="#ffffff"><% $location->country_full |h %></TD>
116 % if ( $location->latitude && $location->longitude ) {
117 <& /elements/tr-coords.html, $location->latitude,
118 $location->longitude,
119 $cust_main->name_short,
120 $cust_main->agentnum,
123 <& /elements/tr-censustract.html, $location &>
125 % if ( $this eq 'bill' ) {
126 % # billing contact phone numbers
127 % foreach my $phone (qw(daytime night mobile)) {
128 % next if !$cust_main->get($phone);
130 <TD ALIGN="right"><% $phone_label{$phone} %></TD>
131 <TD COLSPAN=3 BGCOLOR="#ffffff">
132 <& /elements/phonenumber.html,
133 $cust_main->get($phone),
135 calling_list_exempt => $cust_main->calling_list_exempt,
141 % if ( $cust_main->get('fax') ) {
144 <TD ALIGN="right"><% mt('Fax') |h %></TD>
145 <TD COLSPAN=3 BGCOLOR="#ffffff">
146 <% $cust_main->get('fax') || ' ' %>
152 % if ( $conf->exists('show_stateid') ) {
155 <TD ALIGN="right"><% $stateid_label %></TD>
156 <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || ' ' %></TD>
157 <TD ALIGN="right"><% $stateid_state_label %></TD>
158 <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || ' ' %></TD>
162 % } #if $this eq 'bill'
172 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
174 : FS::Msgcat::_gettext('daytime')
177 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
179 : FS::Msgcat::_gettext('night')
182 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
183 ? 'Mobile Phone'
184 : FS::Msgcat::_gettext('Mobile')
188 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
189 ? 'Driver’s License'
190 : FS::Msgcat::_gettext('stateid');
191 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
192 ? 'Driver’s License State'
193 : FS::Msgcat::_gettext('stateid_state');
198 my $cust_main = shift;
199 my $conf = new FS::Conf;
200 my @invoicing_list = $cust_main->invoicing_list;