/****** Object:  StoredProcedure [dbo].[P_EST_PROD_TRANSF_CHECKIN_ENTRADA_AUTOMATICO]    Script Date: 02/27/2014 14:43:26 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[P_EST_PROD_TRANSF_CHECKIN_ENTRADA_AUTOMATICO]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[P_EST_PROD_TRANSF_CHECKIN_ENTRADA_AUTOMATICO]
GO
CREATE PROCEDURE P_EST_PROD_TRANSF_CHECKIN_ENTRADA_AUTOMATICO @CD_EMP INT, 
														 @CD_FILIAL INT, 
														 @CD_CTR INT 
with encryption 
AS

INSERT INTO EST_PROD_TRANSF_CHECKIN_ENTRADA
SELECT
	CD_EMP,
	CD_FILIAL,
	CD_CTR,
	CD_PROD,
	0
FROM
	EST_PROD_TRANSF_IT
WHERE
	EST_PROD_TRANSF_IT.CD_EMP = @CD_EMP
	AND EST_PROD_TRANSF_IT.CD_FILIAL= @CD_FILIAL
	AND EST_PROD_TRANSF_IT.CD_CTR= @CD_CTR