underscoring the important
[freeside.git] / FS / FS / cust_credit.pm
index 4336ea0..938686f 100644 (file)
@@ -262,11 +262,14 @@ methods.
 sub check {
   my $self = shift;
 
+  $self->otaker(getotaker) unless ($self->otaker);
+
   my $error =
     $self->ut_numbern('crednum')
     || $self->ut_number('custnum')
     || $self->ut_numbern('_date')
     || $self->ut_money('amount')
+    || $self->ut_alpha('otaker')
     || $self->ut_textn('reason')
     || $self->ut_foreign_key('reasonnum', 'reason', 'reasonnum')
     || $self->ut_enum('closed', [ '', 'Y' ])
@@ -280,8 +283,6 @@ sub check {
 
   $self->_date(time) unless $self->_date;
 
-  $self->otaker(getotaker) unless ($self->otaker);
-
   $self->SUPER::check;
 }
 
@@ -419,9 +420,9 @@ sub _upgrade_data {  # class method
 
     warn "$me Checking for unmigrated reasons\n" if $DEBUG;
 
-    my @cust_credits = qsearch({ 'table' => $class->table,
-                                 'hashref' => {},
-                                 'extrasql' => 'WHERE reason IS NOT NULL',
+    my @cust_credits = qsearch({ 'table'     => $class->table,
+                                 'hashref'   => {},
+                                 'extra_sql' => 'WHERE reason IS NOT NULL',
                               });
 
     if (scalar(grep { $_->getfield('reason') =~ /\S/ } @cust_credits)) {