feat: refs #7564 Added proc
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
2a203926b9
commit
1e5fd8002c
|
@ -0,0 +1,24 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_setVolume`(
|
||||
vSelf INT
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Update the volume ticket
|
||||
*
|
||||
* @param vSelf Ticket id
|
||||
*/
|
||||
DECLARE vVolume DECIMAL(10,6);
|
||||
|
||||
SELECT SUM(s.quantity * ic.cm3delivery / 1000000) INTO vVolume
|
||||
FROM sale s
|
||||
JOIN ticket t ON t.id = s.ticketFk
|
||||
JOIN itemCost ic ON ic.itemFk = s.itemFk
|
||||
AND ic.warehouseFk = t.warehouseFk
|
||||
WHERE t.id = vSelf;
|
||||
|
||||
UPDATE ticket
|
||||
SET volume = vVolume
|
||||
WHERE id = vSelf;
|
||||
END$$
|
||||
DELIMITER ;
|
Loading…
Reference in New Issue