This commit was manufactured by cvs2svn to create branch
[freeside.git] / httemplate / view / cust_main / contacts.html
1 % my %which = (
2 %   ''      => 'Billing',
3 %   'ship_' => 'Service',
4 % );
5 % foreach my $which ( '', 'ship_' ) {
6 %   my $pre = $cust_main->get("${which}last") ? $which : '';
7
8 <% $which{$which} %> address
9 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
10 <TR>
11   <TD ALIGN="right">Contact name</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">SS#</TD>
17     <TD BGCOLOR="#ffffff"><% $cust_main->masked('ss') || '&nbsp' %></TD>
18 % } 
19 </TR>
20 <TR>
21   <TD ALIGN="right">Company</TD>
22   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}company") |h %></TD>
23 </TR>
24 <TR>
25   <TD ALIGN="right">Address</TD>
26   <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address1") |h %></TD>
27 </TR>
28
29 % if ( $cust_main->get("${pre}address2") ) { 
30 %   my $address2_label =
31 %     ( $conf->exists('cust_main-require_address2')
32 %       && ! ( $pre xor $cust_main->has_ship_address )
33 %     )
34 %       ? 'Unit&nbsp;#'
35 %       : '&nbsp;';
36
37   <TR>
38     <TD ALIGN="right"><% $address2_label %></TD>
39     <TD COLSPAN=7 BGCOLOR="#ffffff"><% $cust_main->get("${pre}address2") |h %></TD>
40   </TR>
41
42 % } 
43
44 <TR>
45   <TD ALIGN="right">City</TD>
46   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}city") |h %></TD>
47 % if ( $cust_main->get("${pre}county") ) {
48     <TD ALIGN="right">County</TD>
49     <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}county") |h %></TD>
50 % }
51   <TD ALIGN="right">State</TD>
52   <TD BGCOLOR="#ffffff"><% state_label( $cust_main->get("${pre}state"), $cust_main->get("${pre}country") ) |h %></TD>
53   <TD ALIGN="right">Zip</TD>
54   <TD BGCOLOR="#ffffff"><% $cust_main->get("${pre}zip") %></TD>
55 </TR>
56 <TR>
57   <TD ALIGN="right">Country</TD>
58   <TD BGCOLOR="#ffffff"><% code2country( $cust_main->get("${pre}country") ) %></TD>
59 </TR>
60 <TR>
61   <TD ALIGN="right"><% $daytime_label %></TD>
62   <TD COLSPAN=3 BGCOLOR="#ffffff">
63     <% include('/elements/phonenumber.html',
64                   $cust_main->get("${pre}daytime"),
65                   'callable'=>1
66                )
67     %>
68   </TD>
69 </TR>
70 <TR>
71   <TD ALIGN="right"><% $night_label %></TD>
72   <TD COLSPAN=3 BGCOLOR="#ffffff">
73     <% include('/elements/phonenumber.html',
74                   $cust_main->get("${pre}night"),
75                   'callable'=>1
76                )
77     %>
78   </TD>
79 </TR>
80 <TR>
81   <TD ALIGN="right">Fax</TD>
82   <TD COLSPAN=3 BGCOLOR="#ffffff">
83     <% $cust_main->get("${pre}fax") || '&nbsp' %>
84   </TD>
85 </TR>
86 % if ( $which eq '' && $conf->exists('show_stateid') ) { 
87   <TR>
88     <TD ALIGN="right"><% $stateid_label %></TD>
89     <TD BGCOLOR="#ffffff"><% $cust_main->masked('stateid') || '&nbsp' %></TD>
90     <TD ALIGN="right"><% $stateid_state_label %></TD>
91     <TD BGCOLOR="#ffffff"><% $cust_main->stateid_state || '&nbsp' %></TD>
92   </TR>
93 % } 
94 </TABLE></TD></TR></TABLE>
95 % if ( $which ne 'ship_' ) {
96 <BR>
97 % }
98 % } 
99
100 <%once>
101
102 my $daytime_label = FS::Msgcat::_gettext('daytime') =~ /^(daytime)?$/
103                       ? 'Day&nbsp;Phone'
104                       : FS::Msgcat::_gettext('daytime');
105 my $night_label = FS::Msgcat::_gettext('night') =~ /^(night)?$/
106                       ? 'Night&nbsp;Phone'
107                       : FS::Msgcat::_gettext('night');
108 my $stateid_label = FS::Msgcat::_gettext('stateid') =~ /^(stateid)?$/
109                       ? 'Driver&rsquo;s&nbsp;License'
110                       : FS::Msgcat::_gettext('stateid');
111 my $stateid_state_label = FS::Msgcat::_gettext('stateid_state') =~ /^(stateid_state)?$/
112                       ? 'Driver&rsquo;s&nbsp;License State'
113                       : FS::Msgcat::_gettext('stateid_state');
114
115 </%once>
116 <%init>
117
118 my( $cust_main ) = @_;
119 my $conf = new FS::Conf;
120
121 </%init>
122