diff options
author | Mark Wells <mark@freeside.biz> | 2014-02-27 17:06:41 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-02-27 17:06:41 -0800 |
commit | beff2bed3d06a91072427a15efef08b24c7cc8df (patch) | |
tree | 766f67c17b70af25083bbebdfc9ea549d8ce5247 /FS/FS/cust_pay.pm | |
parent | 07644a5463751fdaeb0dcd9cc3caf2d19eb877df (diff) |
fix payment voiding, fallout from #13971
Diffstat (limited to 'FS/FS/cust_pay.pm')
-rw-r--r-- | FS/FS/cust_pay.pm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 63d7c48..0f643c9 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -414,12 +414,17 @@ sub void { } ); $cust_pay_void->reason(shift) if scalar(@_); my $error = $cust_pay_void->insert; - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return $error; + + my $cust_pay_pending = + qsearchs('cust_pay_pending', { paynum => $self->paynum }); + if ( $cust_pay_pending ) { + $cust_pay_pending->set('void_paynum', $self->paynum); + $cust_pay_pending->set('paynum', ''); + $error ||= $cust_pay_pending->replace; } - $error = $self->delete; + $error ||= $self->delete; + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; |