- $cust_pay_pending->set('custnum', $self->custnum);
- my $set_custnum_err = $cust_pay_pending->replace;
- if ($set_custnum_err) {
- $log->error($set_custnum_err);
- $error ||= $set_custnum_err;
- # but if there was a real verification error also, return that one
+ if (!$cust_pay_pending->custnum) {
+ $cust_pay_pending->set('custnum', $self->custnum);
+ my $set_custnum_err = $cust_pay_pending->replace;
+ if ($set_custnum_err) {
+ $log->error($set_custnum_err);
+ $error ||= $set_custnum_err;
+ # but if there was a real verification error also, return that one
+ }