Merge pull request #20 from robert-scheck/fa-leonberg
[kivitendo-erp.git] / SL / Controller / BankTransaction.pm
index 7f89646..fcea622 100644 (file)
@@ -25,7 +25,6 @@ use SL::DB::BankAccount;
 use SL::DB::RecordTemplate;
 use SL::DB::SepaExportItem;
 use SL::DBUtils qw(like);
-use SL::Presenter;
 
 use List::MoreUtils qw(any);
 use List::Util qw(max);
@@ -154,6 +153,7 @@ sub action_list {
     $bt->{remote_name} .= $bt->{remote_name_1} if $bt->{remote_name_1};
 
     if ( $bt->is_batch_transaction ) {
+      my $found=0;
       foreach ( keys  %sepa_exports) {
         if ( abs(($sepa_exports{$_}->{amount} * 1) - ($bt->amount * 1)) < 0.01 ) {
           ## jupp
@@ -161,9 +161,11 @@ sub action_list {
           $bt->{sepa_export_ok} = 1;
           $sepa_exports{$_}->{proposed}=1;
           push(@proposals, $bt);
-          next;
+          $found=1;
+          last;
         }
       }
+      next if $found;
       # batch transaction has no remotename !!
     } else {
       next unless $bt->{remote_name};  # bank has no name, usually fees, use create invoice to assign