2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-08-20 08:06:10 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`entry_getRate`(vSelf INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Prepara una tabla con las tarifas aplicables en funcion de la fecha
|
|
|
|
* y el almacén
|
|
|
|
*
|
|
|
|
* @param vSelf Id de la tabla entry
|
|
|
|
* @return tmp.rate (rate0, rate1, rate2, rate3)
|
|
|
|
*/
|
|
|
|
DECLARE vDated DATE;
|
|
|
|
DECLARE vWarehouseFk INT;
|
|
|
|
|
|
|
|
SELECT t.landed, t.warehouseInFk INTO vDated, vWarehouseFk
|
|
|
|
FROM entry e
|
|
|
|
JOIN travel t ON t.id = e.travelFk
|
|
|
|
WHERE e.id = vSelf;
|
|
|
|
|
|
|
|
CALL rate_getPrices(vDated, vWarehouseFk);
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|