add a key on ( history_action, $primary_key ) to the h_ tables. this should speed...
[freeside.git] / FS / FS / cust_refund.pm
index 53c6bac..e075e3e 100644 (file)
@@ -11,7 +11,7 @@ use FS::cust_pay_refund;
 use FS::cust_main;
 use FS::payinfo_Mixin;
 
-@ISA = qw( FS::Record FS::payinfo_Mixin );
+@ISA = qw( FS::payinfo_Mixin FS::cust_main_Mixin FS::Record );
 
 @encrypted_fields = ('payinfo');
 
@@ -216,7 +216,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 +235,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 +260,6 @@ sub check {
   $error = $self->payinfo_check;
   return $error if $error;
 
-  $self->otaker(getotaker);
-
   $self->SUPER::check;
 }