2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost`
|
2024-01-15 11:31:03 +00:00
|
|
|
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
|
|
|
|
AND `e`.`isRaid` = 0
|
|
|
|
AND `b`.`quantity` <> 0
|