salix/db/routines/vn/views/expeditionTicket_NoBoxes.sql

20 lines
556 B
MySQL
Raw Permalink Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`expeditionTicket_NoBoxes`
AS SELECT `t`.`id` AS `ticketFk`,
`t`.`warehouseFk` AS `warehouseFk`,
`t`.`routeFk` AS `routeFk`,
`rs`.`description` AS `description`
FROM (
(
(
`vn`.`ticket` `t`
LEFT JOIN `vn`.`expedition` `e` ON(`e`.`ticketFk` = `t`.`id`)
)
JOIN `vn`.`routesMonitor` `rm` ON(`rm`.`routeFk` = `t`.`routeFk`)
)
JOIN `vn`.`roadmapStop` `rs` ON(`rs`.`id` = `rm`.`roadmapStopFk`)
)
WHERE `e`.`id` IS NULL
AND `rs`.`eta` > `util`.`VN_CURDATE`()