salix/db/routines/vn/views/itemShelvingStockFull.sql

30 lines
877 B
MySQL
Raw Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`itemShelvingStockFull`
AS SELECT `ish`.`itemFk` AS `itemFk`,
`ish`.`visible` AS `quantity`,
`ish`.`packing` AS `packing`,
`ish`.`grouping` AS `grouping`,
`s`.`description` AS `sector`,
`issr`.`removed` AS `removed`,
`p`.`sectorFk` AS `sectorFk`,
`s`.`warehouseFk` AS `warehouseFk`,
`ish`.`shelvingFk` AS `shelvingFk`,
`p`.`code` AS `parkingCode`,
`sh`.`parkingFk` AS `parkingFk`,
`ish`.`id` AS `itemShelvingFk`,
`ish`.`created` AS `created`
FROM (
(
(
(
`vn`.`itemShelving` `ish`
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
)
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
)
JOIN `vn`.`sector` `s` ON(`s`.`id` = `p`.`sectorFk`)
)
LEFT JOIN `vn`.`itemShelvingStockRemoved` `issr` ON(`issr`.`itemShelvingFk` = `ish`.`id`)
)