IBAN/BIC durch Masken durchreichen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 8 Sep 2011 15:34:31 +0000 (17:34 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 8 Sep 2011 15:34:31 +0000 (17:34 +0200)
Bei Umstellung von "nur Überweisung" auf "auch Einzug" gingen IBAN/BIC
in den Masken verloren, weil die Eingabefelder "vc_bic" hießen, der
Code aber nach "${vc}_bic" gesucht hat, effektiv also nach
"customer_bic" oder "vendor_bic".

bin/mozilla/sepa.pl

index 9f9f31a..f559c60 100755 (executable)
@@ -113,7 +113,7 @@ sub bank_transfer_create {
   }
 
   if ($error_message || !$form->{confirmation}) {
-    my @vc_ids                 = uniq map { $_->{"${vc}_id"} } @bank_transfers;
+    my @vc_ids                 = uniq map { $_->{vc_id} } @bank_transfers;
     $vc_bank_info            ||= CT->get_bank_info('vc' => $vc,
                                                    'id' => \@vc_ids);
     my @vc_bank_info           = sort { lc $a->{name} cmp lc $b->{name} } values %{ $vc_bank_info };
@@ -136,7 +136,7 @@ sub bank_transfer_create {
   } else {
     foreach my $bank_transfer (@bank_transfers) {
       foreach (qw(iban bic)) {
-        $bank_transfer->{"vc_${_}"}  = $vc_bank_info->{ $bank_transfer->{"${vc}_id"} }->{$_};
+        $bank_transfer->{"vc_${_}"}  = $vc_bank_info->{ $bank_transfer->{vc_id} }->{$_};
         $bank_transfer->{"our_${_}"} = $bank_account->{$_};
       }