1 % my %addr_label = ('bill' => 'Billing address', 'ship' => 'Service address');
3 %# Locations (possibly break this out)
4 % my @which = ('bill');
5 % push @which, 'ship' if $cust_main->has_ship_address;
7 % my $this = shift @which;
8 % my $method = $this.'_location';
9 % my $location = $cust_main->$method;
10 <FONT CLASS="fsinnerbox-title"><% mt( $addr_label{$this} ) |h %></FONT>
11 <TABLE CLASS="fsinnerbox">
13 % if ( $this eq 'bill' ) {
14 % #billing contact fields
16 <TD ALIGN="right"><% mt('Contact name') |h %></TD>
17 <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->contact |h %></TD>
18 % if ( $conf->exists('show_ss') ) {
19 <TD ALIGN="right"><% mt('SS#') |h %></TD>
20 <TD BGCOLOR="#ffffff"><% $conf->exists('unmask_ss')
22 : $cust_main->masked('ss') || ' ' %></TD>
25 % if ( $conf->exists('cust-email-high-visibility') ) {
27 <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
28 <TD BGCOLOR="#ffff00">
29 <% $cust_main->invoicing_list_emailonly_scalar || $no %>
33 % if ( $cust_main->company ) {
35 <TD ALIGN="right"><% mt('Company') |h %></TD>
36 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->company |h %></TD>
39 % } # if $this eq 'bill'
40 % # now the actual address
42 <TD ALIGN="right"><% mt('Address') |h %></TD>
43 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address1 |h %></TD>
46 % if ( $location->get('address2') ) {
47 % my $address2_label = $conf->exists('cust_main-require_address2')
52 <TD ALIGN="right"><% $address2_label %></TD>
53 <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address2 |h %></TD>
59 <TD ALIGN="right"><% mt('City') |h %></TD>
60 <TD BGCOLOR="#ffffff"><% $location->city |h %></TD>
61 % if ( $location->county ) {
62 <TD ALIGN="right"><% mt('County') |h %></TD>
63 <TD BGCOLOR="#ffffff"><% $location->county |h %></TD>
65 <TD ALIGN="right"><% mt('State') |h %></TD>
66 <TD BGCOLOR="#ffffff"><% state_label( $location->state, $location->country ) |h %></TD>
67 <TD ALIGN="right"><% mt('Zip') |h %></TD>
68 <TD BGCOLOR="#ffffff"><% $location->zip %></TD>
71 <TD ALIGN="right"><% mt('Country') |h %></TD>
72 <TD BGCOLOR="#ffffff"><% code2country( $location->country ) %></TD>
75 % if ( $location->latitude && $location->longitude ) {
76 <& /elements/tr-coords.html, $location->latitude,
78 $cust_main->name_short,
83 % if ( $this eq 'bill' ) {
84 % # billing contact phone numbers
85 % foreach my $phone (qw(daytime night mobile)) {
86 % next if !$cust_main->get($phone);
88 <TD ALIGN="right"><% $phone_label{$phone} %></TD>
89 <TD COLSPAN=3 BGCOLOR="#ffffff">
90 <& /elements/phonenumber.html,
91 $cust_main->get($phone),
93 calling_list_exempt => $cust_main->calling_list_exempt,
99 % if ( $cust_main->get('fax') ) {
102 <TD ALIGN="right"><% mt('Fax') |h %></TD>
103 <TD COLSPAN=3 BGCOLOR="#ffffff">
104 <% $cust_main->get('fax') || ' ' %>
110 % if ( $conf->exists('show_stateid') ) {
113 <TD ALIGN="right"><% $stateid_label %></TD>
114 <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || ' ' %></TD>
115 <TD ALIGN="right"><% $stateid_state_label %></TD>
116 <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || ' ' %></TD>
120 % } #if $this eq 'bill'
130 'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
132 : FS::Msgcat::_gettext('daytime')
135 'night' => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
137 : FS::Msgcat::_gettext('night')
140 'mobile' => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
141 ? 'Mobile Phone'
142 : FS::Msgcat::_gettext('Mobile')
146 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
147 ? 'Driver’s License'
148 : FS::Msgcat::_gettext('stateid');
149 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
150 ? 'Driver’s License State'
151 : FS::Msgcat::_gettext('stateid_state');
156 my $cust_main = shift;
157 my $conf = new FS::Conf;
158 my @invoicing_list = $cust_main->invoicing_list;