From 4f66fc9ee7cf85d57f299fe5a38a327e08e2bfb7 Mon Sep 17 00:00:00 2001 From: adriano_g3 Date: Fri, 27 Nov 2026 14:30:33 -0300 Subject: [PATCH] NT 2026.002 v1.11 indica que o infProt pode receber de 0 a 5 cMsg/xMsg --- NFe.Classes/Protocolo/infProt.cs | 53 +++++++++++++++++++++++++++---- NFe.Classes/Protocolo/msgSefaz.cs | 8 +++++ 2 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 NFe.Classes/Protocolo/msgSefaz.cs diff --git a/NFe.Classes/Protocolo/infProt.cs b/NFe.Classes/Protocolo/infProt.cs index a7e22bca9..1a3ccf45f 100644 --- a/NFe.Classes/Protocolo/infProt.cs +++ b/NFe.Classes/Protocolo/infProt.cs @@ -1,8 +1,9 @@ -using System; -using System.Xml.Serialization; using DFe.Classes.Assinatura; using DFe.Classes.Flags; using DFe.Utils; +using System; +using System.Collections.Generic; +using System.Xml.Serialization; namespace NFe.Classes.Protocolo { @@ -61,7 +62,10 @@ public string ProxyDhRecbto /// public string xMotivo { get; set; } - [XmlElement(ElementName = "cMsg")] + #region Sera retirado futuramente + + //[XmlElement(ElementName = "cMsg")] + [XmlIgnore] public string ProxyccMsg { get @@ -79,15 +83,50 @@ public string ProxyccMsg cMsg = int.Parse(value); } } - [XmlIgnore] public int? cMsg { get; set; } - + [XmlIgnore] public string xMsg { get; set; } + #endregion + + /// + /// PR13 Grupo de informações para envio de mensagens do interesse da SEFAZ (Criado na NT 2018.005) + /// + [XmlElement("cMsg")] + public List msgCodigos { get; set; } + + [XmlElement("xMsg")] + public List msgDescricoes { get; set; } + + [XmlIgnore] + public List MensagensSefaz + { + get + { + var mensagens = new List(); + if (msgCodigos == null) + return mensagens; + for (int i = 0; i < msgCodigos.Count; i++) + { + mensagens.Add(new msgSefaz + { + cMsg = int.TryParse(msgCodigos[i], out int codigo) + ? codigo + : (int?)null, + + xMsg = msgDescricoes != null && + i < msgDescricoes.Count + ? msgDescricoes[i] + : null + }); + } + return mensagens; + } + } + /// - /// PR13 - Assinatura XML do grupo identificado pelo atributo “Id” - /// A decisão de assinar a mensagem fica a critério da UF interessada. + /// PR90 - Assinatura XML do grupo identificado pelo atributo “Id”, a decisão de assinar a mensagem fica a critério da UF interessada. /// public Signature Signature { get; set; } } diff --git a/NFe.Classes/Protocolo/msgSefaz.cs b/NFe.Classes/Protocolo/msgSefaz.cs new file mode 100644 index 000000000..c957efd19 --- /dev/null +++ b/NFe.Classes/Protocolo/msgSefaz.cs @@ -0,0 +1,8 @@ +namespace NFe.Classes.Protocolo +{ + public class msgSefaz + { + public int? cMsg { get; set; } + public string xMsg { get; set; } + } +}