From 2b688418ad0392b739240ffa4de1ab9d12ad4031 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 1 Aug 2008 09:01:21 +0000 Subject: [PATCH] =?utf8?q?Query=20f=C3=BCr=20die=20Artikelstammdaten:=20Fa?= =?utf8?q?lsches=20Joinen.=20Wenn=20die=20UNION=20aus=20invoice/orderitems?= =?utf8?q?=20mit=20ar/ap/oe=20gejoint=20wird,=20dann=20muss=20darauf=20gea?= =?utf8?q?chtet=20werden,=20dass=20Zeilen=20aus=20invoice=20nur=20mit=20ar?= =?utf8?q?/ap=20und=20Zeilen=20aus=20orderitems=20nur=20mit=20oe=20gejoint?= =?utf8?q?=20wird.=20Grund=20ist,=20dass=20ar.id=20und=20ap.id=20den=20Z?= =?utf8?q?=C3=A4hler=20glid=20benutzen,=20w=C3=A4hrend=20oe.id=20den=20Z?= =?utf8?q?=C3=A4hler=20id=20benutzt.=20Daraus=20resultierten=20Verbindunge?= =?utf8?q?n=20mit=20Zeilen=20aus=20orderitems=20mit=20Zeilen=20aus=20ar/ap?= =?utf8?q?,=20sprich=20es=20wurden=20Rechnungen=20gefunden,=20in=20denen?= =?utf8?q?=20die=20Artikel=20gar=20nicht=20auftauchten.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IC.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index 67d38d72d..45fcebb1b 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -780,10 +780,10 @@ sub all_parts { ) AS ioi ON ioi.parts_id = p.id|, apoe => q|LEFT JOIN ( - SELECT id, transdate, 'ir' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, NULL AS customer_id, vendor_id, NULL AS deliverydate FROM ap UNION - SELECT id, transdate, 'is' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, customer_id, NULL AS vendor_id, deliverydate FROM ar UNION - SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber, quotation, customer_id, vendor_id, NULL AS deliverydate FROM oe - ) AS apoe ON ioi.trans_id = apoe.id|, + SELECT id, transdate, 'ir' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, NULL AS customer_id, vendor_id, NULL AS deliverydate, 'invoice' AS ioi FROM ap UNION + SELECT id, transdate, 'is' AS module, ordnumber, quonumber, invnumber, FALSE AS quotation, customer_id, NULL AS vendor_id, deliverydate, 'invoice' AS ioi FROM ar UNION + SELECT id, transdate, 'oe' AS module, ordnumber, quonumber, NULL AS invnumber, quotation, customer_id, vendor_id, NULL AS deliverydate, 'orderitems' AS ioi FROM oe + ) AS apoe ON ((ioi.trans_id = apoe.id) AND (ioi.ioi = apoe.ioi))|, cv => q|LEFT JOIN ( SELECT id, name, 'customer' AS cv FROM customer UNION -- 2.20.1