25 lines
687 B
MySQL
25 lines
687 B
MySQL
|
USE `vn`;
|
||
|
DROP procedure IF EXISTS `zoneGetShipped`;
|
||
|
|
||
|
DELIMITER $$
|
||
|
USE `vn`$$
|
||
|
CREATE DEFINER=`root`@`%` PROCEDURE `zoneGetShipped`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT, vWarehouseFk INT)
|
||
|
BEGIN
|
||
|
/**
|
||
|
* OBSOLETO usar zone_getShippedWarehouse
|
||
|
* Devuelve la mínima fecha de envía para cada warehouse
|
||
|
*
|
||
|
* @param vLanded La fecha de recepcion
|
||
|
* @param vAddressFk Id del consignatario
|
||
|
* @param vAgencyModeFk Id de la agencia
|
||
|
* @return tmp.zoneGetShipped
|
||
|
*/
|
||
|
CALL zone_getShippedWarehouse(vLanded, vAddressFk, vAgencyModeFk);
|
||
|
|
||
|
SELECT * FROM tmp.zoneGetShipped WHERE warehouseFk <> vWarehouseFk;
|
||
|
DROP TEMPORARY TABLE IF EXISTS tmp.zoneGetLanded;
|
||
|
END$$
|
||
|
|
||
|
DELIMITER ;
|
||
|
|