X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_location.cgi;h=962b1a07540953ba3916c8b4c97d77235068425a;hp=b9f93db8bae0196ff275ac6fc4cf395b3fec47ac;hb=4d5e45b24200386a7fc47f2cd69949e82e4bc9c3;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7 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);