X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBankTransaction.pm;h=5dd81804b2339bdeee60223f524a1cfc2779d0dc;hb=b81ceec0ae27fd58adbb724ad99a6ee48a74af35;hp=47089bdc9fc082ece360f76e619b76b2c85ab848;hpb=573562a5411e9a3cb35b586935a6a0ed29d805db;p=kivitendo-erp.git diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 47089bdc9..5dd81804b 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -316,8 +316,8 @@ sub action_ajax_add_list { my $all_open_ar_invoices = SL::DB::Manager::Invoice->get_all(where => \@where_sale, with_objects => 'customer'); my $all_open_ap_invoices = SL::DB::Manager::PurchaseInvoice->get_all(where => \@where_purchase, with_objects => 'vendor'); - my @all_open_invoices; - # filter out subcent differences from ap invoices + my @all_open_invoices = @{ $all_open_ar_invoices }; + # add ap invoices, filtering out subcent open amounts push @all_open_invoices, grep { abs($_->amount - $_->paid) >= 0.01 } @{ $all_open_ap_invoices }; @all_open_invoices = sort { $a->id <=> $b->id } @all_open_invoices; @@ -373,8 +373,8 @@ sub action_save_invoices { foreach my $invoice (@invoices) { my $payment_type; - if ( @$skonto_hash{"$bt_id"} ) { - $payment_type = shift( @$skonto_hash{"$bt_id"} ); + if ( defined $skonto_hash->{"$bt_id"} ) { + $payment_type = shift(@{ $skonto_hash->{"$bt_id"} }); } else { $payment_type = 'without_skonto'; };