Recepcion y vinculacion facturas 4.0
This commit is contained in:
@@ -5935,7 +5935,7 @@ Public Class ClsPaginas
|
||||
Dim bdir As String = If(RutaReporte.Contains("Empresas"), ModExtensiones.DirectorioBaseEmpresas, AppDomain.CurrentDomain.BaseDirectory)
|
||||
|
||||
'TOMAR LA RUTA BASE PARA EL DIRECTORIO DE LA EMPRESA
|
||||
If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") Then
|
||||
If Not String.IsNullOrEmpty(RutaEmpresa) AndAlso Not RutaReporte.Contains("Grales") AndAlso Not RutaReporte.Contains("Contabilidad/Reportes/") Then
|
||||
bdir = RutaEmpresa.Replace($"{CveEmpresa}/", "")
|
||||
End If
|
||||
|
||||
|
||||
@@ -2078,7 +2078,7 @@ Public Class Timbrado
|
||||
|
||||
#Region "Impuestos"
|
||||
'SI NO ES FACTURA EN 0 AGREGA LOS IMPUESTOS
|
||||
If Ventas.Total <> 0 OrElse (ObjCFDITimbre.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.TotalImpuestosTrasladados > 0) Then
|
||||
If Ventas.Total <> 0 And (ObjCFDITimbre.TotalImpuestosRetenidos > 0 OrElse ObjCFDITimbre.TotalImpuestosTrasladados > 0) Then
|
||||
cfdi.Impuestos(ObjCFDITimbre.TotalImpuestosRetenidos, ObjCFDITimbre.TotalImpuestosTrasladados)
|
||||
End If
|
||||
#End Region
|
||||
@@ -2092,55 +2092,59 @@ Public Class Timbrado
|
||||
Next
|
||||
End If
|
||||
|
||||
''se acumulan los importes
|
||||
For Each Tras In ObjCFDITimbre.Traslados
|
||||
cfdi.Traslado(Tras.Impuesto, Tras.TipoFactor, Tras.TasaOCuota, Tras.Importe)
|
||||
Next
|
||||
|
||||
If ObjCFDITimbre.Traslados.Sum(Function(x) x.Importe) > 0 Then
|
||||
''se acumulan los importes
|
||||
For Each Tras In ObjCFDITimbre.Traslados
|
||||
cfdi.Traslado(Tras.Impuesto, Tras.TipoFactor, Tras.TasaOCuota, Tras.Importe)
|
||||
Next
|
||||
End If
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Impuestos Locales"
|
||||
|
||||
If ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe) > 0 OrElse ObjCFDITimbre.TrasladosLocales.Sum(Function(x) x.Importe) > 0 Then
|
||||
|
||||
cfdi.ImpuestosLocales(ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe), ObjCFDITimbre.TrasladosLocales.Sum(Function(x) x.Importe))
|
||||
cfdi.ImpuestosLocales(ObjCFDITimbre.RetencionesLocales.Sum(Function(x) x.Importe), ObjCFDITimbre.TrasladosLocales.Sum(Function(x) x.Importe))
|
||||
|
||||
For Each ret As CFDIRetencionesLocales In ObjCFDITimbre.RetencionesLocales
|
||||
If ret.Importe > 0 Then
|
||||
cfdi.RetencionLocal(ret.ImpuestoLocalRetenido, ret.TasaRetencion, ret.Importe)
|
||||
End If
|
||||
Next
|
||||
For Each ret As CFDIRetencionesLocales In ObjCFDITimbre.RetencionesLocales
|
||||
If ret.Importe > 0 Then
|
||||
cfdi.RetencionLocal(ret.ImpuestoLocalRetenido, ret.TasaRetencion, ret.Importe)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each ret As CFDITrasladosLocales In ObjCFDITimbre.TrasladosLocales
|
||||
If ret.Importe > 0 Then
|
||||
cfdi.TrasladoLocal(ret.ImpuestoLocalTraslado, ret.TasaTraslado, ret.Importe)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
For Each ret As CFDITrasladosLocales In ObjCFDITimbre.TrasladosLocales
|
||||
If ret.Importe > 0 Then
|
||||
cfdi.TrasladoLocal(ret.ImpuestoLocalTraslado, ret.TasaTraslado, ret.Importe)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If Ventas.CveComplementoTimbrado > 0 Then
|
||||
If Ventas.CveComplementoTimbrado > 0 Then
|
||||
|
||||
Select Case Ventas.CveComplementoTimbrado
|
||||
Case 5 'INE Proceso Ordinario Directivo Estatal"
|
||||
cfdi.Ine11("Ordinario", "Directivo Estatal", "0")
|
||||
Select Case Ventas.CveComplementoTimbrado
|
||||
Case 5 'INE Proceso Ordinario Directivo Estatal"
|
||||
cfdi.Ine11("Ordinario", "Directivo Estatal", "0")
|
||||
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, "")
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
Case 6 'INE Proceso Ordinario Ejecutivo Estatal"
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Estatal", "0")
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, "")
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
Case 6 'INE Proceso Ordinario Ejecutivo Estatal"
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Estatal", "0")
|
||||
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, "")
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
Case 7 'INE Proceso Ordinario Ejecutivo Nacional"
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, "")
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
Case 7 'INE Proceso Ordinario Ejecutivo Nacional"
|
||||
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Nacional", Ventas.ComplementoINE.INEIdContabilidad.ToString)
|
||||
Case 8 'INE PreCampaña
|
||||
cfdi.Ine11(Ventas.ComplementoINE.INETipoProceso, "", "0")
|
||||
cfdi.Ine11("Ordinario", "Ejecutivo Nacional", Ventas.ComplementoINE.INEIdContabilidad.ToString)
|
||||
Case 8 'INE PreCampaña
|
||||
cfdi.Ine11(Ventas.ComplementoINE.INETipoProceso, "", "0")
|
||||
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, Ventas.ComplementoINE.INETipoComite)
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
End Select
|
||||
cfdi.IneEntidad(Ventas.ComplementoINE.INEEntidad, Ventas.ComplementoINE.INETipoComite)
|
||||
cfdi.IneContabilidad(Ventas.ComplementoINE.INEIdContabilidad)
|
||||
End Select
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
@@ -2149,11 +2153,11 @@ Public Class Timbrado
|
||||
|
||||
#Region "Comercio Exterior"
|
||||
|
||||
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
|
||||
If Ventas.Cliente.AplicaComercioExterior And ObjCFDITimbre.Complementos.ComercioExterior11.AplicaComercioExteriorSubProyecto Then
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior11 IsNot Nothing Then
|
||||
|
||||
'DATOS GENERALES
|
||||
cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado,
|
||||
'DATOS GENERALES
|
||||
cfdi.ComercioExterior11(ObjCFDITimbre.Complementos.ComercioExterior11.MotivoTraslado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.TipoOperacion,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.ClavedePedimento,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.CertificadoOrigen,
|
||||
@@ -2164,9 +2168,9 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Observaciones,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.TipoCambioUSD,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.TotalUSD)
|
||||
'EMISOR
|
||||
cfdi.ComercioExterior11Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP))
|
||||
cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle,
|
||||
'EMISOR
|
||||
cfdi.ComercioExterior11Emisor(If(EmisorRFC.Length >= 12, "", ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CURP))
|
||||
cfdi.ComercioExterior11Domicilio(ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Colonia,
|
||||
@@ -2176,9 +2180,9 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Emisor.CP)
|
||||
'RECEPTOR
|
||||
cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
|
||||
cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
|
||||
'RECEPTOR
|
||||
cfdi.ComercioExterior11Receptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumRegIdTrib)
|
||||
cfdi.ComercioExterior11DomicilioReceptor(ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroExterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.NumeroInterior,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Colonia,
|
||||
@@ -2188,7 +2192,7 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Receptor.CP)
|
||||
cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib,
|
||||
cfdi.ComercioExterior11Destinatario(ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumRegIdTrib,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Nombre,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Calle,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.NumeroExterior,
|
||||
@@ -2200,35 +2204,35 @@ Public Class Timbrado
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Estado,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.Pais,
|
||||
ObjCFDITimbre.Complementos.ComercioExterior11.Destinatario.CP)
|
||||
'MERCANCIAS
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
|
||||
cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
|
||||
If concep.DescripcionesEspecificas.Marca <> "" Then
|
||||
cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
|
||||
'MERCANCIAS
|
||||
If ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias IsNot Nothing AndAlso ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias.Count > 0 Then
|
||||
For Each concep As CFDIComercioExterior11Mercancias In ObjCFDITimbre.Complementos.ComercioExterior11.Mercancias
|
||||
cfdi.ComercioExterior11Mercancia(concep.NoIdentificacion, concep.FraccionArancelaria, concep.CantidadAduana, concep.UnidadAduana, concep.ValorUnitarioAduana, concep.ValorDolares)
|
||||
If concep.DescripcionesEspecificas.Marca <> "" Then
|
||||
cfdi.ComercioExterior11MercanciaDescripcionesEspeciales(concep.DescripcionesEspecificas.Marca,
|
||||
concep.DescripcionesEspecificas.Modelo,
|
||||
concep.DescripcionesEspecificas.SubModelo,
|
||||
concep.DescripcionesEspecificas.NumeroSerie)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
#Region "C O M P L E M E N T O C A R T A P O R T E"
|
||||
|
||||
|
||||
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
|
||||
If ObjCFDITimbre.Complementos.CartaPorte IsNot Nothing Then
|
||||
|
||||
Dim Carta As CFDICartaPorte = ObjCFDITimbre.Complementos.CartaPorte
|
||||
|
||||
|
||||
@@ -1118,7 +1118,7 @@ Partial Class Compras_Compras
|
||||
CargaDatosAgregarPS()
|
||||
TieneAnticiposXML = False
|
||||
Modalidad = ""
|
||||
Version = "3.3"
|
||||
Version = "4.0"
|
||||
CveMetodoPago = -1
|
||||
RFCProv = ""
|
||||
CargaDdlTipoGasto()
|
||||
@@ -1638,7 +1638,7 @@ Partial Class Compras_Compras
|
||||
End Sub
|
||||
|
||||
Private Sub ValidaIVA()
|
||||
If Version <> "3.3" And CveCompra <= 0 Then
|
||||
If (Version <> "3.3" And Version <> "4.0") And CveCompra <= 0 Then
|
||||
Dim ImporteIVAXML As Double = (TxtSubTotal.Text.Trim.ToDouble - TxtDescuento.Text.Trim.ToDouble - TxtIEPS.Text.Trim.ToDouble) * 0.16
|
||||
If Math.Abs(TxtIVA.Text.Trim.ToDouble - ImporteIVAXML) >= 1 Then
|
||||
Alert("El <b>IVA</b> del <b>CFDi</b> no tiene un comportamiento normal, por favor verifique que sea correcto. <br /><br /> <b>NOTA:</b> Esta advertencia no aplica en casos de conceptos(alimentos, combustibles o servicios de comunicación) exentos de IVA o causantes de IEPS.", TipoMensaje.MsgAdvertencia)
|
||||
@@ -1743,15 +1743,29 @@ Partial Class Compras_Compras
|
||||
|
||||
CargaComprobanteXML(XMLDoc)
|
||||
|
||||
If NuevaValidacionXML = 1 Or Version = "3.3" Then
|
||||
If NuevaValidacionXML = 1 Or (Version = "3.3" Or Version = "4.0") Then
|
||||
Dim Xml As New StringBuilder
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
Dim Version = ValorXML(nodo, "version")
|
||||
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
Dim cfdVer As String = ""
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
|
||||
If Version = "3.2" Then
|
||||
Prefijo = "cfd"
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
ElseIf Version = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
@@ -1759,7 +1773,8 @@ Partial Class Compras_Compras
|
||||
|
||||
Dim nodeconceptos As XmlNode = XMLDoc.SelectSingleNode(String.Format("//{0}:Conceptos", Prefijo), namespaces)
|
||||
|
||||
Xml.Append(Replace(Replace(Replace(nodeconceptos.OuterXml, "<cfdi:", "<"), "</cfdi:", "</"), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", ""))
|
||||
Xml.Append(Replace(Replace(Replace(Replace(nodeconceptos.OuterXml, "<cfdi:", "<"), "</cfdi:", "</"), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/3""", ""), "xmlns:cfdi=""http://www.sat.gob.mx/cfd/4""", ""))
|
||||
|
||||
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml.ToString, UsuarioActual.CveEmpresa) Then
|
||||
TmpDT = ObjeFacturas.DtResultados
|
||||
TmpDT.Columns.Add("CveSATPSActualizado")
|
||||
@@ -1883,7 +1898,7 @@ Partial Class Compras_Compras
|
||||
Dim Msg As String = ""
|
||||
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
|
||||
ValidacionesTotalesXml()
|
||||
|
||||
@@ -3573,11 +3588,25 @@ Partial Class Compras_Compras
|
||||
'Dim DtPSTemp = TmpDT.Clone
|
||||
'Dim Row As DataRow = Nothing
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
Dim nodo As XmlNode = XMLDoc.DocumentElement
|
||||
Dim VersionCFDI As String = ValorXML(nodo, "version")
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = ""
|
||||
|
||||
If VersionCFDI = "3.2" Then
|
||||
Prefijo = "cfd"
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
ElseIf VersionCFDI = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
@@ -3714,7 +3743,7 @@ Partial Class Compras_Compras
|
||||
|
||||
'Alert(ValorXML(node, "ClaveProdServ").Trim)
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
If node IsNot Nothing AndAlso node.ChildNodes.Count > 0 Then
|
||||
'OBTENER TRASLADOS POR DETALLES
|
||||
Dim ContadorTraslado = 0
|
||||
@@ -5171,7 +5200,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
'ACTUALIZAR PRODUCTO/SERVICIO SAT
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
If Row("CveSATPSActualizado").ToString().ToEntero() = 1 Then
|
||||
If Not ObjProductosServicios.UpdateProductosServiciosSAT(Row("CvePS").ToString().ToEntero(), Row("CveSATPS").ToString().ToEntero(), UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
ErrorSATPS = True
|
||||
@@ -10833,7 +10862,7 @@ Partial Class Compras_Compras
|
||||
|
||||
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
Dim drm As DataRow = GlobalDTVtaMetodoPago.FiltroPrimero(String.Format("ClaveMetodoPagoSAT = '{0}'", ValorXML(nodo, "MetodoPago")))
|
||||
If drm IsNot Nothing Then
|
||||
CveMetodoPago = drm("CveMetodoPago").ToString.ToEntero
|
||||
@@ -10842,11 +10871,28 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
|
||||
|
||||
|
||||
|
||||
Dim Prefijo As String = If(XMLDoc.DocumentElement.Prefix = "", "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = ""
|
||||
|
||||
If Version = "3.2" Then
|
||||
Prefijo = "cfd"
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
ElseIf Version = "3.3" Then
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/3"
|
||||
|
||||
Else ' se considera que es la version 4.0
|
||||
cfdVer = "http://www.sat.gob.mx/cfd/4"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'If Prefijo.ToLower <> "cfdi" Then cfdVer = "http://www.sat.gob.mx/cfd/2"
|
||||
namespaces.AddNamespace(Prefijo, cfdVer)
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
namespaces.AddNamespace("implocal", "http://www.sat.gob.mx/implocal")
|
||||
@@ -10889,7 +10935,7 @@ Partial Class Compras_Compras
|
||||
|
||||
TotalRetenciones = ValorXML(node, "totalImpuestosRetenidos", "0").ToDecimal
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
|
||||
For Each retencion As XmlNode In nodeRetenciones
|
||||
If retencion.Attributes("Impuesto").Value = "002" Then
|
||||
@@ -10920,7 +10966,7 @@ Partial Class Compras_Compras
|
||||
TotalTraslados = ValorXML(node, "totalImpuestosTrasladados", "0").ToDecimal
|
||||
Dim nodeTraslados As XmlNodeList = XMLDoc.SelectNodes(String.Format("//{0}:Comprobante/{0}:Impuestos/{0}:Traslados/{0}:Traslado", Prefijo), namespaces)
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
|
||||
For Each traslado As XmlNode In nodeTraslados
|
||||
If traslado.Attributes("Impuesto").Value = "002" Then
|
||||
@@ -15639,7 +15685,7 @@ Partial Class Compras_Compras
|
||||
e.Row.FCLabel("LbEstatusInv").Text = "NA"
|
||||
End If
|
||||
|
||||
If Version = "3.3" Then
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
CargaPSSAT(e.Row.FCDropDownLost("DdlSATPS"))
|
||||
If e.Row.DBCampo("CveSATPS").ToEntero > 0 Then
|
||||
e.Row.FCDropDownLost("DdlSATPS").SelectedValue = e.Row.DBCampo("CveSATPS")
|
||||
@@ -18305,7 +18351,7 @@ Partial Class Compras_Compras
|
||||
Row("Consec") = TmpDT.Rows.Count + 1
|
||||
End If
|
||||
|
||||
If Version = "3.3" And CveSATPS > 0 Then
|
||||
If (Version = "3.3" Or Version = "4.0") And CveSATPS > 0 Then
|
||||
Dim DrPSSAT As DataRow = Nothing
|
||||
If CargaXml Then
|
||||
DrPSSAT = GlobalDTPSATPS("-1", CveSATPS.ToString).FiltroPrimero("")
|
||||
@@ -18362,7 +18408,7 @@ Partial Class Compras_Compras
|
||||
Row("NoDeducible") = NoDeducible
|
||||
|
||||
Row("PU") = Math.Round(PU, DecimalesPermitidos)
|
||||
If CargaXml And Version = "3.3" Then
|
||||
If CargaXml And (Version = "3.3" Or Version = "4.0") Then
|
||||
Row("IVA") = Math.Round(IVA, DecimalesPermitidos)
|
||||
Row("IVAPorcentaje") = PorcentajeIVA
|
||||
Row("RetIVA") = Math.Round(RetIVA, DecimalesPermitidos)
|
||||
|
||||
@@ -2845,6 +2845,8 @@ Partial Class Compras_eFacturas
|
||||
|
||||
Dim XMLDoc As New XmlDocument
|
||||
Dim Archivo As String = String.Format("{0}Compras\{1}\{2}", UsuarioActual.Empresa.Ruta, gvRow.DataKey("RFCDe"), gvRow.DataKey("XML"))
|
||||
|
||||
Dim Prefijo As String = ""
|
||||
If IO.File.Exists(Archivo) Then
|
||||
|
||||
|
||||
@@ -2855,12 +2857,27 @@ Partial Class Compras_eFacturas
|
||||
XMLDoc.LoadXml(SXML)
|
||||
|
||||
Dim Xml As New StringBuilder
|
||||
|
||||
|
||||
Dim namespaces As New XmlNamespaceManager(XMLDoc.NameTable)
|
||||
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
|
||||
Dim RootDocumento As XmlElement = XMLDoc.DocumentElement
|
||||
Dim VersionCFDI As String = ValorXML(RootDocumento, "version")
|
||||
|
||||
If VersionCFDI = "3.3" Then
|
||||
Prefijo = "pago10"
|
||||
namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/3")
|
||||
ElseIf VersionCFDI = "4.0" Then
|
||||
Prefijo = "pago20"
|
||||
namespaces.AddNamespace("pago20", "http://www.sat.gob.mx/Pagos20")
|
||||
namespaces.AddNamespace(XMLDoc.DocumentElement.Prefix, "http://www.sat.gob.mx/cfd/4")
|
||||
End If
|
||||
|
||||
|
||||
namespaces.AddNamespace("tfd", "http://www.sat.gob.mx/TimbreFiscalDigital")
|
||||
|
||||
' namespaces.AddNamespace("pago10", "http://www.sat.gob.mx/Pagos")
|
||||
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
@@ -2868,20 +2885,20 @@ Partial Class Compras_eFacturas
|
||||
|
||||
nodeTFD = nodeComp.SelectSingleNode(String.Format("//{0}:TimbreFiscalDigital", "tfd"), namespaces)
|
||||
|
||||
Dim PrefijoPagos As String = ""
|
||||
'Dim PrefijoPagos As String = ""
|
||||
|
||||
For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||
If nodoPrefijo.Prefix <> "tfd" And nodoPrefijo.Prefix.ToUpper.Contains("PAGO") Then
|
||||
PrefijoPagos = nodoPrefijo.Prefix
|
||||
End If
|
||||
Next
|
||||
'For Each nodoPrefijo As XmlNode In nodeComp.ChildNodes
|
||||
' If nodoPrefijo.Prefix <> "tfd" And nodoPrefijo.Prefix.ToUpper.Contains("PAGO") Then
|
||||
' PrefijoPagos = nodoPrefijo.Prefix
|
||||
' End If
|
||||
'Next
|
||||
|
||||
namespaces.AddNamespace(PrefijoPagos, "http://www.sat.gob.mx/Pagos")
|
||||
'namespaces.AddNamespace(PrefijoPagos, "http://www.sat.gob.mx/Pagos")
|
||||
nodeComp = XMLDoc.SelectSingleNode(String.Format("//{0}:Complemento", XMLDoc.DocumentElement.Prefix), namespaces)
|
||||
|
||||
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", PrefijoPagos), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
nodePagos = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos/{0}:Pago", Prefijo), namespaces)
|
||||
nodePagos2 = nodeComp.SelectSingleNode(String.Format("//{0}:Pagos", Prefijo), namespaces)
|
||||
|
||||
|
||||
|
||||
@@ -2923,7 +2940,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
Dim nodePagosN As XmlNodeList
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", PrefijoPagos), namespaces)
|
||||
nodePagosN = nodeComp.SelectNodes(String.Format("//{0}:Pagos", Prefijo), namespaces)
|
||||
|
||||
|
||||
For Each NodosPagos As XmlNode In nodePagosN
|
||||
@@ -2964,7 +2981,7 @@ Partial Class Compras_eFacturas
|
||||
MontoPago = Monto
|
||||
|
||||
Dim ObjCompraFolios As New ClsCompras
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{PrefijoPagos}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
If ObjCompraFolios.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace($"{Prefijo}:", ""), UsuarioActual.CveEmpresa, OP:=If(CveComplementoPagoCompra > 0, 2, 1), CveFactura:=CveFacturaComplemento) Then
|
||||
'
|
||||
'.GetCompararComplementoPago(gvRow.DataKey("CveProveedor").ToEntero, Monto, nodePagos2.InnerXml.Replace("pago10:", ""), UsuarioActual.CveEmpresa) Then
|
||||
If ObjCompraFolios.DtResultados.Rows.Count > 0 Then
|
||||
|
||||
@@ -1091,7 +1091,12 @@ Partial Class Contabilidad_RepBalanceGeneral
|
||||
'parametros a enviar al reporte
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
|
||||
|
||||
'LogoRuta = String.Format("file://{0}Formatos\Suc{1}.png", UsuarioActual.Empresa.Ruta, Vta.CveSucursal)
|
||||
|
||||
Dim RutaLogo As String = String.Format("file://{0}Logo.png", UsuarioActual.Empresa.Ruta)
|
||||
params.Add(New ReportParameter("pImg", RutaLogo))
|
||||
|
||||
params.Add(New ReportParameter("pFirma1", ""))
|
||||
params.Add(New ReportParameter("pFirma2", ""))
|
||||
params.Add(New ReportParameter("pFechaFin", FechaF))
|
||||
@@ -1125,7 +1130,10 @@ Partial Class Contabilidad_RepBalanceGeneral
|
||||
'parametros a enviar al reporte
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
|
||||
|
||||
Dim RutaLogo As String = String.Format("file://{0}Logo.png", UsuarioActual.Empresa.Ruta)
|
||||
params.Add(New ReportParameter("pImg", RutaLogo))
|
||||
'params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
|
||||
params.Add(New ReportParameter("pFechaFin", FechaF))
|
||||
params.Add(New ReportParameter("pSubtotal", DdlSubtotales.SelectedValue.ToString))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
@@ -1148,7 +1156,9 @@ Partial Class Contabilidad_RepBalanceGeneral
|
||||
'parametros a enviar al reporte
|
||||
Dim params As New List(Of ReportParameter)
|
||||
params.Add(New ReportParameter("pEmp", UsuarioActual.Empresa.Empresa))
|
||||
params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
|
||||
Dim RutaLogo As String = String.Format("file://{0}Logo.png", UsuarioActual.Empresa.Ruta)
|
||||
params.Add(New ReportParameter("pImg", RutaLogo))
|
||||
'params.Add(New ReportParameter("pImg", New Uri(Server.MapPath(String.Format("~/Empresas/{0}/Logo.png", UsuarioActual.CveEmpresa))).AbsoluteUri))
|
||||
params.Add(New ReportParameter("pFechaI", DdlEjercicio.SelectedValue))
|
||||
params.Add(New ReportParameter("UsuarioImprimio", UsuarioActual.Usuario))
|
||||
params.Add(New ReportParameter("FechaImpresion", Now.ToShortDateString))
|
||||
|
||||
Reference in New Issue
Block a user