if ( $options{'cust_location'} ) {
my $cust_location = $options{'cust_location'};
- my $error = $cust_location->insert;
+ my $method = $cust_location->locationnum ? 'replace' : 'insert';
+ my $error = $cust_location->$method();
if ( $error ) {
$dbh->rollback if $oldAutoCommit;
return $error;
'';
}
-sub location {
+sub location_hash {
my $self = shift;
if ( $self->locationnum ) {
my $l = qsearchs( 'cust_location',
return %loc_hash;
}
}
- # prospectnum does not imply any particular address! must specify locationnum
- '';
+ warn "prospectnum does not imply any particular address! must specify locationnum";
+ return ();
}
sub cust_or_prospect {