select A.NFCE, A.NUMEROSERIE, A.id_produto, A.ABREVIA, P.NCM, I.codigo, I.descricao from movdiario A inner join cupons B on A.NFCE = B.nfce and A.numeroserie = B.numeroserie inner join produto P on A.ID_PRODUTO = P.CODITEM left join cargatributariaIbpt I on P.NCM = I.codigo where B.TIPO = 'RV - CUPOM FISCAL' and B.CSTAT not in (100,101,102) and A.nfce > 0 and (A.SITUACAO = '' or A.situacao = ' ' or A.situacao is null) and I.codigo is null