2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`itemShelvingSaleSum`
|
|
|
|
AS SELECT `iss`.`id` AS `id`,
|
|
|
|
`iss`.`itemShelvingFk` AS `itemShelvingFk`,
|
|
|
|
`iss`.`saleFk` AS `saleFk`,
|
|
|
|
sum(`iss`.`quantity`) AS `quantity`,
|
|
|
|
`iss`.`created` AS `created`,
|
|
|
|
`p`.`sectorFk` AS `sectorFk`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`vn`.`itemShelvingSale` `iss`
|
|
|
|
JOIN `vn`.`itemShelving` `ish` ON(`ish`.`id` = `iss`.`itemShelvingFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`shelving` `sh` ON(`sh`.`code` = `ish`.`shelvingFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
|
|
|
)
|
|
|
|
GROUP BY `iss`.`saleFk`
|