use strict;
use vars qw( @ISA @encrypted_fields );
use Business::CreditCard;
-use FS::Record qw( qsearch qsearchs dbh );
use FS::UID qw(getotaker);
+use FS::Record qw( qsearch qsearchs dbh );
+use FS::cust_main_Mixin;
+use FS::payinfo_transaction_Mixin;
use FS::cust_credit;
use FS::cust_credit_refund;
use FS::cust_pay_refund;
use FS::cust_main;
-use FS::payinfo_Mixin;
-@ISA = qw( FS::Record FS::payinfo_Mixin );
+@ISA = qw( FS::payinfo_transaction_Mixin FS::cust_main_Mixin FS::Record );
@encrypted_fields = ('payinfo');
=item replace OLD_RECORD
-Currently unimplemented (accounting reasons).
+Modifying a refund? Well, don't say I didn't warn you.
=cut
sub check {
my $self = shift;
+ $self->otaker(getotaker) unless ($self->otaker);
+
my $error =
$self->ut_numbern('refundnum')
|| $self->ut_numbern('custnum')
|| $self->ut_money('refund')
+ || $self->ut_alpha('otaker')
|| $self->ut_text('reason')
|| $self->ut_numbern('_date')
|| $self->ut_textn('paybatch')
$error = $self->payinfo_check;
return $error if $error;
- $self->otaker(getotaker);
-
$self->SUPER::check;
}