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`.`mistake`
|
|
|
|
AS SELECT `wr`.`code` AS `revisador`,
|
|
|
|
`s`.`concept` AS `concept`,
|
|
|
|
`w`.`code` AS `sacador`,
|
|
|
|
`w`.`firstName` AS `firstName`,
|
|
|
|
`w`.`lastName` AS `lastName`,
|
|
|
|
`mt`.`description` AS `description`,
|
|
|
|
cast(`iss`.`created` AS date) AS `created`,
|
|
|
|
`w`.`id` AS `workerFk`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`vn`.`saleMistake` `sm`
|
|
|
|
JOIN `vn`.`mistakeType` `mt` ON(`mt`.`id` = `sm`.`typeFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`worker` `wr` ON(`wr`.`id` = `sm`.`userFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`sale` `s` ON(`s`.`id` = `sm`.`saleFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`itemShelvingSale` `iss` ON(`iss`.`saleFk` = `sm`.`saleFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `iss`.`userFk`)
|
|
|
|
)
|