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`.`orderListVolume`(IN vOrderId INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
o.id,
|
|
|
|
o.itemFk,
|
|
|
|
i.description,
|
|
|
|
o.amount,
|
|
|
|
round(ic.cm3delivery * o.amount / 1000000,3) as volume
|
|
|
|
FROM hedera.orderRow o
|
|
|
|
JOIN item i ON i.id = o.itemFk
|
|
|
|
JOIN itemCost ic ON ic.itemFk = o.itemFk AND ic.warehouseFk = o.warehouseFk
|
|
|
|
WHERE o.orderFk = vOrderId;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|