Auftrags-Controller: hash ref richtig dereferenzieren.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Tue, 22 Sep 2015 10:22:59 +0000 (12:22 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:57 +0000 (16:15 +0100)
SL/Controller/Order.pm

index e3f45a8..b00b089 100644 (file)
@@ -395,7 +395,7 @@ sub _recalc {
   foreach my $tax_chart_id (keys %{ $pat{taxes} }) {
     my $tax = SL::DB::Manager::Tax->find_by(chart_id => $tax_chart_id);
 
-    my @amount_keys = grep { $pat{amounts}->{$_}->{tax_id} == $tax->id } keys $pat{amounts};
+    my @amount_keys = grep { $pat{amounts}->{$_}->{tax_id} == $tax->id } keys %{ $pat{amounts} };
     push(@{ $self->{taxes} }, { amount    => $pat{taxes}->{$tax_chart_id},
                                 netamount => $pat{amounts}->{$amount_keys[0]}->{amount},
                                 tax       => $tax });