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

20 lines
528 B
MySQL
Raw Permalink Normal View History

2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`localhost`
SQL SECURITY DEFINER
VIEW `vn`.`itemEntryIn`
AS SELECT `t`.`warehouseInFk` AS `warehouseInFk`,
`t`.`landed` AS `landed`,
`b`.`itemFk` AS `itemFk`,
`b`.`quantity` AS `quantity`,
`t`.`isReceived` AS `isReceived`,
`e`.`isRaid` AS `isVirtualStock`,
`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 `b`.`quantity` <> 0