salix/print/templates/reports/buy-label/sql/buys.sql

17 lines
367 B
MySQL
Raw Normal View History

2024-06-28 10:57:27 +00:00
SELECT ROW_NUMBER() OVER(ORDER BY b.id) labelNum,
i.name,
i.`size`,
i.category,
ink.id color,
2024-06-28 12:52:19 +00:00
o.code,
2024-06-28 10:57:27 +00:00
b.packing,
b.`grouping`,
i.stems,
b.id,
p.name producer
FROM buy b
JOIN item i ON i.id = b.itemFk
LEFT JOIN producer p ON p.id = i.producerFk
LEFT JOIN ink ON ink.id = i.inkFk
LEFT JOIN origin o ON o.id = i.originFk
WHERE b.entryFk = ?