X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_location.cgi;h=962b1a07540953ba3916c8b4c97d77235068425a;hp=790fc8ea4bf7a364c2f9cfe056d58a7692f88832;hb=4d5e45b24200386a7fc47f2cd69949e82e4bc9c3;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/httemplate/edit/process/cust_location.cgi b/httemplate/edit/process/cust_location.cgi index 790fc8ea4..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,11 +28,12 @@ my $cust_location = qsearchs({ }); die "unknown locationnum $locationnum" unless $cust_location; -my $new = { - map { $_ => scalar($cgi->param($_)) } - qw( address1 address2 city county state zip country ) -}; - -my $error = $cust_location->move_to($new); +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 = $new->find_or_insert; +$error ||= $cust_location->move_to($new);