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 <% $conf->exists('unmask_ss')
36 : $cust_main->masked('ss') || ' ' %>
39 % && !$conf->exists('unmask_ss')
40 % && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')
42 <& /elements/link-replace_element_text.html, {
43 target_id => 'ss_span',
44 replace_text => $cust_main->ss,
45 element_type => 'span'
52 % if ( $conf->exists('cust_main-enable_spouse') and
53 % ($cust_main->spouse_last or $cust_main->spouse_first) ) {
55 <TH ALIGN="right"><% mt('Spouse') |h %></TH>
57 <% join(', ', grep $_,
58 $cust_main->spouse_last, $cust_main->spouse_first) %>
64 % if ( scalar(@invoicing_list) == 1 ) { # typical individual user; show here
66 <TH ALIGN="right"><% mt('Email address') |h %></TH>
68 <% $invoicing_list[0] %>
71 % } elsif ( scalar(@invoicing_list) > 1 ) {
72 % # business customer with a contact list
75 % } else { # there is no invoice email for them
77 <TH ALIGN="right"><% mt('Email address') |h %></TH>
78 % if ( !$cust_main->postal_invoice or
79 % $conf->exists('cust_main-require_invoicing_list_email',
80 % $cust_main->agentnum)
82 % # we need a contact email for this customer (either because that's
83 % # policy, or because otherwise they won't receive invoices) but we
85 <TD CLASS="error"><% emt('none') %></TD>
87 <TD><% emt('no') %></TD>
89 % } # end of invoicing email
91 % if ( $cust_main->company ) {
93 <TH ALIGN="right"><% mt('Company') |h %></TH>
94 <TD COLSPAN=7><% $cust_main->company |h %></TD>
97 % } elsif ( $this eq 'ship' ) {
98 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
100 <TH ALIGN="right"><% mt('Company') |h %></TH>
101 <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
107 % if ( $location ) { # now the actual address
109 % if ( $location->locationname ) {
111 <TH ALIGN="right"><% mt('Location ID') |h %></TH>
112 <TD COLSPAN=7><% $location->locationname |h %></TD>
117 <TH ALIGN="right"><% mt('Address') |h %></TH>
118 <TD COLSPAN=7><% $location->address1 |h %></TD>
121 % if ( $location->get('address2') ) {
122 % my $address2_label = $conf->exists('cust_main-require_address2')
127 <TH ALIGN="right"><% $address2_label %></TH>
128 <TD COLSPAN=7><% $location->address2 |h %></TD>
135 <TD COLSPAN=5><% $location->city |h %>\
136 % if ( $location->county ) {
137 (<% $location->county |h %> county)\
139 <% ($location->city || $location->county) ? ', ' : ''%><% state_label( $location->state, $location->country ) |h %>
140 <% $location->zip |h %>
145 <TD><% $location->country_full |h %></TD>
148 % if ( $location->latitude && $location->longitude ) {
149 <& /elements/tr-coords.html, $location->latitude,
150 $location->longitude,
151 $cust_main->name_short,
152 $cust_main->agentnum,
155 <& /elements/tr-censustract.html, $location &>
159 % if ( $this eq 'bill' ) {
160 % # billing contact phone numbers
161 % foreach my $phone (qw(daytime night mobile)) {
162 % next if !$cust_main->get($phone);
164 <TH ALIGN="right"><% $phone_label{$phone} %></TD>
166 <& /elements/phonenumber.html,
167 $cust_main->get($phone),
169 calling_list_exempt => $cust_main->calling_list_exempt,
175 % if ( $cust_main->get('fax') ) {
178 <TH ALIGN="right"><% mt('Fax') |h %></TH>
180 <% $cust_main->get('fax') || ' ' %>
186 % if ( $conf->exists('show_stateid') ) {
189 <TH ALIGN="right"><% $stateid_label %></TH>
191 <span id="stateid_span" style="white-space:nowrap;">
192 <% $cust_main->masked('stateid') || ' ' %>
194 % $cust_main->stateid
195 % && $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')
197 <& /elements/link-replace_element_text.html, {
198 target_id => 'stateid_span',
199 replace_text => $cust_main->stateid,
200 element_type => 'span'
205 <TH ALIGN="right"><% $stateid_state_label %></TH>
206 <TD><% $cust_main->stateid_state || ' ' %></TD>
210 % } #if $this eq 'bill'
220 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
222 : FS::Msgcat::_gettext('daytime')
225 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
227 : FS::Msgcat::_gettext('night')
230 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
231 ? 'Mobile Phone'
232 : FS::Msgcat::_gettext('Mobile')
236 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
237 ? 'Driver’s License'
238 : FS::Msgcat::_gettext('stateid');
239 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
240 ? 'Driver’s License State'
241 : FS::Msgcat::_gettext('stateid_state');
246 my $cust_main = shift;
247 my $conf = new FS::Conf;
248 my @invoicing_list = $cust_main->invoicing_list_emailonly;