salix/db/routines/vn/procedures/packingListPrinted.sql

14 lines
405 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`packingListPrinted`(ticketFk INT)
BEGIN
UPDATE vn2008.Movimientos_mark mm
JOIN vn2008.Movimientos m ON m.Id_Movimiento = mm.Id_Movimiento
SET mm.valor = 2 -- Impreso
WHERE mm.valor = 1 -- Listo para imprimir
AND mm.stateFk = 9 -- Encajando
AND m.Id_Ticket = ticketFk;
END$$
DELIMITER ;