import torrus 1.0.9
[freeside.git] / FS / FS / banned_pay.pm
index 1ad87f5..3379653 100644 (file)
@@ -1,11 +1,10 @@
 package FS::banned_pay;
 
 use strict;
-use vars qw( @ISA );
+use base qw( FS::otaker_Mixin FS::Record );
 use FS::Record qw( qsearch qsearchs );
 use FS::UID qw( getotaker );
-
-@ISA = qw(FS::Record);
+use FS::CurrentUser;
 
 =head1 NAME
 
@@ -43,7 +42,7 @@ supported:
 =item _date - specified as a UNIX timestamp; see L<perlfunc/"time">.  Also see
 L<Time::Local> and L<Date::Parse> for conversion functions.
 
-=item otaker - order taker (assigned automatically, see L<FS::UID>)
+=item usernum - order taker (assigned automatically, see L<FS::access_user>)
 
 =item reason - reason (text)
 
@@ -117,11 +116,17 @@ sub check {
 
   $self->_date(time) unless $self->_date;
 
-  $self->otaker(getotaker);
+  $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum;
 
   $self->SUPER::check;
 }
 
+# Used by FS::Upgrade to migrate to a new database.
+sub _upgrade_data {  # class method
+  my ($class, %opts) = @_;
+  $class->_upgrade_otaker(%opts);
+}
+
 =back
 
 =head1 BUGS