projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8994fc4
)
RT# 79352 - fixed so contact replace would not add duplicate cust_contacts.
author
Christopher Burger
<burgerc@freeside.biz>
Tue, 22 Jan 2019 02:37:38 +0000
(21:37 -0500)
committer
Christopher Burger
<burgerc@freeside.biz>
Tue, 22 Jan 2019 02:37:38 +0000
(21:37 -0500)
FS/FS/contact.pm
patch
|
blob
|
history
diff --git
a/FS/FS/contact.pm
b/FS/FS/contact.pm
index
957f96c
..
f59fef9
100644
(file)
--- a/
FS/FS/contact.pm
+++ b/
FS/FS/contact.pm
@@
-449,7
+449,8
@@
sub replace {
## if found, just add that contact to cust_contact with link_hash credentials
## as email can not be tied to two contacts.
my @contact_emails = ();
## if found, just add that contact to cust_contact with link_hash credentials
## as email can not be tied to two contacts.
my @contact_emails = ();
- my @contact_nums = ($self->contactnum,);
+ my %contact_nums = ();
+ $contact_nums{$self->contactnum} = '1' if $self->contactnum;
if ( $self->get('emailaddress') =~ /\S/ ) {
foreach my $email ( split(/\s*,\s*/, $self->get('emailaddress') ) ) {
if ( $self->get('emailaddress') =~ /\S/ ) {
foreach my $email ( split(/\s*,\s*/, $self->get('emailaddress') ) ) {
@@
-462,7
+463,7
@@
sub replace {
push @contact_emails, $email;
}
else {
push @contact_emails, $email;
}
else {
-
push @contact_nums, $contact->contactnum
;
+
$contact_nums{$contact->contactnum} = '1'
;
}
}
}
}
@@
-488,9
+489,9
@@
sub replace {
# fields.
if ( $custnum ) {
# fields.
if ( $custnum ) {
- foreach my $contactnum (
@
contact_nums) {
+ foreach my $contactnum (
keys %
contact_nums) {
- my %hash = ( 'contactnum' => $contactnum,
#$self->contactnum,
+ my %hash = ( 'contactnum' => $contactnum,
'custnum' => $custnum,
);
my $error;
'custnum' => $custnum,
);
my $error;