better detection of new locations that are the same as existing locations, #940,...
[freeside.git] / httemplate / edit / process / cust_location.cgi
index b9f93db..56c3968 100644 (file)
@@ -28,11 +28,10 @@ my $cust_location = qsearchs({
 });
 die "unknown locationnum $locationnum" unless $cust_location;
 
-my $new = FS::cust_location->new({
+my $new = FS::cust_location->new_or_existing({
   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);