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`.`entry_cloneWithoutBuy`(vSelf INT, OUT vNewEntryFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Clona una entrada sin compras
|
|
|
|
*
|
|
|
|
* @param vSelf Identificador de vn.entry
|
|
|
|
* @param vNewEntryFk Identificador de la nueva entrada
|
|
|
|
*/
|
|
|
|
START TRANSACTION;
|
|
|
|
|
|
|
|
CALL entry_cloneHeader(vSelf, vNewEntryFk, NULL);
|
|
|
|
|
|
|
|
UPDATE entry d JOIN entry s ON s.id = vSelf
|
|
|
|
SET d.`reference` = s.`reference`,
|
|
|
|
d.loadPriority = s.loadPriority
|
|
|
|
WHERE d.id = vNewEntryFk;
|
|
|
|
|
|
|
|
COMMIT;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|