From 25730b2f095df5a3f5961900418b26aa52f6c7c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 26 Jan 2015 15:37:14 +0100 Subject: [PATCH] Im Lieferplan und Lieferwertbericht Mengen nicht berechnen, wenn es keine Ergebnisse gibt. Sonst gibt es ein Syntax-Error in dem Query. --- SL/Controller/DeliveryPlan.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index d05b46a12..ebb0dba50 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -42,7 +42,6 @@ sub action_list { $self->prepare_report; my $orderitems = $self->models->get; - $self->calc_qtys($orderitems); $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems); } @@ -122,6 +121,9 @@ sub calc_qtys { my ($self, $orderitems) = @_; # using $orderitem->shipped_qty 40 times is far too slow. need to do it manually # + + return unless scalar @$orderitems; + my %orderitems_by_id = map { $_->id => $_ } @$orderitems; my $query = <