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

11 lines
318 B
MySQL
Raw Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`salesPreviousPreparated`
AS SELECT `st`.`saleFk` AS `saleFk`
FROM (
`vn`.`saleTracking` `st`
JOIN `vn`.`state` `e` ON(`e`.`id` = `st`.`stateFk`)
)
WHERE `st`.`created` > `util`.`VN_CURDATE`()
AND `e`.`code` LIKE 'PREVIOUS_PREPARATION'