better detection of new locations that are the same as existing locations, #940,...
[freeside.git] / httemplate / edit / process / change-cust_pkg.html
index 2770f32..77f261d 100644 (file)
@@ -32,11 +32,11 @@ my %change = map { $_ => scalar($cgi->param($_)) }
 $change{'keep_dates'} = 1;
 
 if ( $cgi->param('locationnum') == -1 ) {
-  my $cust_location = new FS::cust_location {
+  my $cust_location = FS::cust_location->new_or_existing({
     'custnum' => $cust_pkg->custnum,
     map { $_ => scalar($cgi->param($_)) }
         qw( address1 address2 city county state zip country )
-  };
+  });
   $change{'cust_location'} = $cust_location;
 }