show census tracts for all customer and package locations, #25726
[freeside.git] / httemplate / view / cust_main / contacts.html
1 % my %addr_label = ('bill' => 'Billing address', 'ship' => 'Service address');
2
3 %# Locations (possibly break this out)
4 % my @which = ('bill', 'ship');
5 % while (@which) {
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 )
12 %   {
13  (<% mt('same as billing') %>)
14 %   }
15 </FONT>
16 <TABLE CLASS="fsinnerbox">
17
18 % if ( $this eq 'bill' ) {
19 %   #billing contact fields
20   <TR>
21     <TD ALIGN="right"><% mt('Contact name') |h %></TD>
22     <TD COLSPAN=5 BGCOLOR="#ffffff"><% $cust_main->contact |h %></TD>
23 %   if ( $conf->exists('show_ss') ) {
24     <TD ALIGN="right"><% mt('SS#') |h %></TD>
25     <TD BGCOLOR="#ffffff"><% $conf->exists('unmask_ss')
26                               ? $cust_main->ss
27                               : $cust_main->masked('ss') || '&nbsp;' %></TD>
28 %   }
29   </TR>
30 %   if ( $conf->exists('cust-email-high-visibility') ) {
31   <TR>
32     <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
33     <TD BGCOLOR="#ffff00">
34       <% $cust_main->invoicing_list_emailonly_scalar || $no %>
35     </TD>
36   </TR>
37 %   }
38 %   if ( $cust_main->company ) {
39   <TR>
40     <TD ALIGN="right"><% mt('Company') |h %></TD>
41     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->company |h %></TD>
42   </TR>
43 %   }
44 % } # if $this eq 'bill'
45 % # now the actual address
46 <TR>
47   <TD ALIGN="right"><% mt('Address') |h %></TD>
48   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address1 |h %></TD>
49 </TR>
50
51 % if ( $location->get('address2') ) {
52 %   my $address2_label = $conf->exists('cust_main-require_address2') 
53 %                        ? emt('Unit #')
54 %                        : ' ';
55
56 <TR>
57   <TD ALIGN="right"><% $address2_label %></TD>
58   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $location->address2 |h %></TD>
59 </TR>
60
61 % } 
62
63 <TR>
64   <TD ALIGN="right"><% mt('City') |h %></TD>
65   <TD BGCOLOR="#ffffff"><% $location->city |h %></TD>
66 % if ( $location->county ) {
67     <TD ALIGN="right"><% mt('County') |h %></TD>
68     <TD BGCOLOR="#ffffff"><% $location->county |h %></TD>
69 % }
70   <TD ALIGN="right"><% mt('State') |h %></TD>
71   <TD BGCOLOR="#ffffff"><% state_label( $location->state, $location->country ) |h %></TD>
72   <TD ALIGN="right"><% mt('Zip') |h %></TD>
73   <TD BGCOLOR="#ffffff"><% $location->zip %></TD>
74 </TR>
75 <TR>
76   <TD ALIGN="right"><% mt('Country') |h %></TD>
77   <TD BGCOLOR="#ffffff"><% code2country( $location->country ) %></TD>
78 </TR>
79
80 % if ( $location->latitude && $location->longitude ) {
81   <& /elements/tr-coords.html, $location->latitude,
82                                $location->longitude,
83                                $cust_main->name_short,
84                                $cust_main->agentnum,
85   &>
86 % }
87 <& /elements/tr-censustract.html, $location &>
88   
89 % if ( $this eq 'bill' ) {
90 %   # billing contact phone numbers
91 %   foreach my $phone (qw(daytime night mobile)) {
92 %     next if !$cust_main->get($phone);
93 <TR>
94   <TD ALIGN="right"><% $phone_label{$phone} %></TD>
95   <TD COLSPAN=3 BGCOLOR="#ffffff">
96     <& /elements/phonenumber.html,
97         $cust_main->get($phone),
98         callable => 1,
99         calling_list_exempt => $cust_main->calling_list_exempt,
100     &>
101   </TD>
102 </TR>
103
104 %   } #foreach $phone
105 %   if ( $cust_main->get('fax') ) {
106
107   <TR>
108     <TD ALIGN="right"><% mt('Fax') |h %></TD>
109     <TD COLSPAN=3 BGCOLOR="#ffffff">
110       <% $cust_main->get('fax') || '&nbsp;' %>
111     </TD>
112   </TR>
113
114 %   }
115 %
116 %   if ( $conf->exists('show_stateid') ) { 
117
118 <TR>
119     <TD ALIGN="right"><% $stateid_label %></TD>
120     <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
121     <TD ALIGN="right"><% $stateid_state_label %></TD>
122     <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
123   </TR>
124
125 %   }
126 % } #if $this eq 'bill'
127 </TABLE>
128 % if ( @which ) {
129 <BR>
130 % }
131 % } #while @which
132 <%once>
133
134 my %phone_label = (
135
136   'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
137                    ? 'Day&nbsp;Phone'
138                    : FS::Msgcat::_gettext('daytime')
139                ),
140
141   'night'   => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
142                    ? 'Night&nbsp;Phone'
143                    : FS::Msgcat::_gettext('night')
144                ),
145
146   'mobile'  => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
147                    ? 'Mobile&nbsp;Phone'
148                    : FS::Msgcat::_gettext('Mobile')
149                ),
150 );
151
152 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
153                       ? 'Driver&rsquo;s&nbsp;License'
154                       : FS::Msgcat::_gettext('stateid');
155 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
156                       ? 'Driver&rsquo;s&nbsp;License State'
157                       : FS::Msgcat::_gettext('stateid_state');
158
159 </%once>
160 <%init>
161
162 my $cust_main = shift;
163 my $conf = new FS::Conf;
164 my @invoicing_list = $cust_main->invoicing_list;
165 my $no = emt('no');
166
167 </%init>
168