2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `hedera`.`order_calcCatalog`(vSelf INT)
|
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Gets the availability and prices for order items.
|
|
|
|
*
|
|
|
|
* @param vSelf The order id
|
|
|
|
* @return tmp.ticketCalculateItem
|
|
|
|
* @return tmp.ticketComponentPrice
|
|
|
|
* @return tmp.ticketComponent
|
|
|
|
* @return tmp.ticketLot
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE IF EXISTS tmp.item;
|
|
|
|
CREATE TEMPORARY TABLE tmp.item
|
|
|
|
(PRIMARY KEY (itemFk))
|
|
|
|
ENGINE = MEMORY
|
|
|
|
SELECT itemFk FROM orderRow
|
|
|
|
WHERE orderFk = vSelf
|
|
|
|
GROUP BY itemFk;
|
|
|
|
|
2024-03-25 13:56:12 +00:00
|
|
|
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
|
2024-01-15 11:31:03 +00:00
|
|
|
|
|
|
|
DROP TEMPORARY TABLE tmp.item;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|