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`.`floraHollandBuyedItems`
|
|
|
|
AS SELECT `b`.`itemFk` AS `itemFk`,
|
|
|
|
`i`.`longName` AS `longName`,
|
|
|
|
`b`.`quantity` AS `quantity`,
|
|
|
|
`b`.`buyingValue` AS `buyingValue`,
|
|
|
|
`tr`.`landed` AS `landed`,
|
|
|
|
`e`.`companyFk` AS `companyFk`
|
|
|
|
FROM (
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(
|
|
|
|
`vn`.`buy` `b`
|
|
|
|
JOIN `vn`.`item` `i` ON(`b`.`itemFk` = `i`.`id`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`itemType` `it` ON(`it`.`id` = `i`.`typeFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`itemCategory` `ic` ON(`ic`.`id` = `it`.`categoryFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`entry` `e` ON(`e`.`id` = `b`.`entryFk`)
|
|
|
|
)
|
|
|
|
JOIN `vn`.`travel` `tr` ON(
|
|
|
|
`tr`.`id` = `e`.`travelFk`
|
|
|
|
AND `ic`.`id` NOT IN (8, 6)
|
|
|
|
AND `b`.`buyingValue` <> 0
|
|
|
|
AND `b`.`quantity` <> 0
|
|
|
|
AND `e`.`supplierFk` IN (1664, 1665, 1666, 1465, 1433)
|
|
|
|
)
|
|
|
|
)
|