+ if ( $locationnum == -1 ) {
+ my $cust_location = FS::cust_location->new({
+ 'custnum' => $cust_main ? $cust_main->custnum : '',
+ 'prospectnum' => $prospect_main ? $prospect_main->prospectnum : '',
+ map { $_ => scalar($cgi->param($_)) }
+ FS::cust_main->location_fields
+ });
+ $opt{'cust_location'} = $cust_location;
+ } else {
+ $opt{'locationnum'} = $locationnum;
+ }
+