part_export schema changes
[freeside.git] / FS / FS / cust_refund.pm
index c7d8a6d..2f7b3af 100644 (file)
@@ -221,7 +221,7 @@ sub check {
   ;
   return $error if $error;
 
-  return "refund must be > 0 " if $self->refund == 0;
+  return "refund must be > 0 " if $self->refund <= 0;
 
   $self->_date(time) unless $self->_date;
 
@@ -232,9 +232,11 @@ sub check {
   $self->payby =~ /^(CARD|BILL|COMP)$/ or return "Illegal payby";
   $self->payby($1);
 
+  #false laziness with cust_pay::check
   if ( $self->payby eq 'CARD' ) {
     my $payinfo = $self->payinfo;
-    $self->payinfo($payinfo =~ s/\D//g);
+    $payinfo =~ s/\D//g;
+    $self->payinfo($payinfo);
     if ( $self->payinfo ) {
       $self->payinfo =~ /^(\d{13,16})$/
         or return "Illegal (mistyped?) credit card number (payinfo)";
@@ -259,7 +261,7 @@ sub check {
 
 =head1 VERSION
 
-$Id: cust_refund.pm,v 1.12 2002-01-24 06:52:44 ivan Exp $
+$Id: cust_refund.pm,v 1.14 2002-01-24 16:58:47 ivan Exp $
 
 =head1 BUGS