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 <TD ALIGN="right"><% mt('City') |h %></TD>
97 <TD BGCOLOR="#ffffff"><% $location->city |h %></TD>
98 % if ( $location->county ) {
99 <TD ALIGN="right"><% mt('County') |h %></TD>
100 <TD BGCOLOR="#ffffff"><% $location->county |h %></TD>
102 <TD ALIGN="right"><% mt('State') |h %></TD>
103 <TD BGCOLOR="#ffffff"><% state_label( $location->state, $location->country ) |h %></TD>
104 <TD ALIGN="right"><% mt('Zip') |h %></TD>
105 <TD BGCOLOR="#ffffff"><% $location->zip %></TD>
108 <TD ALIGN="right"><% mt('Country') |h %></TD>
109 <TD BGCOLOR="#ffffff"><% code2country( $location->country ) %></TD>
112 % if ( $location->latitude && $location->longitude ) {
113 <& /elements/tr-coords.html, $location->latitude,
114 $location->longitude,
115 $cust_main->name_short,
116 $cust_main->agentnum,
119 <& /elements/tr-censustract.html, $location &>
121 % if ( $this eq 'bill' ) {
122 % # billing contact phone numbers
123 % foreach my $phone (qw(daytime night mobile)) {
124 % next if !$cust_main->get($phone);
126 <TD ALIGN="right"><% $phone_label{$phone} %></TD>
127 <TD COLSPAN=3 BGCOLOR="#ffffff">
128 <& /elements/phonenumber.html,
129 $cust_main->get($phone),
131 calling_list_exempt => $cust_main->calling_list_exempt,
137 % if ( $cust_main->get('fax') ) {
140 <TD ALIGN="right"><% mt('Fax') |h %></TD>
141 <TD COLSPAN=3 BGCOLOR="#ffffff">
142 <% $cust_main->get('fax') || ' ' %>
148 % if ( $conf->exists('show_stateid') ) {
151 <TD ALIGN="right"><% $stateid_label %></TD>
152 <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || ' ' %></TD>
153 <TD ALIGN="right"><% $stateid_state_label %></TD>
154 <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || ' ' %></TD>
158 % } #if $this eq 'bill'
168 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
170 : FS::Msgcat::_gettext('daytime')
173 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
175 : FS::Msgcat::_gettext('night')
178 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
179 ? 'Mobile Phone'
180 : FS::Msgcat::_gettext('Mobile')
184 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
185 ? 'Driver’s License'
186 : FS::Msgcat::_gettext('stateid');
187 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
188 ? 'Driver’s License State'
189 : FS::Msgcat::_gettext('stateid_state');
194 my $cust_main = shift;
195 my $conf = new FS::Conf;
196 my @invoicing_list = $cust_main->invoicing_list;