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') || ' ' %>
37 % if ( !$conf->exists('unmask_ss') && $FS::CurrentUser::CurrentUser->access_right('Unmask customer SSN')) {
38 <& /elements/link-replace_element_text.html, {
39 target_id => 'ss_span',
40 replace_text => $cust_main->ss,
41 element_type => 'span'
48 % if ( $conf->exists('cust_main-enable_spouse') and
49 % ($cust_main->spouse_last or $cust_main->spouse_first) ) {
51 <TH ALIGN="right"><% mt('Spouse') |h %></TH>
53 <% join(', ', grep $_,
54 $cust_main->spouse_last, $cust_main->spouse_first) %>
60 % if ( scalar(@invoicing_list) == 1 ) { # typical individual user; show here
62 <TH ALIGN="right"><% mt('Email address') |h %></TH>
64 <% $invoicing_list[0] %>
67 % } elsif ( scalar(@invoicing_list) > 1 ) {
68 % # business customer with a contact list
71 % } else { # there is no invoice email for them
73 <TH ALIGN="right"><% mt('Email address') |h %></TH>
74 % if ( !$cust_main->postal_invoice or
75 % $conf->exists('cust_main-require_invoicing_list_email',
76 % $cust_main->agentnum)
78 % # we need a contact email for this customer (either because that's
79 % # policy, or because otherwise they won't receive invoices) but we
81 <TD CLASS="error"><% emt('none') %></TD>
83 <TD><% emt('no') %></TD>
85 % } # end of invoicing email
87 % if ( $cust_main->company ) {
89 <TH ALIGN="right"><% mt('Company') |h %></TH>
90 <TD COLSPAN=7><% $cust_main->company |h %></TD>
93 % } elsif ( $this eq 'ship' ) {
94 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
96 <TH ALIGN="right"><% mt('Company') |h %></TH>
97 <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
103 % if ( $location ) { # now the actual address
105 % if ( $location->locationname ) {
107 <TH ALIGN="right"><% mt('Location ID') |h %></TH>
108 <TD COLSPAN=7><% $location->locationname |h %></TD>
113 <TH ALIGN="right"><% mt('Address') |h %></TH>
114 <TD COLSPAN=7><% $location->address1 |h %></TD>
117 % if ( $location->get('address2') ) {
118 % my $address2_label = $conf->exists('cust_main-require_address2')
123 <TH ALIGN="right"><% $address2_label %></TH>
124 <TD COLSPAN=7><% $location->address2 |h %></TD>
131 <TD COLSPAN=5><% $location->city |h %>\
132 % if ( $location->county ) {
133 (<% $location->county |h %> county)\
135 <% ($location->city || $location->county) ? ', ' : ''%><% state_label( $location->state, $location->country ) |h %>
136 <% $location->zip |h %>
141 <TD><% $location->country_full |h %></TD>
144 % if ( $location->latitude && $location->longitude ) {
145 <& /elements/tr-coords.html, $location->latitude,
146 $location->longitude,
147 $cust_main->name_short,
148 $cust_main->agentnum,
151 <& /elements/tr-censustract.html, $location &>
155 % if ( $this eq 'bill' ) {
156 % # billing contact phone numbers
157 % foreach my $phone (qw(daytime night mobile)) {
158 % next if !$cust_main->get($phone);
160 <TH ALIGN="right"><% $phone_label{$phone} %></TD>
162 <& /elements/phonenumber.html,
163 $cust_main->get($phone),
165 calling_list_exempt => $cust_main->calling_list_exempt,
171 % if ( $cust_main->get('fax') ) {
174 <TH ALIGN="right"><% mt('Fax') |h %></TH>
176 <% $cust_main->get('fax') || ' ' %>
182 % if ( $conf->exists('show_stateid') ) {
185 <TH ALIGN="right"><% $stateid_label %></TH>
187 <span id="stateid_span" style="white-space:nowrap;">
188 <% $cust_main->masked('stateid') || ' ' %>
189 % if ( $FS::CurrentUser::CurrentUser->access_right('Unmask customer DL')) {
190 <& /elements/link-replace_element_text.html, {
191 target_id => 'stateid_span',
192 replace_text => $cust_main->stateid,
193 element_type => 'span'
198 <TH ALIGN="right"><% $stateid_state_label %></TH>
199 <TD><% $cust_main->stateid_state || ' ' %></TD>
203 % } #if $this eq 'bill'
213 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
215 : FS::Msgcat::_gettext('daytime')
218 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
220 : FS::Msgcat::_gettext('night')
223 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
224 ? 'Mobile Phone'
225 : FS::Msgcat::_gettext('Mobile')
229 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
230 ? 'Driver’s License'
231 : FS::Msgcat::_gettext('stateid');
232 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
233 ? 'Driver’s License State'
234 : FS::Msgcat::_gettext('stateid_state');
239 my $cust_main = shift;
240 my $conf = new FS::Conf;
241 my @invoicing_list = $cust_main->invoicing_list_emailonly;