Erstellt vor 8 Jahren
Geschlossen vor 8 Jahren
#537 closed Fehler (fixed)
Fehler beim erzeugen eines Berichtes
| Erstellt von: | wromer@… | Verantwortlicher: | p.reetz@… |
|---|---|---|---|
| Priorität: | normal | Meilenstein: | |
| Komponente: | kivitendo ERP | Version: | 2.4.1 |
| Schweregrad: | normal | Stichworte: | Bericht |
| Beobachter: |
Beschreibung
Beim anzeigen eines Berichtes über Erzeugnisse, kommt folgende Fehlermeldung,
wenn man eine Mehrfachauswahl bei: Verkauft, vom Kunden bestellt, Angeboten, tätigt:
SELECT p.id, p.partnumber, i.description, i.serialnumber,
i.qty AS onhand, i.unit, p.bin, i.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
pg.partsgroup,
a.invnumber, a.ordnumber, a.quonumber, i.trans_id,
ct.name, i.deliverydate, 'is' AS module, AS type,
1 As exchangerate
FROM invoice i
JOIN parts p ON (p.id = i.parts_id)
JOIN ar a ON (a.id = i.trans_id)
JOIN customer ct ON (a.customer_id = ct.id)
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
WHERE 1 = 1 AND lower(p.partnumber) LIKE '%999-1%' AND p.assembly = '1' AND
p.obsolete = '0' AND i.assemblyitem = '0'
UNION
SELECT p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
pg.partsgroup,
AS invnumber, o.ordnumber, o.quonumber, oi.trans_id,
ct.name, 'oe' AS module, 'sales_order' AS type,
(SELECT buy FROM exchangerate ex
WHERE ex.curr = o.curr
AND ex.transdate = o.transdate) AS exchangerate
FROM orderitems oi
JOIN parts p ON (oi.parts_id = p.id)
JOIN oe o ON (oi.trans_id = o.id)
JOIN customer ct ON (o.customer_id = ct.id)
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
WHERE 1 = 1 AND lower(p.partnumber) LIKE '%999-1%' AND p.assembly = '1' AND
p.obsolete = '0'
AND o.quotation = '0'
AND o.customer_id > 0
UNION
SELECT p.id, p.partnumber, oi.description, oi.serialnumber AS serialnumber,
oi.qty AS onhand, oi.unit, p.bin, oi.sellprice,
p.listprice, p.lastcost, p.rop, p.weight,
p.priceupdate, p.image, p.drawing, p.microfiche,
pg.partsgroup,
AS invnumber, o.ordnumber, o.quonumber, oi.trans_id,
ct.name, 'oe' AS module, 'sales_quotation' AS type,
(SELECT buy FROM exchangerate ex
WHERE ex.curr = o.curr
AND ex.transdate = o.transdate) AS exchangerate
FROM orderitems oi
JOIN parts p ON (oi.parts_id = p.id)
JOIN oe o ON (oi.trans_id = o.id)
JOIN customer ct ON (o.customer_id = ct.id)
LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
WHERE 1 = 1 AND lower(p.partnumber) LIKE '%999-1%' AND p.assembly = '1' AND
p.obsolete = '0'
AND o.quotation = '1'
AND o.customer_id > 0
ORDER BY description
ERROR: each UNION query must have the same number of columns
Grüsse
Willi
Änderungshistorie (1)
comment:1 Geändert vor 8 Jahren durch m.bunkus@…
- Lösung auf fixed gesetzt
- Status von new nach closed geändert

Danke, behoben.