package FS::cust_pay_void;
-
-use strict;
use base qw( FS::otaker_Mixin FS::payinfo_transaction_Mixin FS::cust_main_Mixin
FS::Record );
+
+use strict;
use vars qw( @encrypted_fields $otaker_upgrade_kludge );
use Business::CreditCard;
-use FS::UID qw(getotaker);
use FS::Record qw(qsearch qsearchs dbh fields);
use FS::CurrentUser;
use FS::access_user;
#use FS::cust_bill;
#use FS::cust_bill_pay;
#use FS::cust_pay_refund;
-#use FS::cust_main;
use FS::cust_pkg;
@encrypted_fields = ('payinfo');
+sub nohistory_fields { ('payinfo'); }
+
$otaker_upgrade_kludge = 0;
=head1 NAME
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;
Returns the parent customer object (see L<FS::cust_main>).
-=cut
-
-sub cust_main {
- my $self = shift;
- qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
-}
-
=item void_access_user
Returns the voiding employee object (see L<FS::access_user>).