22 lines
541 B
SQL
22 lines
541 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`entry_getRate`(vSelf INT)
|
|
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 ;
|