5 <& /elements/header-cust_main.html,
6 view => 'basics', #required
7 cust_main => $cust_main, # cust_main or custnum is required
12 <& /elements/header.html, {
14 'title_noescape' => $title_noescape,
17 include_selectize => $opt{include_selectize} ? 1 : 0,
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 ) {
27 <% length($part_tag->tagcolor)
28 ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"'
30 %>><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT>
36 % if ( scalar @cust_locations_missing_district ) {
37 <div style="margin: 0 1em; padding: 1em; border: solid 1px #999; background-color: #fee;">
38 <h4 style="margin: 0; border-bottom: solid 1px #aaa; color: red;">Customer will not be billed:</h4>
39 <p style="margin: .5em;">
40 The following customer locations are missing tax districts for Washington State.<br>
41 Sales taxes cannot be calculated for this customer.<br>
42 Correct the address information, or enter a tax district number.
44 % for my $cust_location ( @cust_locations_missing_district ) {
46 (<a href="#" onclick="overlib_edit_location(<% $cust_location->locationnum %>);">
49 <% $cust_location->address1 %>
50 <% $cust_location->city %>
51 <% $cust_location->state %>
52 <% $cust_location->zip %>
53 (<% $cust_location->locationnum %>)
55 % } # /for my $cust_location
59 function overlib_edit_location(locationnum) {
62 '<% $fsurl %>edit/cust_location.cgi?locationnum=' + locationnum,
64 'popup-1548013977-3901-3256727185.50958',
68 CAPTION, 'Edit location',
86 % } # /if @cust_locations_missing_district
87 <& /view/cust_main/menu.html, cust_main => $cust_main, show => $opt{'view'} &>
90 <DIV CLASS="fstabcontainer">
92 <& /elements/init_overlib.html &>
94 <SCRIPT TYPE="text/javascript">
95 function areyousure(href, message) {
96 if (confirm(message) == true)
97 window.location.href = href;
99 function areyousure_popup(message, action, actionlabel) {
100 if (confirm(message) == true) {
101 <% include('/elements/popup_link_onclick.html',
102 'js_action' => 'action',
103 'js_actionlabel' => 'actionlabel',
111 my $curuser = $FS::CurrentUser::CurrentUser;
113 my $conf = new FS::Conf;
117 my $cust_main = $opt{'cust_main'} || qsearchs( {
118 'table' => 'cust_main',
119 'hashref' => { 'custnum' => $opt{'custnum'} },
120 'extra_sql' => ' AND '. $curuser->agentnums_sql,
122 die "Customer not found!" unless $cust_main;
124 my $title = mt("Customer").' #'. $cust_main->display_custnum. ': ';
125 my $title_noescape = $title. encode_entities($cust_main->name);
126 $title .= $cust_main->name;
128 if ( $curuser->num_agents ) {
130 encode_entities($cust_main->agent->agent). " $title_noescape";
131 $title = $cust_main->agent->agent. " $title";
134 my $status = $cust_main->status_label;
135 $status .= ' (Cancelled)' if $cust_main->is_status_delay_cancel;
136 $title_noescape .= ' (<B><FONT COLOR="#'. $cust_main->statuscolor. '">'. $status. '</FONT></B>)';
137 $title .= " ($status)";
139 my @cust_locations_missing_district;
140 my $tax_district_method = $conf->config('tax_district_method');
141 if ( $tax_district_method && $tax_district_method eq 'wa_sales' ) {
142 @cust_locations_missing_district = $cust_main->cust_locations_missing_district();