salix/db/changes/10032-webZone/00-order_calcCatalogFromIte...

31 lines
759 B
MySQL
Raw Normal View History

2019-05-30 06:41:08 +00:00
DROP procedure IF EXISTS `hedera`.`order_calcCatalogFromItem`;
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `hedera`.`order_calcCatalogFromItem`(vSelf INT, vItem INT)
BEGIN
/**
* Gets the availability and prices for the given item
* using the order parameters.
*
* @param vSelf The order id
* @table tmp.item(itemFk)
* @return tmp.ticketCalculateItem
* @return tmp.ticketComponentPrice
* @return tmp.ticketComponent
* @return tmp.ticketLot
2019-06-04 07:14:42 +00:00
* @return tmp.zoneGetShipped
2019-05-30 06:41:08 +00:00
*/
DECLARE vDate DATE;
DECLARE vAddress INT;
DECLARE vAgencyMode INT;
SELECT date_send, address_id, agency_id
INTO vDate, vAddress, vAgencyMode
FROM `order`
WHERE id = vSelf;
CALL vn.catalog_calcFromItem(vDate, vAddress, vAgencyMode, vItem);
END$$
DELIMITER ;