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>
32 <TD><% $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 <TH ALIGN="right"><% mt('Spouse') |h %></TH>
42 <% join(', ', grep $_,
43 $cust_main->spouse_last, $cust_main->spouse_first) %>
49 % if ( scalar(@invoicing_list) == 1 ) { # typical individual user; show here
51 <TH ALIGN="right"><% mt('Email address') |h %></TH>
53 <% $invoicing_list[0] %>
56 % } elsif ( scalar(@invoicing_list) > 1 ) {
57 % # business customer with a contact list
60 % } else { # there is no invoice email for them
62 <TH ALIGN="right"><% mt('Email address') |h %></TH>
63 % if ( !$cust_main->postal_invoice or
64 % $conf->exists('cust_main-require_invoicing_list_email',
65 % $cust_main->agentnum)
67 % # we need a contact email for this customer (either because that's
68 % # policy, or because otherwise they won't receive invoices) but we
70 <TD CLASS="error"><% emt('none') %></TD>
72 <TD><% emt('no') %></TD>
74 % } # end of invoicing email
76 % if ( $cust_main->company ) {
78 <TH ALIGN="right"><% mt('Company') |h %></TH>
79 <TD COLSPAN=7><% $cust_main->company |h %></TD>
82 % } elsif ( $this eq 'ship' ) {
83 % if ( $cust_main->ship_company ) { # mostly obsolete these days...
85 <TH ALIGN="right"><% mt('Company') |h %></TH>
86 <TD COLSPAN=7><% $cust_main->ship_company |h %></TD>
92 % if ( $location ) { # now the actual address
94 % if ( $location->locationname ) {
96 <TH ALIGN="right"><% mt('Location ID') |h %></TH>
97 <TD COLSPAN=7><% $location->locationname |h %></TD>
102 <TH ALIGN="right"><% mt('Address') |h %></TH>
103 <TD COLSPAN=7><% $location->address1 |h %></TD>
106 % if ( $location->get('address2') ) {
107 % my $address2_label = $conf->exists('cust_main-require_address2')
112 <TH ALIGN="right"><% $address2_label %></TH>
113 <TD COLSPAN=7><% $location->address2 |h %></TD>
120 <TD COLSPAN=5><% $location->city |h %>\
121 % if ( $location->county ) {
122 (<% $location->county |h %> county)\
124 <% ($location->city || $location->county) ? ', ' : ''%><% state_label( $location->state, $location->country ) |h %>
125 <% $location->zip |h %>
130 <TD><% $location->country_full |h %></TD>
133 % if ( $location->latitude && $location->longitude ) {
134 <& /elements/tr-coords.html, $location->latitude,
135 $location->longitude,
136 $cust_main->name_short,
137 $cust_main->agentnum,
140 <& /elements/tr-censustract.html, $location &>
144 % if ( $this eq 'bill' ) {
145 % # billing contact phone numbers
146 % foreach my $phone (qw(daytime night mobile)) {
147 % next if !$cust_main->get($phone);
149 <TH ALIGN="right"><% $phone_label{$phone} %></TD>
151 <& /elements/phonenumber.html,
152 $cust_main->get($phone),
154 calling_list_exempt => $cust_main->calling_list_exempt,
160 % if ( $cust_main->get('fax') ) {
163 <TH ALIGN="right"><% mt('Fax') |h %></TH>
165 <% $cust_main->get('fax') || ' ' %>
171 % if ( $conf->exists('show_stateid') ) {
174 <TH ALIGN="right"><% $stateid_label %></TH>
175 <TD><% $cust_main->masked('stateid') || ' ' %></TD>
176 <TH ALIGN="right"><% $stateid_state_label %></TH>
177 <TD><% $cust_main->stateid_state || ' ' %></TD>
181 % } #if $this eq 'bill'
191 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
193 : FS::Msgcat::_gettext('daytime')
196 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
198 : FS::Msgcat::_gettext('night')
201 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
202 ? 'Mobile Phone'
203 : FS::Msgcat::_gettext('Mobile')
207 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
208 ? 'Driver’s License'
209 : FS::Msgcat::_gettext('stateid');
210 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
211 ? 'Driver’s License State'
212 : FS::Msgcat::_gettext('stateid_state');
217 my $cust_main = shift;
218 my $conf = new FS::Conf;
219 my @invoicing_list = $cust_main->invoicing_list_emailonly;