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

11 lines
320 B
MySQL
Raw Normal View History

CREATE OR REPLACE DEFINER=`root`@`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'