summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/contacts.html
blob: 12b9391a028f1a065df4c9adb10bbbab1ad2e6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
% my %which = (
%   ''      => emt('Billing'),
%   'ship_' => emt('Service'),
% );
% foreach my $which ( '', 'ship_' ) {
%   my $pre = $cust_main->get("${which}last") ? $which : '';

<FONT CLASS="fsinnerbox-title"><% $which{$which} %> <% mt('address') |h %></FONT>
<TABLE CLASS="fsinnerbox">
<TR>
  <TD ALIGN="right"><% mt('Contact name') |h %></TD>
  <TD COLSPAN=5 BGCOLOR="#ffffff">
    <% $cust_main->get("${pre}last"). ', '. $cust_main->get("${pre}first") |h %>
  </TD>
% if ( $which eq '' && $conf->exists('show_ss') ) { 
    <TD ALIGN="right"><% mt('SS#') |h %></TD>
    <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
% } 
</TR>

% if ( $conf->exists('cust-email-high-visibility') && $which eq '') {
  <TR>
    <TD ALIGN="right"><% mt('Email address(es)') |h %></TD>
    <TD BGCOLOR="#ffff00">
      <% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || $no %>
    </TD>
  </TR>
% }

% if ( $cust_main->get("${pre}company") ) {
  <TR>
    <TD ALIGN="right"><% mt('Company') |h %></TD>
    <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
  </TR>
% }

<TR>
  <TD ALIGN="right"><% mt('Address') |h %></TD>
  <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
</TR>

% if ( $cust_main->get("${pre}address2") ) { 
%   my $address2_label =
%     ( $conf->exists('cust_main-require_address2')
%       && ! ( $pre xor $cust_main->has_ship_address )
%     )
%       ? emt('Unit #')
%       : ' ';

  <TR>
    <TD ALIGN="right"><% $address2_label %></TD>
    <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD>
  </TR>

% } 

<TR>
  <TD ALIGN="right"><% mt('City') |h %></TD>
  <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD>
% if ( $cust_main->get("${pre}county") ) {
    <TD ALIGN="right"><% mt('County') |h %></TD>
    <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD>
% }
  <TD ALIGN="right"><% mt('State') |h %></TD>
  <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD>
  <TD ALIGN="right"><% mt('Zip') |h %></TD>
  <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
</TR>
<TR>
  <TD ALIGN="right"><% mt('Country') |h %></TD>
  <TD BGCOLOR="#ffffff"><% code2country( $cust_main->get("${pre}country") ) %></TD>
</TR>

% if ( $cust_main->get($pre.'latitude') && $cust_main->get($pre.'longitude') ) {
  <& /elements/tr-coords.html, $cust_main->get($pre.'latitude'),
                               $cust_main->get($pre.'longitude'),
                               $cust_main->name_short,
                               $cust_main->agentnum,
  &>
% }

% foreach my $phone (grep $cust_main->get($pre.$_), qw( daytime night mobile )){

  <TR>
    <TD ALIGN="right"><% $phone_label{$phone} %></TD>
    <TD COLSPAN=3 BGCOLOR="#ffffff">
      <& /elements/phonenumber.html,
                    $cust_main->get($pre.$phone),
                    'callable'=>1,
                    'calling_list_exempt'=>$cust_main->calling_list_exempt,
      &>
    </TD>
  </TR>

% }

% if ( $cust_main->get("${pre}fax") ) {
  <TR>
    <TD ALIGN="right"><% mt('Fax') |h %></TD>
    <TD COLSPAN=3 BGCOLOR="#ffffff">
      <% $cust_main->get("${pre}fax") || '&nbsp' %>
    </TD>
  </TR>
% }

% if ( $which eq '' && $conf->exists('show_stateid') ) { 
  <TR>
    <TD ALIGN="right"><% $stateid_label %></TD>
    <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
    <TD ALIGN="right"><% $stateid_state_label %></TD>
    <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
  </TR>
% } 

</TABLE>
% if ( $which ne 'ship_' ) {
<BR>
% }
% } 
<%once>

my %phone_label = (

  'daytime' => ( FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
                   ? 'Day&nbsp;Phone'
                   : FS::Msgcat::_gettext('daytime')
               ),

  'night'   => ( FS::Msgcat::_gettext('night') =~ /^(night)?$/
                   ? 'Night&nbsp;Phone'
                   : FS::Msgcat::_gettext('night')
               ),

  'mobile'  => ( FS::Msgcat::_gettext('mobile') =~ /^(mobile)?$/
                   ? 'Mobile&nbsp;Phone'
                   : FS::Msgcat::_gettext('Mobile')
               ),
);

my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
                      ? 'Driver&rsquo;s&nbsp;License'
                      : FS::Msgcat::_gettext('stateid');
my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
                      ? 'Driver&rsquo;s&nbsp;License State'
                      : FS::Msgcat::_gettext('stateid_state');

</%once>
<%init>

my( $cust_main ) = @_;
my $conf = new FS::Conf;
my @invoicing_list = $cust_main->invoicing_list;
my $no = emt('no');

</%init>