salix/db/routines/srt/procedures/expedition_scan.sql

20 lines
449 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `srt`.`expedition_scan`(vSelf INT)
BEGIN
/* Actualiza el estado de una expedicion a OUT, al ser escaneada manualmente
*
* @param vSelf Identificador de srt.expedition
*
*/
UPDATE srt.expedition e
JOIN srt.expeditionState es ON es.description = 'OUT'
SET e.stateFk = es.id,
e.`position` = NULL,
e.bufferFk = NULL
WHERE e.id = vSelf;
END$$
DELIMITER ;