FIS - Erro ao gerar arquivo para EFD Contribuições

Atualizado em: 14/02/2023

Problema
Ao gerar o arquivo para o EFD Contribuições (Livros Fiscais | Miscelânea | Arquivos Magnéticos | Sped Contribuições) ocorre o erro abaixo:

THREAD ERROR ([7340], , ) 09/02/2023 08:43:34 : Error : 102 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')'. Error : 156 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'AND'. Error : 102 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')'. Error : 156 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'AND'. Error : 102 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')'. Error : 156 (37000) (RC=-1) - [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'AND'. ( From tMSSQLConnection::GetQueryFile ) Thread ID [7572] User [] IO [5710] Tables [164] MaxTables [165] Comment [FISA001 - TCPIP - ThreadID(7340)] SP [ ] Traced [No] SQLReplay [No] InTran [No] DBEnv [MSSQL/PROTHEUS] DBThread [(SPID 1622,1672)] Started [09/02/2023 08:41:58] IP [192.168.0.X:XXXX] IDLE [ ] InTransact [ ] Memory [0] Running [ROP_QUERY for 0 s.] RCV [156360] SND [4146395] TCBuild [20210202-20210930] TCVersion [21.1.1.0] ARCH [64] OS [WINDOWS] BUILD [RELEASE] SELECT 'SD1' TABORI,N1_FILIAL,N1_CBASE,N1_ITEM,N1_CALCPIS,N3_CCONTAB,N3_CCUSTO,N3_CDEPREC,N1_DETPATR,N1_UTIPATR,N1_NFISCAL,N1_NSERIE,N1_FORNEC,N1_LOJA,N3_TIPO,N3_SEQ,N3_SEQREAV,N3_AQUISIC,N3_DINDEPR,N3_VORIG1,N1_QUANTD,N1_ITEM,N3_DLANCTO,N1_DESCRIC,SD1.R_E_C_N_O_ SD1RECNO,SN1.R_E_C_N_O_ SN1RECNO,N1_MESCPIS,N1_VLAQUIS,N1_NUMPRO,N1_INDPRO FROM SN1010 SN1 , SN3010 SN3 , SD1010 SD1 , SF4010 SF4 WHERE N1_FILIAL='01' AND N1_CALCPIS IN ('1','S','3') AND N1_CBASE >= '0000000' AND N1_CBASE <= 'ZZZZZZZZZ' AND N1_AQUISIC <= '20221231' AND SN1.D_E_L_E_T_=' ' AND N3_FILIAL= N1_FILIAL AND N3_CBASE=N1_CBASE AND N3_ITEM=N1_ITEM AND N3_TIPO IN () AND (N3_DTBAIXA > '20221231' OR N3_DTBAIXA = ' ') AND (N1_BAIXA > '20221231' OR N1_BAIXA = ' ') AND N3_SEQ = (SELECT MAX(N4_SEQ) N4_SEQ FROM SN4010 SN4 WHERE N4_FILIAL = SN3.N3_FILIAL AND N4_CBASE = SN3.N3_CBASE on _ATFREGF130(FISXATF.PRX) 04/11/2022 10:56:35 line : 1620

Solução
Esse erro foi corrigido com a liberação de uma atualização. Segue o link para download:

- Cross Segmentos - Backoffice Protheus - FIS - Arq.Magnéticos - Atualização do Ambiente Fiscal, Módulo 09