diff --git a/db/routines/vn/procedures/entryTransfer.sql b/db/routines/vn/procedures/entryTransfer.sql index b0d3c98e3..64c9b7680 100644 --- a/db/routines/vn/procedures/entryTransfer.sql +++ b/db/routines/vn/procedures/entryTransfer.sql @@ -12,13 +12,7 @@ BEGIN DECLARE vWarehouseFk INT; -- Clonar la entrada - CALL entry_clone(vOriginalEntry); - - SELECT id INTO vNewEntryFk - FROM entry - WHERE clonedFrom = vOriginalEntry - ORDER BY dated DESC - LIMIT 1; + CALL entry_clone(vOriginalEntry,vNewEntryFk); -- Hay que crear un nuevo travel, con salida hoy y llegada maƱana y asignar la entrada nueva al nuevo travel. INSERT INTO travel(