2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`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 ;
|