X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_location.cgi;h=962b1a07540953ba3916c8b4c97d77235068425a;hb=1fc8addc56f8daf12397da568eb1ac1b27fd3984;hp=b9f93db8bae0196ff275ac6fc4cf395b3fec47ac;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi index b9f93db8b..962b1a075 100644 --- a/httemplate/edit/process/cust_location.cgi +++ b/httemplate/edit/process/cust_location.cgi @@ -3,9 +3,9 @@ % $cgi->redirect(popurl(3). 'edit/cust_location.cgi?'. $cgi->query_string ); % } else { - <% header("Location changed") %> + <& /elements/header-popup.html, emt("Location changed") &> @@ -31,10 +31,9 @@ die "unknown locationnum $locationnum" unless $cust_location; my $new = FS::cust_location->new({ custnum => $cust_location->custnum, prospectnum => $cust_location->prospectnum, - map { $_ => scalar($cgi->param($_)) } - qw( address1 address2 city county state zip country ) + map { $_ => scalar($cgi->param($_)) } FS::cust_main->location_fields }); - -my $error = $cust_location->move_to($new); +my $error = $new->find_or_insert; +$error ||= $cust_location->move_to($new);