invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / elements / header-cust_main.html
1 <%doc>
2
3 Examples:
4
5   <& /elements/header-cust_main.html,
6        view      => 'basics', #required
7        cust_main => $cust_main, # cust_main or custnum is required
8        custnum   => $custnum,   #
9   &>
10
11 </%doc>
12 <& /elements/header.html, {
13              'title'          => $title,
14              'title_noescape' => $title_noescape,
15              #'nobr'           => 1,
16              'etc'            => $opt{'etc'},
17           }
18 &>
19
20 % my @part_tag = $cust_main->part_tag;
21 % if ( $conf->config('cust_tag-location') eq 'top' && @part_tag ) {
22 <TABLE STYLE="margin-bottom:8px" CELLSPACING=2>
23 %   foreach my $part_tag ( @part_tag ) {
24 <TR>
25   <TD>
26       <FONT SIZE="+1"
27             <% length($part_tag->tagcolor)
28                  ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"'
29                  : ''
30       %>><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT>
31   </TD>
32 </TR>
33 %   }
34 </TABLE>
35 % }
36 <& /view/cust_main/menu.html, cust_main => $cust_main, show => $opt{'view'} &>
37 <BR>
38
39 <DIV CLASS="fstabcontainer">
40
41 <& /elements/init_overlib.html &>
42
43 <SCRIPT TYPE="text/javascript">
44 function areyousure(href, message) {
45   if (confirm(message) == true)
46     window.location.href = href;
47 }
48 function areyousure_popup(message, action, actionlabel) {
49   if (confirm(message) == true) {
50 <% include('/elements/popup_link_onclick.html',
51      'js_action' => 'action',
52      'js_actionlabel' => 'actionlabel',
53    ) %>
54   }
55 }
56 </SCRIPT>
57
58 <%init>
59
60 my $curuser = $FS::CurrentUser::CurrentUser;
61
62 my $conf = new FS::Conf;
63
64 my %opt = @_;
65
66 my $cust_main = $opt{'cust_main'} || qsearchs( {
67   'table'     => 'cust_main',
68   'hashref'   => { 'custnum' => $opt{'custnum'} },
69   'extra_sql' => ' AND '. $curuser->agentnums_sql,
70 });
71 die "Customer not found!" unless $cust_main;
72
73 my $title = mt("Customer").' #'. $cust_main->display_custnum. ': ';
74 my $title_noescape = $title. encode_entities($cust_main->name);
75 $title .= $cust_main->name;
76
77 if ( $curuser->num_agents ) {
78   $title_noescape =
79     encode_entities($cust_main->agent->agent). " $title_noescape";
80   $title = $cust_main->agent->agent. " $title";
81 }
82
83 my $status = $cust_main->status_label;
84 $status .= ' (Cancelled)' if $cust_main->is_status_delay_cancel;
85 $title_noescape .= ' (<B><FONT COLOR="#'. $cust_main->statuscolor. '">'. $status.  '</FONT></B>)';
86 $title .= " ($status)";
87
88 </%init>