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`)
|
|
|
|
)
|
2024-11-13 08:56:38 +00:00
|
|
|
JOIN `vn`.`shelving` `sh` ON(`sh`.`id` = `ish`.`shelvingFk`)
|
2024-01-15 11:31:03 +00:00
|
|
|
)
|
|
|
|
JOIN `vn`.`parking` `p` ON(`p`.`id` = `sh`.`parkingFk`)
|
|
|
|
)
|
|
|
|
GROUP BY `iss`.`saleFk`
|