BankTransaction: kein Push auf Skalarvariable
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 16 Dec 2016 08:56:45 +0000 (09:56 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 16 Dec 2016 08:56:45 +0000 (09:56 +0100)
Neue Perl-Versionen werfen bei Pushes auf Skalare (auch wenn das
Arrayreferenzen sind) Fehler und nicht nur Warnungen:

push $array_ref, $value; # Experimental push on scalar is now forbidden

push @{ $array_ref }, $value; # OK

SL/Controller/BankTransaction.pm

index fec3756..ac9c3b1 100644 (file)
@@ -131,7 +131,7 @@ sub action_list {
         $sepa_exports{$_->sepa_export_id}->{count}++ ;
         $sepa_exports{$_->sepa_export_id}->{is_ar}++ if  $_->ar_id == $open_invoice->id;
         $sepa_exports{$_->sepa_export_id}->{amount} += $_->amount * $factor;
-        push ( @{ $sepa_exports{$_->sepa_export_id}->{invoices}} , $open_invoice );
+        push @{ $sepa_exports{$_->sepa_export_id}->{invoices} }, $open_invoice;
         #$main::lxdebug->message(LXDebug->DEBUG2(),"amount for export id ".$_->sepa_export_id." = ".
         #                          $sepa_exports{$_->sepa_export_id}->{amount}." count = ".
         #                          $sepa_exports{$_->sepa_export_id}->{count}." is_ar = ".
@@ -184,7 +184,7 @@ sub action_list {
           #$main::lxdebug->message(LXDebug->DEBUG2(),"remote account '".$bt->{remote_account_number}."' bt_amount=". ($bt->amount * $factor));
           #$main::lxdebug->message(LXDebug->DEBUG2(),"compare with   '".$_->vc_iban."'    amount=".$_->amount);
           if ( $bt->{remote_account_number} eq $_->vc_iban && abs(( $_->amount *1 ) - ($bt->amount * $factor)) < 0.01 ) {
-            push ($bt->{proposals},$open_invoice );
+            push @{ $bt->{proposals} }, $open_invoice;
             $bt->{agreement}    = 20;
             $bt->{rule_matches} = 'sepa_export_item(20)';
             #$main::lxdebug->message(LXDebug->DEBUG2(),"found invoice");