Crm hasta punto de Reportes
This commit is contained in:
@@ -1769,7 +1769,7 @@ Partial Class Compras_Compras
|
||||
|
||||
If Validada And Not EnListadoEFOS Then
|
||||
Try
|
||||
XMLDoc.Load(Archivo)
|
||||
XMLDoc.LoadXml(File.ReadAllText(Archivo).Replace("<br>", "").Replace("<", ""))
|
||||
Catch ex As Exception
|
||||
Try
|
||||
Dim oReader = New StreamReader(Archivo, Encoding.GetEncoding("ISO-8859-1"))
|
||||
@@ -1820,13 +1820,21 @@ Partial Class Compras_Compras
|
||||
Xml = Xml.Replace(Chr(13), "") 'salto de linea
|
||||
Xml = Xml.Replace(Chr(10), "")
|
||||
Xml = Xml.Replace("<br />", "") 'salto de linea html
|
||||
Xml = Xml.Replace("<br>", "")
|
||||
Xml = Xml.Replace("<", "")
|
||||
|
||||
Xml = Xml.Replace("&", "") 'adicional, si hay otros
|
||||
|
||||
|
||||
If ObjeFacturas.GetFacturasComparacionXML(Version, Xml, UsuarioActual.CveEmpresa) Then
|
||||
TmpDT = ObjeFacturas.DtResultados
|
||||
TmpDT.Columns.Add("CveSATPSActualizado")
|
||||
SubTotalConceptos = TmpDT.SUMD("Total").RoundSQL
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
|
||||
AddPS2(False)
|
||||
|
||||
'VALIDA QUE EL XML SI VIENE CON EL CODIGO SAT 01010101
|
||||
@@ -1939,6 +1947,11 @@ Partial Class Compras_Compras
|
||||
|
||||
If Version = "3.3" Or Version = "4.0" Then
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
TmpDT.AcceptChanges()
|
||||
|
||||
ValidacionesTotalesXml()
|
||||
|
||||
Else
|
||||
@@ -2264,6 +2277,10 @@ Partial Class Compras_Compras
|
||||
|
||||
Private Sub ValidacionesTotalesXml()
|
||||
|
||||
If Not TmpDT.Columns.Contains("Amortizacion") Then
|
||||
TmpDT.Columns.Add("Amortizacion", GetType(Decimal))
|
||||
End If
|
||||
|
||||
Dim Msg As String = ""
|
||||
Dim SubtotalTemp = TmpDT.SUM("Total") + Math.Round(TmpDT.SUM("Descuento") + Math.Round(TmpDT.SUM("Amortizacion")), 2)
|
||||
Dim DescuentosTemp = TmpDT.SUM("Descuento")
|
||||
@@ -8087,11 +8104,15 @@ Partial Class Compras_Compras
|
||||
Msg.AppendFormat($"</br><a class=""Texto"" target='_blank' href=""/Inventarios/RecepcionAlmacen.aspx?CveCompra={CveCompra}&ED=1"">Recibir mercancía de entrega directa.</a>")
|
||||
End If
|
||||
|
||||
If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(220) <> "" Then
|
||||
If Not TieneError AndAlso Not ObjConta.PrePolizaSimplificacion(CvePrePoliza, UsuarioActual.CveEmpresa) Then
|
||||
TieneError = True
|
||||
Alert("No se pudo simplificar los movimientos", TipoMensaje.MsgError)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
If Not TieneError Then
|
||||
ObjCompras.Commit()
|
||||
If ObjContaAC IsNot Nothing Then ObjContaAC.Commit()
|
||||
|
||||
@@ -1236,17 +1236,20 @@ Partial Class PopUpVerFactura
|
||||
Dim Path As String = String.Format("{0}{2}\Pag\{1}.{2}", UsuarioActual.Empresa.Ruta, UrlParametros("SERIEFOLIO"), UrlParametros("EXT").ToString)
|
||||
Dim Archivo As New System.IO.FileInfo(Path)
|
||||
|
||||
If UrlParametros("EXT").ToString.ToUpper = "PDF" Then
|
||||
If UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero > 0 Then
|
||||
Dim CveIE As Integer = -1
|
||||
If UrlParametros("CVEIE") IsNot Nothing Then
|
||||
CveIE = UrlParametros("CVEIE").ToString.ToEntero
|
||||
If Not Archivo.Exists Then
|
||||
If UrlParametros("EXT").ToString.ToUpper = "PDF" Then
|
||||
If UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero > 0 Then
|
||||
Dim CveIE As Integer = -1
|
||||
If UrlParametros("CVEIE") IsNot Nothing Then
|
||||
CveIE = UrlParametros("CVEIE").ToString.ToEntero
|
||||
End If
|
||||
PDFReciboDePagos(-1, CveIE, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
|
||||
End If
|
||||
PDFReciboDePagos(-1, CveIE, UrlParametros("CVECOMPLEMENTOPAGO").ToString.ToEntero, False) 'genero el documento de no existir
|
||||
End If
|
||||
|
||||
Archivo = Nothing
|
||||
End If
|
||||
|
||||
Archivo = Nothing
|
||||
End If
|
||||
|
||||
If UrlParametros("SERIEFOLIO") IsNot Nothing AndAlso UrlParametros("SERIEFOLIO").ToString <> "" AndAlso UrlParametros("EXT").ToString <> "" Then
|
||||
|
||||
@@ -2173,64 +2173,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
Return Fact
|
||||
End Function
|
||||
Private Function GuardaArchivoXML(Archivo As String) As Modelos.eFactura
|
||||
' , Destino As String, Temporal As String
|
||||
Dim Retorno As Modelos.eFactura = Nothing
|
||||
|
||||
If File.Exists(Archivo) Then
|
||||
Dim NombreArchivo As String = Path.GetFileName(Archivo)
|
||||
Dim invalidChars As Char() = Path.GetInvalidFileNameChars()
|
||||
Dim invalidString As String = Regex.Escape(New String(invalidChars))
|
||||
Dim valid As String = Regex.Replace(NombreArchivo, (Convert.ToString("[") & invalidString) + "]", "")
|
||||
|
||||
NombreArchivo = valid
|
||||
|
||||
Try
|
||||
Dim XMLDoc As New XmlDocument()
|
||||
|
||||
XMLDoc.Load(Archivo)
|
||||
Retorno = CargaDatosXML(XMLDoc)
|
||||
|
||||
Catch exx As XmlException
|
||||
Retorno = Nothing
|
||||
'Dim texto As Dynamic = File.ReadAllText(Archivo)
|
||||
Dim txt_utf8 As New UTF8Encoding()
|
||||
'REEMPLAZA CARACTERES ESPECIALES Y VUELVE A LEER EL DOCUMENTO
|
||||
|
||||
'texto = RemoveIllegalXMLCharacters(texto)
|
||||
' SE RENOMBRA EL ARCHIVO, PERO SE QUITO POR SI NO COINCIDE EL PDF CON EL NOMBRE
|
||||
'Archivo = Archivo.ToUpper.Replace(".XML", "-2.XML")
|
||||
'NombreArchivo = IO.Path.GetFileName(Archivo)
|
||||
'File.WriteAllText(Archivo, texto)
|
||||
|
||||
|
||||
' Dim xmltr As New XmlTextReader(New MemoryStream(RemoveIllegalXMLCharacters(texto)))
|
||||
Dim XMLDoc As New XmlDocument()
|
||||
|
||||
Try
|
||||
XMLDoc.Load(Archivo)
|
||||
Retorno = CargaDatosXML(XMLDoc)
|
||||
Catch ex As Exception
|
||||
Retorno = Nothing
|
||||
|
||||
|
||||
|
||||
End Try
|
||||
Catch ex As Exception
|
||||
|
||||
|
||||
Retorno = Nothing
|
||||
End Try
|
||||
|
||||
'si se cargaron todos los datos
|
||||
If Retorno IsNot Nothing AndAlso Not String.IsNullOrEmpty(Retorno.TFDUUID) Then
|
||||
'XML
|
||||
Retorno.ArchivoXML = NombreArchivo
|
||||
End If
|
||||
End If
|
||||
Return Retorno
|
||||
|
||||
End Function
|
||||
Private Sub CargaImpuestosXML(XMLDoc As XmlDocument)
|
||||
Dim Prefijo As String = If(String.IsNullOrEmpty(XMLDoc.DocumentElement.Prefix), "cfd", XMLDoc.DocumentElement.Prefix)
|
||||
Dim cfdVer As String = "http://www.sat.gob.mx/cfd/3"
|
||||
@@ -3338,7 +3281,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
|
||||
|
||||
SXML = SXML.Replace("o;?", "")
|
||||
SXML = SXML.Trim((Convert.ToChar(0)))
|
||||
|
||||
XMLDoc.LoadXml(SXML)
|
||||
@@ -4508,7 +4451,7 @@ Partial Class Compras_eFacturas
|
||||
|
||||
|
||||
Dim SXML As String = File.ReadAllText(Archivo).Replace(vbLf, " ").Replace(vbCrLf, " ")
|
||||
|
||||
SXML = SXML.Replace("o;?", "")
|
||||
SXML = SXML.Trim((Convert.ToChar(0)))
|
||||
|
||||
XMLDoc.LoadXml(SXML)
|
||||
|
||||
Reference in New Issue
Block a user