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`.`expeditionTimeExpended`
|
|
|
|
AS SELECT `e`.`ticketFk` AS `ticketFk`,
|
|
|
|
min(`e`.`created`) AS `started`,
|
|
|
|
max(`e`.`created`) AS `finished`,
|
|
|
|
max(`e`.`counter`) AS `cajas`,
|
|
|
|
`w`.`code` AS `code`,
|
|
|
|
`t`.`warehouseFk` AS `warehouseFk`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
`vn`.`expedition` `e`
|
|
|
|
JOIN `vn`.`worker` `w` ON(`w`.`id` = `e`.`workerFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `e`.`ticketFk`)
|
|
|
|
)
|
|
|
|
WHERE `e`.`created` > `util`.`VN_CURDATE`()
|
|
|
|
GROUP BY `e`.`ticketFk`
|