2 % $cgi->param('error', Dumper($error));
3 % $cgi->redirect(popurl(3). 'edit/cust_location.cgi?'. $cgi->query_string );
6 <% header("Location changed") %>
7 <SCRIPT TYPE="text/javascript">
8 window.top.location.reload();
16 my $curuser = $FS::CurrentUser::CurrentUser;
19 unless $curuser->access_right('Change customer package');
21 my $locationnum = $cgi->param('locationnum');
22 my $cust_location = qsearchs({
23 'select' => 'cust_location.*',
24 'table' => 'cust_location',
25 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
26 'hashref' => { 'locationnum' => $locationnum },
27 'extra_sql' => ' AND '. $curuser->agentnums_sql,
29 die "unknown locationnum $locationnum" unless $cust_location;
31 my $new = FS::cust_location->new({
32 custnum => $cust_location->custnum,
33 prospectnum => $cust_location->prospectnum,
34 map { $_ => scalar($cgi->param($_)) }
35 qw( address1 address2 city county state zip country )
38 my $error = $cust_location->move_to($new);