- guardar en xml, para el PAC 3

This commit is contained in:
2023-07-06 17:54:05 -07:00
parent d61f8e4c8e
commit 13d30e98f3

View File

@@ -1,5 +1,5 @@
Option Explicit On
Option Strict On
'Option Strict On
Imports System.Data
Imports System.IO
@@ -1401,11 +1401,9 @@ Public Class Timbrado
If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") Then comprobante.CondicionesDePago = ObjCFDITimbre.Comprobante.CondicionesdePago
comprobante.SubTotal = ObjCFDITimbre.Comprobante.SubTotal.RoundSQL(NumDecimalesImporte)
If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") Then
If ObjCFDITimbre.Comprobante.Descuentos > 0 Then
comprobante.DescuentoSpecified = True
comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos.RoundSQL(NumDecimalesImporte)
End If
If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") AndAlso ObjCFDITimbre.Comprobante.Descuentos > 0 Then
comprobante.DescuentoSpecified = True
comprobante.Descuento = ObjCFDITimbre.Comprobante.Descuentos.RoundSQL(NumDecimalesImporte)
End If
comprobante.Moneda = ObjCFDITimbre.Comprobante.Moneda
comprobante.TipoCambio = ObjCFDITimbre.Comprobante.TipoCambio.ToDecimal
@@ -1474,11 +1472,9 @@ Public Class Timbrado
comprobante.Conceptos(i).ClaveProdServ = concep.ClaveProdServ
comprobante.Conceptos(i).ObjetoImp = concep.ObjetoImpuesto
If ObjCFDITimbre.Comprobante.TipoComprobante <> "P" Then
If concep.Descuento > 0 Then
comprobante.Conceptos(i).Descuento = concep.Descuento
comprobante.Conceptos(i).DescuentoSpecified = True
End If
If ObjCFDITimbre.Comprobante.TipoComprobante.Contiene("I", "E", "N") AndAlso concep.Descuento > 0 Then
comprobante.Conceptos(i).Descuento = concep.Descuento
comprobante.Conceptos(i).DescuentoSpecified = True
End If
If concep.Noidentificacion <> "" Then comprobante.Conceptos(i).NoIdentificacion = concep.Noidentificacion
@@ -2358,6 +2354,15 @@ Public Class Timbrado
swmili = sw.ElapsedMilliseconds
sw.Start()
Dim xmlPrevio As String
Using sww As New System.IO.StringWriter()
Dim xs As Object
xs = New System.Xml.Serialization.XmlSerializer(GetType(Profact.TimbraCFDI40.Comprobante))
xs.Serialize(sww, comprobante)
xmlPrevio = sww.ToString()
End Using
#Region "Timbra"
resultadoTimbre = cfdi.TimbraCFDI(comprobante)
#End Region
@@ -2461,6 +2466,8 @@ Public Class Timbrado
Else
Dim sbMsg As New StringBuilder
Dim sbMsgLog As New StringBuilder
sbMsgLog.Append(xmlPrevio)
sbMsgLog.Append("------------")
For Each msg In Resultados
sbMsg.AppendFormat("{0}.<br/>", msg("Value"))
sbMsgLog.AppendFormat("{0}-{1}<br/>", msg("Key"), msg("Value"))