This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
RIS/App/Requests/sql/sklad_material.sql
2024-12-10 18:09:49 +03:00

11 lines
411 B
SQL

SELECT
w.waybill_date AS 'Дата поставки',
s.name AS 'Поставщик',
wl.amount AS 'Количество'
FROM waybill w
JOIN (SELECT waybill_id, work_id, amount FROM waybill_lines) wl USING(waybill_id)
JOIN (SELECT user_id, sel_id FROM external_users) eu USING(user_id)
JOIN (SELECT sel_id, name FROM sellers) s USING(sel_id)
WHERE work_id = '$id'
GROUP BY waybill_date, name;