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 (<% emt('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>
33 <span id="ss_span" style="white-space:nowrap;">
34 <% $cust_main->masked('ss') || ' ' %>
37 % && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')
39 <& /elements/link-replace_element_text.html, {
40 target_id => 'ss_span',
41 replace_text => $cust_main->ss,
42 element_type => 'span'
49 % if ( $conf->exists('cust_main-enable_spouse') and
50 % ($cust_main->spouse_last or $cust_main->spouse_first) ) {
52 <TH ALIGN="right"><% mt('Spouse') |h %></TH>
54 <% join(', ', grep $_,
55 $cust_main->spouse_last, $cust_main->spouse_first) %>
61 % if ( scalar(@invoicing_list) == 1 ) { # typical individual user; show here
63 <TH ALIGN="right"><% mt('Email address') |h %></TH>
65 <% $invoicing_list[0] %>
68 % } elsif ( scalar(@invoicing_list) > 1 ) {
69 % # business customer with a contact list
72 % } else { # there is no invoice email for them
74 <TH ALIGN="right"><% mt('Email address') |h %></TH>
75 % if ( !$cust_main->postal_invoice or
76 % $conf->exists('cust_main-require_invoicing_list_email',
77 % $cust_main->agentnum)
79 % # we need a contact email for this customer (either because that's
80 % # policy, or because otherwise they won't receive invoices) but we
82 <TD CLASS="error"><% emt('none') %></TD>
84 <TD><% emt('no') %></TD>
86 % } # end of invoicing email
88 % if ( $cust_main->company ) {
90 <TH ALIGN="right"><% mt('Company') |h %></TH>
91 <TD COLSPAN=7><% $cust_main->company |h %></TD>
94 % } elsif ( $this eq 'ship' ) {
95 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
97 <TH ALIGN="right"><% mt('Company') |h %></TH>
98 <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
104 % if ( $location ) { # now the actual address
106 % if ( $location->locationname ) {
108 <TH ALIGN="right"><% mt('Location ID') |h %></TH>
109 <TD COLSPAN=7><% $location->locationname |h %></TD>
114 <TH ALIGN="right"><% mt('Address') |h %></TH>
115 <TD COLSPAN=7><% $location->address1 |h %></TD>
118 % if ( $location->get('address2') ) {
119 % my $address2_label = $conf->exists('cust_main-require_address2')
124 <TH ALIGN="right"><% $address2_label %></TH>
125 <TD COLSPAN=7><% $location->address2 |h %></TD>
132 <TD COLSPAN=5><% $location->city |h %>\
133 % if ( $location->county ) {
134 (<% $location->county |h %> county)\
136 <% ($location->city || $location->county) ? ', ' : ''%><% state_label( $location->state, $location->country ) |h %>
137 <% $location->zip |h %>
142 <TD><% $location->country_full |h %></TD>
145 % if ( $location->latitude && $location->longitude ) {
146 <& /elements/tr-coords.html, $location->latitude,
147 $location->longitude,
148 $cust_main->name_short,
149 $cust_main->agentnum,
152 <& /elements/tr-censustract.html, $location &>
156 % if ( $this eq 'bill' ) {
157 % # billing contact phone numbers
158 % foreach my $phone (qw(daytime night mobile)) {
159 % next if !$cust_main->get($phone);
161 <TH ALIGN="right"><% $phone_label{$phone} %></TD>
163 <& /elements/phonenumber.html,
164 $cust_main->get($phone),
166 calling_list_exempt => $cust_main->calling_list_exempt,
172 % if ( $cust_main->get('fax') ) {
175 <TH ALIGN="right"><% mt('Fax') |h %></TH>
177 <% $cust_main->get('fax') || ' ' %>
183 % if ( $conf->exists('show_stateid') ) {
186 <TH ALIGN="right"><% $stateid_label %></TH>
188 <span id="stateid_span" style="white-space:nowrap;">
189 <% $cust_main->masked('stateid') || ' ' %>
191 % $cust_main->stateid
192 % && $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')
194 <& /elements/link-replace_element_text.html, {
195 target_id => 'stateid_span',
196 replace_text => $cust_main->stateid,
197 element_type => 'span'
202 <TH ALIGN="right"><% $stateid_state_label %></TH>
203 <TD><% $cust_main->stateid_state || ' ' %></TD>
207 % } #if $this eq 'bill'
217 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
219 : FS::Msgcat::_gettext('daytime')
222 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
224 : FS::Msgcat::_gettext('night')
227 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
228 ? 'Mobile Phone'
229 : FS::Msgcat::_gettext('Mobile')
233 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
234 ? 'Driver’s License'
235 : FS::Msgcat::_gettext('stateid');
236 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
237 ? 'Driver’s License State'
238 : FS::Msgcat::_gettext('stateid_state');
243 my $cust_main = shift;
244 my $conf = new FS::Conf;
245 my @invoicing_list = $cust_main->invoicing_list_emailonly;