salix/print/templates/reports/entry-order/sql/buys.sql

20 lines
327 B
MySQL
Raw Normal View History

SELECT b.itemFk,
b.quantity,
b.buyingValue,
b.stickers,
b.packing,
2024-08-21 06:05:45 +00:00
i.name,
IFNULL(i2.comment, i.comment) comment,
i.tag5,
i.value5,
i.tag6,
i.value6,
i.tag7,
2024-11-14 14:29:18 +00:00
i.value7,
i.tag8,
i.value8
FROM buy b
JOIN item i ON i.id = b.itemFk
LEFT JOIN item i2 ON i2.id = b.itemOriginalFk
WHERE b.entryFk = ?