option to keep an email address but not email it invoices, RT#17676
[freeside.git] / httemplate / view / cust_main / contacts.html
1 % my %which = (
2 %   ''      => emt('Billing'),
3 %   'ship_' => emt('Service'),
4 % );
5 % foreach my $which ( '', 'ship_' ) {
6 %   my $pre = $cust_main->get("${which}last") ? $which : '';
7
8 <FONT CLASS="fsinnerbox-title"><% $which{$which} %> <% mt('address') |h %></FONT>
9 <TABLE CLASS="fsinnerbox">
10 <TR>
11   <TD ALIGN="right"><% mt('Contact name') |h %></TD>
12   <TD COLSPAN=5 BGCOLOR="#ffffff">
13     <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %>
14   </TD>
15 % if ( $which eq '' && $conf->exists('show_ss') ) { 
16     <TD ALIGN="right"><% mt('SS#') |h %></TD>
17     <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
18 % } 
19 </TR>
20
21 % if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
22   <TR>
23     <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
24     <TD BGCOLOR="#ffff00">
25       <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
26     </TD>
27   </TR>
28 % }
29
30 % if ( $cust_main->get("${pre}company") ) {
31   <TR>
32     <TD ALIGN="right"><% mt('Company') |h %></TD>
33     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
34   </TR>
35 % }
36
37 <TR>
38   <TD ALIGN="right"><% mt('Address') |h %></TD>
39   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
40 </TR>
41
42 % if ( $cust_main->get("${pre}address2") ) { 
43 %   my $address2_label =
44 %     ( $conf->exists('cust_main-require_address2')
45 %       && ! ( $pre xor $cust_main->has_ship_address )
46 %     )
47 %       ? emt('Unit #')
48 %       : ' ';
49
50   <TR>
51     <TD ALIGN="right"><% $address2_label %></TD>
52     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD>
53   </TR>
54
55 % } 
56
57 <TR>
58   <TD ALIGN="right"><% mt('City') |h %></TD>
59   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD>
60 % if ( $cust_main->get("${pre}county") ) {
61     <TD ALIGN="right"><% mt('County') |h %></TD>
62     <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD>
63 % }
64   <TD ALIGN="right"><% mt('State') |h %></TD>
65   <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD>
66   <TD ALIGN="right"><% mt('Zip') |h %></TD>
67   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
68 </TR>
69 <TR>
70   <TD ALIGN="right"><% mt('Country') |h %></TD>
71   <TD BGCOLOR="#ffffff"><% code2country( $cust_main->get("${pre}country") ) %></TD>
72 </TR>
73
74 % if ( $cust_main->get($pre.'latitude') && $cust_main->get($pre.'longitude') ) {
75   <& /elements/tr-coords.html, $cust_main->get($pre.'latitude'),
76                                $cust_main->get($pre.'longitude'),
77                                $cust_main->name_short,
78                                $cust_main->agentnum,
79   &>
80 % }
81
82 % foreach my $phone (grep $cust_main->get($pre.$_), qw( daytime night mobile )){
83
84   <TR>
85     <TD ALIGN="right"><% $phone_label{$phone} %></TD>
86     <TD COLSPAN=3 BGCOLOR="#ffffff">
87       <& /elements/phonenumber.html,
88                     $cust_main->get($pre.$phone),
89                     'callable'=>1,
90                     'calling_list_exempt'=>$cust_main->calling_list_exempt,
91       &>
92     </TD>
93   </TR>
94
95 % }
96
97 % if ( $cust_main->get("${pre}fax") ) {
98   <TR>
99     <TD ALIGN="right"><% mt('Fax') |h %></TD>
100     <TD COLSPAN=3 BGCOLOR="#ffffff">
101       <% $cust_main->get("${pre}fax") || '&nbsp' %>
102     </TD>
103   </TR>
104 % }
105
106 % if ( $which eq '' && $conf->exists('show_stateid') ) { 
107   <TR>
108     <TD ALIGN="right"><% $stateid_label %></TD>
109     <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
110     <TD ALIGN="right"><% $stateid_state_label %></TD>
111     <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
112   </TR>
113 % } 
114
115 </TABLE>
116 % if ( $which ne 'ship_' ) {
117 <BR>
118 % }
119 % } 
120 <%once>
121
122 my %phone_label = (
123
124   'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
125                    ? 'Day&nbsp;Phone'
126                    : FS::Msgcat::_gettext('daytime')
127                ),
128
129   'night'   => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
130                    ? 'Night&nbsp;Phone'
131                    : FS::Msgcat::_gettext('night')
132                ),
133
134   'mobile'  => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
135                    ? 'Mobile&nbsp;Phone'
136                    : FS::Msgcat::_gettext('Mobile')
137                ),
138 );
139
140 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
141                       ? 'Driver&rsquo;s&nbsp;License'
142                       : FS::Msgcat::_gettext('stateid');
143 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
144                       ? 'Driver&rsquo;s&nbsp;License State'
145                       : FS::Msgcat::_gettext('stateid_state');
146
147 </%once>
148 <%init>
149
150 my( $cust_main ) = @_;
151 my $conf = new FS::Conf;
152 my @invoicing_list = $cust_main->invoicing_list;
153 my $no = emt('no');
154
155 </%init>
156