IF OBJECT_ID('SP_CUPOMNAOFISCAL_CONSULTAR') IS NOT NULL 
	DROP PROCEDURE SP_CUPOMNAOFISCAL_CONSULTAR 
GO 

CREATE PROCEDURE SP_CUPOMNAOFISCAL_CONSULTAR(@CD_EMP INT,@CD_FILIAL INT,@DT_CUPOM DATETIME,@CD_CX INT,@NR_CUPOM INT)
AS
BEGIN
	SELECT * FROM V_CUPOMNAOFISCAL WHERE CD_EMP = @CD_EMP AND CD_FILIAL = @CD_FILIAL AND DT_CUPOM = @DT_CUPOM AND CD_CX = @CD_CX AND NR_COO = @NR_CUPOM
	SELECT * FROM V_CUPOMNAOFISCAL_TEF WHERE CD_EMP = @CD_EMP AND CD_FILIAL = @CD_FILIAL AND DT_CUPOM = @DT_CUPOM AND CD_CX = @CD_CX AND NR_COO = @NR_CUPOM
	SELECT * FROM V_CUPOMNAOFISCAL_CHEQUE WHERE CD_EMP = @CD_EMP AND CD_FILIAL = @CD_FILIAL AND DT_CUPOM = @DT_CUPOM AND CD_CX = @CD_CX AND NR_COO = @NR_CUPOM
END