-- mejora en PAC 3, Comp Pago

This commit is contained in:
2022-06-23 17:08:44 -07:00
parent 7eb499354f
commit 0f3cc47471

View File

@@ -600,7 +600,6 @@ Public Class Timbrado
Dim Clave As String = Empresa.ContraseñaKey
Dim UrlServicio As String = "" ' Produccion
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
@@ -1138,10 +1137,10 @@ Public Class Timbrado
Equivalencia = 1
'condiciones especiales para el pago en pesos, facturas en moneda extranjera
ElseIf MonedaPago = "MXN" AndAlso VentaAbreviaturaSAT <> "MXN" Then
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
Equivalencia = (1 / VentaTipoCambio).RoundSQL(6)
VentaTipoCambio = Math.Round(VentaTipoCambio, 6)
Equivalencia = Math.Round((1 / VentaTipoCambio), 6)
ElseIf MonedaPago = "USD" AndAlso VentaAbreviaturaSAT <> "USD" Then
VentaTipoCambio = VentaTipoCambio.RoundSQL(6)
VentaTipoCambio = Math.Round(VentaTipoCambio, 6)
Equivalencia = VentaTipoCambio
End If
@@ -1167,8 +1166,8 @@ Public Class Timbrado
.TasaOCuota = drp("PorcentajeImpuesto").ToString().ToDecimal,
.Impuesto = drp("TipoImpuesto").ToString,
.Importe = drp("Importe").ToString().ToDecimal.RoundSQL,
.BaseMN = (drp("Base").ToString.ToDecimal / Equivalencia).RoundSQL(2),
.ImporteMN = (drp("Importe").ToString.ToDecimal / Equivalencia).RoundSQL(2)
.BaseMN = Math.Round((drp("Base").ToString.ToDecimal / Equivalencia), 2),
.ImporteMN = Math.Round((drp("Importe").ToString.ToDecimal / Equivalencia), 2)
}
)
@@ -2235,7 +2234,6 @@ Public Class Timbrado
Case 2
UrlServicio = "http://generacfdi.com.mx/rvltimbrado/service1.asmx?WSDL" 'productivo
Case 4
'UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
'UrlServicio = "http://alterno.gofac.com.mx/cfdi/timbrado.asmx?WSDL" ' alterno
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx?WSDL"
End Select
@@ -2260,7 +2258,7 @@ Public Class Timbrado
Case 4
UsuarioServicio = "UserTest"
ClaveServicio = "1234567890"
UrlServicio = "http://juancalderon-001-site1.ftempurl.com/timbrado.asmx?WSDL"
UrlServicio = "https://cfdi.gofac.com.mx/timbrado.asmx"
End Select
End If
@@ -4074,52 +4072,11 @@ Public Class Timbrado
#Region " Complemento Pago"
If ObjCFDITimbre.Comprobante.TipoComprobante = "P" Then
Dim ComPag = New Profact.TimbraCFDI40.Complementos.Pagos20.Pagos()
ComPag.Pago = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago(0) {}
ComPag.Pago(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago()
ComPag.Pago(0).FechaPago = ObjCFDITimbre.ComplementoPagos.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
ComPag.Pago(0).FormaDePagoP = ObjCFDITimbre.ComplementoPagos.FormaDePagoP
ComPag.Pago(0).MonedaP = ObjCFDITimbre.ComplementoPagos.MonedaP
ComPag.Pago(0).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
ComPag.Pago(0).TipoCambioP = ObjCFDITimbre.ComplementoPagos.TipoCambioP
ComPag.Pago(0).Monto = ObjCFDITimbre.ComplementoPagos.Monto
If ObjCFDITimbre.ComplementoPagos.NumOperacion <> "" Then
ComPag.Pago(0).NumOperacion = ObjCFDITimbre.ComplementoPagos.NumOperacion
End If
If ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd <> "" Then
ComPag.Pago(0).RfcEmisorCtaOrd = ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaOrd
End If
If ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt <> "" Then
ComPag.Pago(0).NomBancoOrdExt = ObjCFDITimbre.ComplementoPagos.NomBancoOrdExt
End If
If ObjCFDITimbre.ComplementoPagos.CtaOrdenante <> "" Then
ComPag.Pago(0).CtaOrdenante = ObjCFDITimbre.ComplementoPagos.CtaOrdenante
End If
If ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen <> "" Then
ComPag.Pago(0).RfcEmisorCtaBen = ObjCFDITimbre.ComplementoPagos.RfcEmisorCtaBen
End If
If ObjCFDITimbre.ComplementoPagos.CtaBeneficiario <> "" Then
ComPag.Pago(0).CtaBeneficiario = ObjCFDITimbre.ComplementoPagos.CtaBeneficiario
End If
If ObjCFDITimbre.ComplementoPagos.TipoCadPago <> "" Then
ComPag.Pago(0).TipoCadPagoSpecified = True
ComPag.Pago(0).TipoCadPago = ObjCFDITimbre.ComplementoPagos.TipoCadPago
End If
If ObjCFDITimbre.ComplementoPagos.CertPago <> "" Then
ComPag.Pago(0).CertPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.CertPago).ToString()
End If
If ObjCFDITimbre.ComplementoPagos.CadPago <> "" Then
ComPag.Pago(0).CadPago = ObjCFDITimbre.ComplementoPagos.CadPago
End If
If ObjCFDITimbre.ComplementoPagos.SelloPago <> "" Then
ComPag.Pago(0).SelloPago = System.Text.Encoding.Default.GetBytes(ObjCFDITimbre.ComplementoPagos.SelloPago).ToString()
End If
If ObjCFDITimbre.ComplementoPagos20.ComplementoPagos.Count > 0 Then
If ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count > 0 Then
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales()
'Totales Generales
Dim Totales As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosTotales() 'Totales Generales
Totales.MontoTotalPagos = ObjCFDITimbre.ComplementoPagos20.MontoTotalPagos.RoundSQL
@@ -4137,6 +4094,7 @@ Public Class Timbrado
Totales.TotalTrasladosBaseIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0
Totales.TotalTrasladosImpuestoIVA0 = 0
Totales.TotalTrasladosImpuestoIVA0Specified = Totales.TotalTrasladosBaseIVA0 > 0 ' si hay base > 0, debe de ponerse aunque sea en cero
If ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS > 0 Then
Totales.TotalRetencionesIEPS = ObjCFDITimbre.ComplementoPagos20.TotalRetencionesIEPS.RoundSQL
Totales.TotalRetencionesIEPSSpecified = True
@@ -4144,105 +4102,141 @@ Public Class Timbrado
Totales.TotalRetencionesIEPSSpecified = False
End If
Dim ComPag = New Profact.TimbraCFDI40.Complementos.Pagos20.Pagos()
ComPag.Totales = Totales
ComPag.Pago = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago(ObjCFDITimbre.ComplementoPagos20.ComplementoPagos.Count - 1) {}
Dim ii As Integer = 0
For Each docp As CFDIComplementoPago In ObjCFDITimbre.ComplementoPagos20.ComplementoPagos
ComPag.Pago(0).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados.Count - 1) {}
Dim i As Integer
For Each doc As CFDIComplementoPagosDocsRelacionados In ObjCFDITimbre.ComplementoPagos.DocumentosRelacionados
ComPag.Pago(0).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
ComPag.Pago(0).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
If Not String.IsNullOrEmpty(doc.Serie) Then
ComPag.Pago(0).DoctoRelacionado(i).Serie = doc.Serie
ComPag.Pago(ii) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPago()
ComPag.Pago(ii).FechaPago = docp.FechaPago.ToString("yyyy-MM-ddTHH:mm:ss").ToDate()
ComPag.Pago(ii).FormaDePagoP = docp.FormaDePagoP
ComPag.Pago(ii).MonedaP = docp.MonedaP
ComPag.Pago(ii).TipoCambioPSpecified = True 'If(ObjCFDITimbre.ComplementoPagos.MonedaP = "MXN", False, True)
ComPag.Pago(ii).TipoCambioP = docp.TipoCambioP
ComPag.Pago(ii).Monto = docp.Monto
If docp.NumOperacion <> "" Then ComPag.Pago(ii).NumOperacion = docp.NumOperacion
If docp.RfcEmisorCtaOrd <> "" Then ComPag.Pago(ii).RfcEmisorCtaOrd = docp.RfcEmisorCtaOrd
If docp.NomBancoOrdExt <> "" Then ComPag.Pago(ii).NomBancoOrdExt = docp.NomBancoOrdExt
If docp.CtaOrdenante <> "" Then ComPag.Pago(ii).CtaOrdenante = docp.CtaOrdenante
If docp.RfcEmisorCtaBen <> "" Then ComPag.Pago(ii).RfcEmisorCtaBen = docp.RfcEmisorCtaBen
If docp.CtaBeneficiario <> "" Then ComPag.Pago(ii).CtaBeneficiario = docp.CtaBeneficiario
If docp.TipoCadPago <> "" Then
ComPag.Pago(ii).TipoCadPagoSpecified = True
ComPag.Pago(ii).TipoCadPago = docp.TipoCadPago
End If
ComPag.Pago(0).DoctoRelacionado(i).Folio = doc.Folio
ComPag.Pago(0).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
ComPag.Pago(0).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpPagadoSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR.RoundSQL(6)
ComPag.Pago(0).DoctoRelacionado(i).EquivalenciaDRSpecified = True
ComPag.Pago(0).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
If doc.Impuestos IsNot Nothing Then
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR
If docp.CertPago <> "" Then ComPag.Pago(ii).CertPago = System.Text.Encoding.Default.GetBytes(docp.CertPago).ToString()
''retenciones
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
If docp.CadPago <> "" Then ComPag.Pago(ii).CadPago = docp.CadPago
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
If docimp.TrasladooRetencion = "R" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR
Tra.BaseDR = docimp.Base.RoundSQL(2)
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra
End If
j += 1
If docp.SelloPago <> "" Then ComPag.Pago(ii).SelloPago = System.Text.Encoding.Default.GetBytes(docp.SelloPago).ToString()
ComPag.Pago(ii).DoctoRelacionado = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado(docp.DocumentosRelacionados.Count - 1) {}
Dim i As Integer
For Each doc As CFDIComplementoPagosDocsRelacionados In docp.DocumentosRelacionados
ComPag.Pago(ii).DoctoRelacionado(i) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionado()
ComPag.Pago(ii).DoctoRelacionado(i).IdDocumento = doc.IdDocumento
If Not String.IsNullOrEmpty(doc.Serie) Then
ComPag.Pago(ii).DoctoRelacionado(i).Serie = doc.Serie
End If
ComPag.Pago(ii).DoctoRelacionado(i).Folio = doc.Folio
ComPag.Pago(ii).DoctoRelacionado(i).MonedaDR = doc.MonedaDR
ComPag.Pago(ii).DoctoRelacionado(i).NumParcialidad = doc.NumParcialidad.ToString
ComPag.Pago(ii).DoctoRelacionado(i).ImpSaldoAnt = doc.ImpSaldoAnt.RoundSQL
ComPag.Pago(ii).DoctoRelacionado(i).ImpPagadoSpecified = True
ComPag.Pago(ii).DoctoRelacionado(i).ImpPagado = doc.ImpPagado.RoundSQL
ComPag.Pago(ii).DoctoRelacionado(i).ImpSaldoInsoluto = doc.ImpSaldoInsoluto.RoundSQL
ComPag.Pago(ii).DoctoRelacionado(i).EquivalenciaDR = doc.EquivalenciaDR.RoundSQL(6)
ComPag.Pago(ii).DoctoRelacionado(i).EquivalenciaDRSpecified = True
ComPag.Pago(ii).DoctoRelacionado(i).ObjetoImpDR = doc.ObjetoImpuesto
If doc.Impuestos IsNot Nothing Then
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDR
''retenciones
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "R").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.RetencionesDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R").Count - 1) {}
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "R")
If docimp.TrasladooRetencion = "R" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRRetencionDR
Tra.BaseDR = docimp.Base.RoundSQL(2)
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.RetencionesDR(j) = Tra
End If
j += 1
Next
End If
''traslados
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
If docimp.TrasladooRetencion = "T" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR
Tra.BaseDR = docimp.Base.RoundSQL(2)
Tra.ImporteDRSpecified = True
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDRSpecified = True
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
ComPag.Pago(ii).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra
End If
j += 1
Next
End If
End If
i += 1
Next
If docp.Retenciones.Count > 0 OrElse docp.Traslados.Count > 0 Then
ComPag.Pago(ii).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(ii).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
If docp.Retenciones.Count > 0 Then
Dim x As Integer
ComPag.Pago(ii).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP(docp.Retenciones.Count - 1) {}
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
ComPag.Pago(ii).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.ImporteMN
x += 1
Next
End If
''traslados
If (doc.Impuestos).Where(Function(x) x.TrasladooRetencion = "T").Count > 0 Then
Dim j As Integer = 0
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR(doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T").Count - 1) {}
For Each docimp As CFDIConceptosImpuestos In doc.Impuestos.Where(Function(x) x.TrasladooRetencion = "T")
If docimp.TrasladooRetencion = "T" Then
Dim Tra As New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoDoctoRelacionadoImpuestosDRTrasladoDR
Tra.BaseDR = docimp.Base.RoundSQL(2)
Tra.ImporteDRSpecified = True
Tra.ImporteDR = docimp.Importe.RoundSQL(2)
Tra.ImpuestoDR = docimp.Impuesto
Tra.TipoFactorDR = docimp.TipoFactor
Tra.TasaOCuotaDRSpecified = True
Tra.TasaOCuotaDR = docimp.TasaOCuota.RoundSQL(6)
ComPag.Pago(0).DoctoRelacionado(i).ImpuestosDR.TrasladosDR(j) = Tra
End If
j += 1
If docp.Traslados.Count > 0 Then
Dim x As Integer
ComPag.Pago(ii).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP(docp.Traslados.Count - 1) {}
For Each Tra As CFDITraslados In (docp.Traslados)
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.ImporteMN.RoundSQL(6)
ComPag.Pago(ii).ImpuestosP(0).TrasladosP(x).BaseP = Tra.BaseMN.RoundSQL(2)
x += 1
Next
End If
End If
i += 1
Next
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 OrElse ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
ComPag.Pago(0).ImpuestosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP(0) {}
ComPag.Pago(0).ImpuestosP(0) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosP()
If (ObjCFDITimbre.ComplementoPagos.Retenciones).Count > 0 Then
Dim x As Integer
ComPag.Pago(0).ImpuestosP(0).RetencionesP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP((ObjCFDITimbre.ComplementoPagos.Retenciones).Count - 1) {}
For Each Ret As CFDIRetenciones In ObjCFDITimbre.ComplementoPagos.Retenciones
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPRetencionP()
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImpuestoP = Ret.Impuesto
ComPag.Pago(0).ImpuestosP(0).RetencionesP(x).ImporteP = Ret.ImporteMN
x += 1
Next
End If
If ObjCFDITimbre.ComplementoPagos.Traslados.Count > 0 Then
Dim x As Integer
ComPag.Pago(0).ImpuestosP(0).TrasladosP = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP((ObjCFDITimbre.ComplementoPagos.Traslados).Count - 1) {}
For Each Tra As CFDITraslados In (ObjCFDITimbre.ComplementoPagos.Traslados)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x) = New Profact.TimbraCFDI40.Complementos.Pagos20.PagosPagoImpuestosPTrasladoP()
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImpuestoP = Tra.Impuesto
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TipoFactorP = Tra.TipoFactor
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).TasaOCuotaP = Tra.TasaOCuota.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).ImporteP = Tra.ImporteMN.RoundSQL(6)
ComPag.Pago(0).ImpuestosP(0).TrasladosP(x).BaseP = Tra.BaseMN.RoundSQL(2)
x += 1
Next
End If
End If
Dim nsComp As New System.Xml.Serialization.XmlSerializerNamespaces()
nsComp.Add("pago20", "http://www.sat.gob.mx/Pagos20")
Dim xmlComp As String = Profact.TimbraCFDI.XMLUtilerias.SerializaObjeto(ComPag, GetType(Profact.TimbraCFDI40.Complementos.Pagos20.Pagos), nsComp)