2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
SQL SECURITY DEFINER
|
|
|
|
VIEW `vn`.`mistakeRatio`
|
|
|
|
AS SELECT `wr`.`code` AS `revisador`,
|
|
|
|
`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`,
|
|
|
|
`sm`.`saleFk` AS `saleFk`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`vn`.`itemShelvingSale` `iss`
|
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `iss`.`userFk`)
|
|
|
|
)
|
|
|
|
LEFT JOIN `vn`.`saleMistake` `sm` ON(`iss`.`saleFk` = `sm`.`saleFk`)
|
|
|
|
)
|
|
|
|
LEFT JOIN `vn`.`mistakeType` `mt` ON(`mt`.`id` = `sm`.`typeFk`)
|
|
|
|
)
|
|
|
|
LEFT JOIN `vn`.`worker` `wr` ON(`wr`.`id` = `sm`.`userFk`)
|
|
|
|
)
|