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

18 lines
305 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,
i.value7
FROM buy b
JOIN item i ON i.id = b.itemFk
LEFT JOIN item i2 ON i2.id = b.itemOriginalFk
WHERE b.entryFk = ?