X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_void.pm;h=0609ea825b09c459fe11aeb7c965818095497380;hb=4fdfe871a80ff796146218fd226e46be97698e0f;hp=e6e2159a7daa60235c828cd78975289affe3a81c;hpb=de27e71335e90813543e5c87025a6bce23bb7645;p=freeside.git diff --git a/FS/FS/cust_pay_void.pm b/FS/FS/cust_pay_void.pm index e6e2159a7..0609ea825 100644 --- a/FS/FS/cust_pay_void.pm +++ b/FS/FS/cust_pay_void.pm @@ -76,6 +76,10 @@ Payment Type (See L for valid values) card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively +=item cardtype + +Credit card type, if appropriate. + =item paybatch text field for tracking card processing @@ -135,12 +139,16 @@ sub unvoid { map { $_ => $self->get($_) } fields('cust_pay') } ); my $error = $cust_pay->insert; - if ( $error ) { - $dbh->rollback if $oldAutoCommit; - return $error; + + my $cust_pay_pending = + qsearchs('cust_pay_pending', { void_paynum => $self->paynum }); + if ( $cust_pay_pending ) { + $cust_pay_pending->set('paynum', $cust_pay->paynum); + $cust_pay_pending->set('void_paynum', ''); + $error ||= $cust_pay_pending->replace; } - $error = $self->delete; + $error ||= $self->delete; if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; @@ -186,7 +194,7 @@ sub check { || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum') || $self->ut_numbern('void_date') || $self->ut_textn('reason') - || $self->payinfo_check + # || $self->payinfo_check #we'd rather void what we have than fail on this ; return $error if $error;