﻿begin work;

UPDATE TBNFECONNECTION 
SET 
NFERECEIPT = 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeAutorizacao/NFeAutorizacao.asmx',
NFEREGRESS = 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeRetAutorizacao/NFeRetAutorizacao.asmx',
NFECANCELING = NULL,
NFECONSULTATION = 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx',
NFENULLIFY = 'https://nfe-homologacao.svrs.rs.gov.br/ws/nfeinutilizacao/nfeinutilizacao2.asmx',
NFESTATUS = 'https://nfe-homologacao.svrs.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx',
NFEEVENT = 'https://nfe-homologacao.svrs.rs.gov.br/ws/recepcaoevento/recepcaoevento.asmx'
WHERE AMBIENTTYPE = 2 
AND UF IN (12,27,16,53,25,32,33,24,11,14,42,28,17);

UPDATE TBNFECONNECTION
SET
NFEREGISTERCONSULT = 'https://cad.svrs.rs.gov.br/ws/cadconsultacadastro/cadconsultacadastro2.asmx',
CABVERSIONREGISTERCONSULT = 1.00
WHERE AMBIENTTYPE = 2 
AND UF IN (12,27,16,53,25,32,33,24,11,14,42,28,17);

-- SEFAZ do Rio Grande do Sul

UPDATE TBNFECONNECTION 
SET 
NFERECEIPT = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/NfeAutorizacao/NFeAutorizacao.asmx',
NFEREGRESS = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/NfeRetAutorizacao/NFeRetAutorizacao.asmx',
NFECANCELING = NULL,
NFECONSULTATION = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx',
NFENULLIFY = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/nfeinutilizacao/nfeinutilizacao2.asmx',
NFESTATUS = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx',
NFEEVENT = 'https://nfe-homologacao.sefazrs.rs.gov.br/ws/recepcaoevento/recepcaoevento.asmx'
WHERE AMBIENTTYPE = 2 
AND UF IN (43);

UPDATE TBNFECONNECTION
SET
NFEREGISTERCONSULT = 'https://cad.sefazrs.rs.gov.br/ws/cadconsultacadastro/cadconsultacadastro2.asmx',
CABVERSIONREGISTERCONSULT = 1.00
WHERE AMBIENTTYPE = 2 
AND UF IN (43);

----------------------------------------------------------------------------------------------

/* NOTA FISCAL ELETRÔNICA - PRODUÇÃO */

-- SEFAZ Virtual do Rio Grande do Sul

UPDATE TBNFECONNECTION 
SET 
NFERECEIPT = 'https://nfe.svrs.rs.gov.br/ws/NfeAutorizacao/NFeAutorizacao.asmx',
NFEREGRESS = 'https://nfe.svrs.rs.gov.br/ws/NfeRetAutorizacao/NFeRetAutorizacao.asmx',
NFECANCELING = NULL,
NFECONSULTATION = 'https://nfe.svrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx',
NFENULLIFY = 'https://nfe.svrs.rs.gov.br/ws/nfeinutilizacao/nfeinutilizacao2.asmx',
NFESTATUS = 'https://nfe.svrs.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx',
NFEEVENT = 'https://nfe.svrs.rs.gov.br/ws/recepcaoevento/recepcaoevento.asmx'
WHERE AMBIENTTYPE = 1
AND UF IN (12,27,16,53,25,32,33,24,11,14,42,28,17);

UPDATE TBNFECONNECTION
SET
NFEREGISTERCONSULT = 'https://cad.svrs.rs.gov.br/ws/cadconsultacadastro/cadconsultacadastro2.asmx',
CABVERSIONREGISTERCONSULT = 1.00
WHERE AMBIENTTYPE = 1
AND UF IN (12,27,16,53,25,32,33,24,11,14,42,28,17);

-- SEFAZ do Rio Grande do Sul

UPDATE TBNFECONNECTION 
SET 
NFERECEIPT = 'https://nfe.sefazrs.rs.gov.br/ws/NfeAutorizacao/NFeAutorizacao.asmx',
NFEREGRESS = 'https://nfe.sefazrs.rs.gov.br/ws/NfeRetAutorizacao/NFeRetAutorizacao.asmx',
NFECANCELING = NULL,
NFECONSULTATION = 'https://nfe.sefazrs.rs.gov.br/ws/NfeConsulta/NfeConsulta2.asmx',
NFENULLIFY = 'https://nfe.sefazrs.rs.gov.br/ws/nfeinutilizacao/nfeinutilizacao2.asmx',
NFESTATUS = 'https://nfe.sefazrs.rs.gov.br/ws/NfeStatusServico/NfeStatusServico2.asmx',
NFEEVENT = 'https://nfe.sefazrs.rs.gov.br/ws/recepcaoevento/recepcaoevento.asmx'
WHERE AMBIENTTYPE = 1
AND UF IN (43);

UPDATE TBNFECONNECTION
SET
NFEREGISTERCONSULT = 'https://cad.sefazrs.rs.gov.br/ws/cadconsultacadastro/cadconsultacadastro2.asmx',
CABVERSIONREGISTERCONSULT = 1.00
WHERE AMBIENTTYPE = 1
AND UF IN (43);

----------------------------------------------------------------------------------------------

/* CONHECIMENTO DE TRANSPORTE ELETRÔNICO - HOMOLOGAÇÃO */

UPDATE TBCTECONNECTION 
SET 
CTERECEIPT = 'https://cte-homologacao.svrs.rs.gov.br/ws/cterecepcao/CteRecepcao.asmx',
CTEREGRESS = 'https://cte-homologacao.svrs.rs.gov.br/ws/cteretrecepcao/cteRetRecepcao.asmx',
CTECANCELING = NULL,
CTECONSULTATION = 'https://cte-homologacao.svrs.rs.gov.br/ws/cteconsulta/CteConsulta.asmx',
CTENULLIFY = 'https://cte-homologacao.svrs.rs.gov.br/ws/cteinutilizacao/cteinutilizacao.asmx',
CTESTATUS = 'https://cte-homologacao.svrs.rs.gov.br/ws/ctestatusservico/CteStatusServico.asmx',
CTEEVENT = 'https://cte-homologacao.svrs.rs.gov.br/ws/cterecepcaoevento/cterecepcaoevento.asmx'
WHERE AMBIENTTYPE = 2 
AND UF IN (12,27,13,29,23,53,32,52,21,15,25,22,33,24,11,42,28,17);

----------------------------------------------------------------------------------------------

/* CONHECIMENTO DE TRANSPORTE ELETRÔNICO - PRODUÇÃO */

UPDATE TBCTECONNECTION 
SET 
CTERECEIPT = 'https://cte.svrs.rs.gov.br/ws/cterecepcao/CteRecepcao.asmx',
CTEREGRESS = 'https://cte.svrs.rs.gov.br/ws/cteretrecepcao/cteRetRecepcao.asmx',
CTECANCELING = NULL,
CTECONSULTATION = 'https://cte.svrs.rs.gov.br/ws/cteconsulta/CteConsulta.asmx',
CTENULLIFY = 'https://cte.svrs.rs.gov.br/ws/cteinutilizacao/cteinutilizacao.asmx',
CTESTATUS = 'https://cte.svrs.rs.gov.br/ws/ctestatusservico/CteStatusServico.asmx',
CTEEVENT = 'https://cte.svrs.rs.gov.br/ws/cterecepcaoevento/cterecepcaoevento.asmx'
WHERE AMBIENTTYPE = 1
AND UF IN (12,27,13,29,23,53,32,52,21,15,25,22,33,24,11,42,28,17);

----------------------------------------------------------------------------------------------

/* MANIFESTO ELETRÔNICO DE DOCUMENTOS - HOMOLOGAÇÃO */

UPDATE TBMDFECONNECTION 
SET 
MDFERECEIPT = 'https://mdfe-homologacao.svrs.rs.gov.br/ws/MDFerecepcao/MDFeRecepcao.asmx',
MDFEREGRESS = 'https://mdfe-homologacao.svrs.rs.gov.br/ws/MDFeRetRecepcao/MDFeRetRecepcao.asmx',
MDFECONSULTATION = 'https://mdfe-homologacao.svrs.rs.gov.br/ws/MDFeConsulta/MDFeConsulta.asmx',
MDFESTATUS = 'https://mdfe-homologacao.svrs.rs.gov.br/ws/MDFeStatusServico/MDFeStatusServico.asmx',
MDFEEVENT = 'https://mdfe-homologacao.svrs.rs.gov.br/ws/MDFeRecepcaoEvento/MDFeRecepcaoEvento.asmx'
WHERE AMBIENTTYPE = 2;

----------------------------------------------------------------------------------------------

/* MANIFESTO ELETRÔNICO DE DOCUMENTOS - PRODUÇÃO */

UPDATE TBMDFECONNECTION 
SET 
MDFERECEIPT = 'https://mdfe.svrs.rs.gov.br/ws/MDFerecepcao/MDFeRecepcao.asmx',
MDFEREGRESS = 'https://mdfe.svrs.rs.gov.br/ws/MDFeRetRecepcao/MDFeRetRecepcao.asmx',
MDFECONSULTATION = 'https://mdfe.svrs.rs.gov.br/ws/MDFeConsulta/MDFeConsulta.asmx',
MDFESTATUS = 'https://mdfe.svrs.rs.gov.br/ws/MDFeStatusServico/MDFeStatusServico.asmx',
MDFEEVENT = 'https://mdfe.svrs.rs.gov.br/ws/MDFeRecepcaoEvento/MDFeRecepcaoEvento.asmx'
WHERE AMBIENTTYPE = 1;

commit work;