1 <% include('/elements/header-popup.html', "Edit Location") %>
3 <% include('/elements/error.html') %>
5 <FORM NAME="EditLocationForm"
6 ACTION="<% $p %>edit/process/cust_location.cgi" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="locationnum" VALUE="<% $locationnum %>">
9 <% ntable('#cccccc') %>
10 <& /elements/location.html,
11 'object' => $cust_location,
13 # these are service locations, so they need all this stuff
15 'enable_district' => 1,
16 'enable_censustract' => 1,
18 <& /elements/standardize_locations.html,
19 'form' => 'EditLocationForm',
20 'callback' => $conf->exists('tax_district_method')
21 ? 'wa_state_tax_district()'
22 : 'submit_continue()',
24 'with_census_functions' => 1,
27 <& /elements/wa_state_tax_district.js &>
29 // wa_sate_tax_district() will call submit_continue() upon success,
30 // or submit_abort() upon error
31 function submit_continue() {
32 document.EditLocationForm.submit();
38 <SCRIPT TYPE="text/javascript">
40 confirm('Modify this service location?') &&
41 standardize_locations();
44 function submit_abort() {
48 <INPUT TYPE="button" NAME="submitButton" VALUE="Submit" onclick="go()">
55 my $conf = new FS::Conf;
57 my $curuser = $FS::CurrentUser::CurrentUser;
59 # it's the same access right you'd need to do this by editing packages
61 unless $curuser->access_right('Change customer package');
63 my $locationnum = scalar($cgi->param('locationnum'));
64 my $cust_location = qsearchs({
65 'select' => 'cust_location.*',
66 'table' => 'cust_location',
67 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
68 'hashref' => { 'locationnum' => $locationnum },
69 'extra_sql' => ' AND '. $curuser->agentnums_sql,
70 }) or die "unknown locationnum $locationnum";
72 die "can't edit disabled locationnum $locationnum" if $cust_location->disabled;
74 my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_location->custnum })
75 or die "can't get cust_main record for custnum ". $cust_location->custnum;
77 my @cust_pkgs = qsearch('cust_pkg', { 'locationnum' => $locationnum });