Factures amb error al monitor que corresponen a operacions relacionades amb IGIC (Canaries) i que no s’hauríen d’enviar a hisenda:

select T1.DocDate,T1.DocNum,T1.DocEntry,T0.AbsEntry,T0.ActStatus from ECM2 T0
join OINV T1 on T1.DocEntry=T0.SrcObjAbs and T0.SrcObjType='13'
where T0.ActStatus<>'O' and ((SELECT Count(*) FROM INV1 WHERE INV1.DocEntry=T1.DocEntry and INV1.VatGroup like '_IGI%')>0)
--select T1.DocDate,T1.DocNum,T1.DocEntry,T0.AbsEntry,T0.ActStatus 
update T0 set ActStatus='O',ActMessage='IGIC: No enviar'
from ECM2 T0
join ORIN T1 on T1.DocEntry=T0.SrcObjAbs and T0.SrcObjType='14'
where T0.ActStatus<>'O' and ((SELECT Count(*) FROM RIN1 T2 WHERE T2.DocEntry=T1.DocEntry and T2.VatGroup like '_IGI%')>0)

 

image_pdf