DROP VIEW VW_REPORTETARJETAS
GO
CREATE VIEW VW_REPORTETARJETAS
AS
SELECT 	C.DOCTYPEID,D.MINDES,C.NBRDOCUMENT,C.SITEID,A.NAME,
	C.CARDID,T.DESCR,C.NBRCARD,C.TOTCARDPEN,C.TOTCARDUSD,S.DATEPROCESALES
FROM (((OP_SALESCARD AS C JOIN OP_SALES AS S
      ON C.DOCTYPEID=S.DOCTYPEID AND C.NBRDOCUMENT=S.NBRDOCUMENT AND C.SITEID=S.SITEID) JOIN DOCTYPE AS D
      ON C.DOCTYPEID=D.DOCTYPEID) JOIN SITE AS A
      ON C.SITEID=A.SITEID) JOIN OP_CARD AS T
      ON C.CARDID=T.CARDID 


