X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_location.cgi;h=962b1a07540953ba3916c8b4c97d77235068425a;hp=56c3968f6f7df11248ee0ed30fda9cd6689e073d;hb=4d5e45b24200386a7fc47f2cd69949e82e4bc9c3;hpb=54a357b171aa44f9399b4c146acd2afd3b686075 diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi index 56c3968f6..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") &> @@ -28,12 +28,12 @@ my $cust_location = qsearchs({ }); die "unknown locationnum $locationnum" unless $cust_location; -my $new = FS::cust_location->new_or_existing({ +my $new = FS::cust_location->new({ custnum => $cust_location->custnum, prospectnum => $cust_location->prospectnum, 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);