salix/db/routines/vn2008/views/item_out.sql

18 lines
506 B
MySQL
Raw Normal View History

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn2008`.`item_out`
AS SELECT `t`.`warehouse_id` AS `warehouse_id`,
`t`.`Fecha` AS `dat`,
`m`.`Id_Article` AS `item_id`,
- `m`.`Cantidad` AS `amount`,
`m`.`OK` AS `ok`,
`m`.`Reservado` AS `Reservado`,
`t`.`Factura` AS `invoice`,
`m`.`Id_Movimiento` AS `saleFk`,
`m`.`Id_Ticket` AS `ticketFk`
FROM (
`vn2008`.`Movimientos` `m`
JOIN `vn2008`.`Tickets` `t` ON(`m`.`Id_Ticket` = `t`.`Id_Ticket`)
)
WHERE `m`.`Cantidad` <> 0