X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pay_void.pm;h=0609ea825b09c459fe11aeb7c965818095497380;hb=fd5d458eda666a60ec0cdf35e5cbdff438b4ed76;hp=bebcfd4cc6877de32af94b27de9ed29fae2f17fc;hpb=c683be2e0bc89b9d11dfd5454a6cd21161b752ef;p=freeside.git diff --git a/FS/FS/cust_pay_void.pm b/FS/FS/cust_pay_void.pm index bebcfd4cc..0609ea825 100644 --- a/FS/FS/cust_pay_void.pm +++ b/FS/FS/cust_pay_void.pm @@ -1,7 +1,7 @@ package FS::cust_pay_void; use strict; -use base qw( FS::otaker_Mixin FS::payinfo_Mixin FS::cust_main_Mixin +use base qw( FS::otaker_Mixin FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record ); use vars qw( @encrypted_fields $otaker_upgrade_kludge ); use Business::CreditCard; @@ -17,6 +17,8 @@ use FS::cust_pay; use FS::cust_pkg; @encrypted_fields = ('payinfo'); +sub nohistory_fields { ('payinfo'); } + $otaker_upgrade_kludge = 0; =head1 NAME @@ -74,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 @@ -133,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; @@ -184,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;