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

20 lines
524 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`.`itemEntryOut`
AS SELECT `t`.`warehouseOutFk` AS `warehouseOutFk`,
`t`.`shipped` AS `shipped`,
`b`.`itemFk` AS `itemFk`,
- `b`.`quantity` AS `quantity`,
`t`.`isDelivered` AS `isDelivered`,
`e`.`id` AS `entryFk`
FROM (
(
`vn`.`buy` `b`
JOIN `vn`.`entry` `e` ON(`b`.`entryFk` = `e`.`id`)
)
JOIN `vn`.`travel` `t` ON(`e`.`travelFk` = `t`.`id`)
)
WHERE `e`.`isExcludedFromAvailable` = 0
2024-11-21 14:09:58 +00:00
AND NOT `t`.`isRaid`
AND `b`.`quantity` <> 0