11 lines
324 B
SQL
11 lines
324 B
SQL
CREATE OR REPLACE DEFINER=`vn-admin`@`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'
|