Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / cust_pay_batch.pm
index da003d8..8f31e4d 100644 (file)
@@ -129,6 +129,8 @@ and replace methods.
 sub check {
   my $self = shift;
 
+  my $conf = new FS::Conf;
+
   my $error = 
       $self->ut_numbern('paybatchnum')
     || $self->ut_numbern('trancode') #deprecated
@@ -137,7 +139,9 @@ sub check {
     || $self->ut_number('custnum')
     || $self->ut_text('address1')
     || $self->ut_textn('address2')
-    || $self->ut_text('city')
+    || ($conf->exists('cust_main-no_city_in_address') 
+        ? $self->ut_textn('city') 
+        : $self->ut_text('city'))
     || $self->ut_textn('state')
   ;
 
@@ -344,14 +348,8 @@ sub decline {
       }
       $cust_pay->void($reason);
     }
-    elsif ( lc($old->status) eq 'declined' ) {
-      # batch files from RBC can have multiple lines for one decline
-      # if this causes problems elsewhere, try hacking pay_batch/RBC.pm instead
-      return '';
-    }
     else {
       # normal case: refuse to do anything
-      # should never happen...only statuses are approved or declined
       return "cannot decline paybatchnum $paybatchnum, already resolved ('".$old->status."')";
     }
   } # !$old->status