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

18 lines
476 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`.`itemTicketOut`
AS SELECT `t`.`warehouseFk` AS `warehouseFk`,
`t`.`shipped` AS `shipped`,
`s`.`itemFk` AS `itemFk`,
- `s`.`quantity` AS `quantity`,
`s`.`isPicked` AS `isPicked`,
`s`.`reserved` AS `reserved`,
`t`.`refFk` AS `refFk`,
`s`.`id` AS `saleFk`,
`s`.`ticketFk` AS `ticketFk`
FROM (
`vn`.`sale` `s`
JOIN `vn`.`ticket` `t` ON(`s`.`ticketFk` = `t`.`id`)
)
WHERE `s`.`quantity` <> 0