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

CREATE PROCEDURE SP_GESTAOWEB_DETALHES_CUPOMFISCAL(@CD_EMP INT,@CD_FILIAL INT,@CD_VD INT)
AS
BEGIN
    SELECT * FROM V_CUPOMFISCAL VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_ITEM VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_CARTAO VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_CREDIARIO VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_CHEQUE VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_PBM VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
    SELECT * FROM V_CUPOMFISCAL_VALE_COMPRA VD WHERE VD.CD_VD = @CD_VD AND VD.CD_FILIAL = @CD_FILIAL AND VD.CD_EMP = @CD_EMP
END