From 5f047e989ebbb6835770a722a8096cbcd0897823 Mon Sep 17 00:00:00 2001 From: Joao Gabriel Date: Thu, 13 Feb 2025 16:53:25 -0400 Subject: [PATCH 1/3] =?UTF-8?q?Inclus=C3=A3o=20do=20Texto=20de=20dezenas?= =?UTF-8?q?=20do=20MS=20Nota=20Premiada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs index 2640ce3f1..e87892fc5 100644 --- a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs +++ b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs @@ -568,6 +568,22 @@ private void GerarNfCe(Graphics graphics) int dataAutorizacaoX = (larguraLinha - dataAutorizacao.Medida.Largura) / 2; dataAutorizacao.Desenhar(dataAutorizacaoX, _y); _y += dataAutorizacao.Medida.Altura; + + if (_proc.protNFe.infProt.xMsg != null) + { + var dezenas = new AdicionarTexto(g, _proc.protNFe.infProt.xMsg.ToString(), 7); + var quebraLinhaDezenas = new DefineQuebraDeLinha( + dezenas, + new ComprimentoMaximo(larguraLinhaMargemDireita), + dezenas.Medida.Largura + ); + + dezenas = quebraLinhaDezenas.DesenharComQuebras(g); + + int dezenasX = (larguraLinha - dezenas.Medida.Largura) / 2; + dezenas.Desenhar(dezenasX, _y); + _y += dezenas.Medida.Altura; + } } if (_nfe.infNFe.ide.tpEmis != TipoEmissao.teNormal) From 9ff5ae59e781a5559cdc5008f94ac9fa93917dab Mon Sep 17 00:00:00 2001 From: Joao Gabriel Date: Sat, 15 Feb 2025 07:52:09 -0400 Subject: [PATCH 2/3] =?UTF-8?q?Corre=C3=A7=C3=A3o=20na=20descri=C3=A7?= =?UTF-8?q?=C3=A3o=20da=20via=20de=20conting=C3=AAncia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs index e87892fc5..d67d2df1f 100644 --- a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs +++ b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs @@ -74,7 +74,7 @@ public class DanfeNativoNfce public DanfeNativoNfce(string xml, VersaoQrCode versaoQrCode, byte[] logo, string cIdToken, string csc, decimal troco = decimal.Zero, decimal totalPago = decimal.Zero, string font = null, bool viaEstabelecimento = false) { - Inicializa(xml, versaoQrCode, logo, cIdToken, csc, troco, totalPago, font); + Inicializa(xml, versaoQrCode, logo, cIdToken, csc, troco, totalPago, font, viaEstabelecimento); } private void Inicializa(string xml, VersaoQrCode versaoQrCode, byte[] logo, string cIdToken, string csc, decimal troco, decimal totalPago, string font = null, bool viaEstabelecimento = false, string fontPadrao = "") From b373cd5cab6646df7754462aae87da78596ed58e Mon Sep 17 00:00:00 2001 From: Joao Gabriel Date: Wed, 5 Mar 2025 09:22:16 -0400 Subject: [PATCH 3/3] wip --- NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs index d67d2df1f..238552a2b 100644 --- a/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs +++ b/NFe.Danfe.Nativo/NFCe/DanfeNativoNfce.cs @@ -71,10 +71,12 @@ public class DanfeNativoNfce private decimal _totalPago; private int _y; private VersaoQrCode _versaoQrCode; + private string creditos = String.Empty; - public DanfeNativoNfce(string xml, VersaoQrCode versaoQrCode, byte[] logo, string cIdToken, string csc, decimal troco = decimal.Zero, decimal totalPago = decimal.Zero, string font = null, bool viaEstabelecimento = false) + public DanfeNativoNfce(string xml, VersaoQrCode versaoQrCode, byte[] logo, string cIdToken, string csc, decimal troco = decimal.Zero, decimal totalPago = decimal.Zero, string font = null, bool viaEstabelecimento = false, string creditos = null) { Inicializa(xml, versaoQrCode, logo, cIdToken, csc, troco, totalPago, font, viaEstabelecimento); + this.creditos = creditos; } private void Inicializa(string xml, VersaoQrCode versaoQrCode, byte[] logo, string cIdToken, string csc, decimal troco, decimal totalPago, string font = null, bool viaEstabelecimento = false, string fontPadrao = "") @@ -645,6 +647,20 @@ private void GerarNfCe(Graphics graphics) _y += observacao.Medida.Altura; } + + + if (!string.IsNullOrEmpty(this.creditos)) + { + LinhaHorizontal(g, x, _y, larguraLinha); + + var creditos = new AdicionarTexto(g, this.creditos, 7); + var quebraCredito = new DefineQuebraDeLinha(creditos, + new ComprimentoMaximo(larguraLinhaMargemDireita), creditos.Medida.Largura); + creditos = quebraCredito.DesenharComQuebras(g); + creditos.Desenhar(x, _y); + + _y += creditos.Medida.Altura; + } } private void AdicionaFormaPagamento(int x, int larguraLinhaMargemDireita, Graphics g, FormaPagamento? formaPagamento, decimal? vPag)