DROP PROCEDURE IN_CopiaDetalleMovimientoProc
GO
CREATE PROCEDURE IN_CopiaDetalleMovimientoProc
(	@CORRNBR int,
	@SITEID UD_IDSITE,
	@BATNBR  char(10)
)
AS
BEGIN    
	BEGIN TRAN
	DECLARE   @ERROR	integer


       INSERT 	INTO 	TMP_IN_INTRAITEM(CORRNBR,SITEID,TYPEDOCID,SEQUENCE,INVTIDSKU,INVTIDBARR,QTY,TAXIGV,STDCOSTPEN,STDCOSTUSD,STKFISI,INTRDATE,INTRDATEPROCE,RLSED,TAXISC)
		SELECT 	@CORRNBR,SITEID,TYPEDOCID,SEQUENCE,INVTIDSKU,INVTIDBARR,QTY,TAXIGV,STDCOSTPEN,STDCOSTUSD,STKFISI,INTRDATE,INTRDATEPROCE,RLSED,TAXISC
		FROM	IN_INTRAITEM
		WHERE	BATNBR=@BATNBR AND SITEID=@SITEID

	IF (@@error!=0 OR @@ROWCOUNT=0 )
    	BEGIN
		ROLLBACK  
      		RETURN(1)
    	END
  COMMIT TRAN
  RETURN (0)

END
