35 lines
667 B
MySQL
35 lines
667 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_recalc`()
|
||
|
BEGIN
|
||
|
/**
|
||
|
* Comprueba que las ventas creadas entre un rango de fechas tienen componentes
|
||
|
*
|
||
|
* @param vCreatedFrom inicio del rango
|
||
|
* @param vCreatedTo fin del rango
|
||
|
*/
|
||
|
DECLARE v_done BOOL DEFAULT FALSE;
|
||
|
DECLARE vEntryFk INTEGER;
|
||
|
|
||
|
DECLARE vCur CURSOR FOR
|
||
|
SELECT id FROM tmp.recalcEntryCommision;
|
||
|
|
||
|
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||
|
SET v_done = TRUE;
|
||
|
|
||
|
OPEN vCur;
|
||
|
|
||
|
l: LOOP
|
||
|
SET v_done = FALSE;
|
||
|
FETCH vCur INTO vEntryFk;
|
||
|
|
||
|
IF v_done THEN
|
||
|
LEAVE l;
|
||
|
END IF;
|
||
|
|
||
|
CALL vn2008.buy_tarifas_entry(vEntryFk);
|
||
|
END LOOP;
|
||
|
|
||
|
CLOSE vCur;
|
||
|
END$$
|
||
|
DELIMITER ;
|