X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=925eb4e444868e78ca8b2f481c969686c5a34326;hb=5f7c4a6025b9e3a49bee72dbc06cac37a45e6f10;hp=23d54b60747e503c1cf269b653abc02cb759b06d;hpb=7e025dc076379f89e91803ec58d1a0d95cb02d1f;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 23d54b607..925eb4e44 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1523,8 +1523,10 @@ sub replace { custnum => $self->custnum, } ); - $implicit_contact->set($_, $i_cust_contact->$_) - foreach qw( classnum selfservice_access comment ); + if ( $i_cust_contact ) { + $implicit_contact->set($_, $i_cust_contact->$_) + foreach qw( classnum selfservice_access comment ); + } my $error; if ( $implicit_contact->contactnum ) { @@ -4615,6 +4617,8 @@ PAYBYLOOP: next if grep(/^$field$/, qw( custpaybynum payby weight ) ); next if grep(/^$field$/, @preserve ); next PAYBYLOOP unless $new->get($field) eq $cust_payby->get($field); + # check if paymask exists, if so stop and don't save, no need for a duplicate. + return '' if $new->get('paymask') eq $cust_payby->get('paymask'); } # now check fields that can replace if one value is blank my $replace = 0;