point to wiki docs
[freeside.git] / FS / FS / cust_refund.pm
index 53c6bac..abc131e 100644 (file)
@@ -3,15 +3,16 @@ package FS::cust_refund;
 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');
 
@@ -216,7 +217,7 @@ sub delete {
 
 =item replace OLD_RECORD
 
-Currently unimplemented (accounting reasons).
+Modifying a refund?  Well, don't say I didn't warn you.
 
 =cut
 
@@ -235,10 +236,13 @@ returns the error, otherwise returns false.  Called by the insert method.
 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')
@@ -257,8 +261,6 @@ sub check {
   $error = $self->payinfo_check;
   return $error if $error;
 
-  $self->otaker(getotaker);
-
   $self->SUPER::check;
 }