From f5341298db5dbe7e14d0f97525f4f6226e5940c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 22 Oct 2021 15:13:12 +0200 Subject: [PATCH] =?utf8?q?Lieferplan:=20Geschwindigkeitssteigerung=20durch?= =?utf8?q?=20=C2=BBNOT=20EXISTS=C2=AB=20anstelle=20von=20=C2=BBNOT=20IN?= =?utf8?q?=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/DeliveryPlan.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index a94c8446b..6d7aaa908 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -199,12 +199,13 @@ sub delivery_plan_query_linked_items { (oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed AND $oe_owner - oi.id NOT IN ( + NOT EXISTS ( SELECT from_id FROM record_links rl WHERE - rl.from_table ='orderitems' AND - rl.to_table = 'delivery_order_items' + rl.from_table = 'orderitems' AND + rl.to_table = 'delivery_order_items' AND + rl.from_id = oi.id ) " ], # make emacs happy again: " ] -- 2.20.1