2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`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
|
2024-11-21 14:09:58 +00:00
|
|
|
AND NOT `t`.`isRaid`
|
2024-01-15 11:31:03 +00:00
|
|
|
AND `b`.`quantity` <> 0
|