IF OBJECT_ID('V_PARCIAL_CANCELADOS') IS NOT NULL 
	DROP VIEW V_PARCIAL_CANCELADOS
GO

CREATE VIEW V_PARCIAL_CANCELADOS
AS
SELECT	SUM(TOT_IT)  AS TOTAL
FROM	PDV_VD_IT IT
INNER	JOIN PDV_VD VD
		ON IT.CD_EMP = VD.CD_EMP AND IT.CD_FILIAL = VD.CD_FILIAL AND VD.CD_VD = IT.CD_VD AND VD.DT_VD = IT.DT_VD
WHERE	VD.DT_VD = CONVERT(VARCHAR,GETDATE(),112)
		AND (VD.ST_VD != 0 OR (VD.ST_VD = 0 AND IT.ST_IT != 1))