This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2022-06-24 09:52:23 -07:00
16 changed files with 844 additions and 342 deletions

View File

@@ -1260,8 +1260,9 @@ Partial Class ProductosyServicios
If DdlSATPS.txtValue.Value.ToEntero > 0 Then
If UsuarioActual.Empresa.Funcionalidad(161) = "1" Then ' si tiene activada la carta porte
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
If Not ValidaMaterialPeligrosoMensaje Then
ValidaMaterialPeligroso(DdlSATPS.txtValue.Value.ToEntero)
Exit Sub
End If
End If
@@ -3148,7 +3149,9 @@ Partial Class ProductosyServicios
ObjGrales.Dispose()
If ValidaMaterialPeligrosoMensaje Then
BtnGuardar_Click(Nothing, Nothing)
End If
'Return Respuesta

View File

@@ -907,7 +907,7 @@ Partial Class RepVentaDetalle
TipoDocto = "Dev"
End Select
pathPDF = Server.MapPath(String.Format("~/Empresas/{0}/PDF/{1}/{2}.pdf", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
pathPDF = String.Format("{0}/PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
If IO.File.Exists(pathPDF) Then
'NO AGREGAR ARCHIVOS REPETIDOS
@@ -924,27 +924,6 @@ Partial Class RepVentaDetalle
Response.ContentType = "application/zip"
Response.End()
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
End Function
Private Sub BtnDescargarXML_Click(sender As Object, e As EventArgs) Handles BtnDescargarXML.Click
Dim pathXML As String
@@ -973,7 +952,7 @@ Partial Class RepVentaDetalle
TipoDocto = "Dev"
End Select
pathXML = Server.MapPath(String.Format("~/Empresas/{0}/XML/{1}/{2}.xml", UsuarioActual.CveEmpresa, TipoDocto, gvr.DataKey("SerieFolio").ToString))
pathXML = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta, TipoDocto, gvr.DataKey("SerieFolio").ToString)
If IO.File.Exists(pathXML) Then
'NO AGREGAR ARCHIVOS REPETIDOS
@@ -990,6 +969,27 @@ Partial Class RepVentaDetalle
Response.ContentType = "application/zip"
Response.End()
End Sub
Private Function DescargarFactura(CveVenta As Integer, CveEmpresa As Integer, CveUsuarioCreo As Integer) As Byte()
Dim Url = New Uri(String.Format("{0}Compras/PopUpVerFactura.aspx?P={1}", "http://localhost:85/", Encripta(String.Format("OP=VTA&CVEVENTA={0}&PAG=1&GUARDAR=1", CveVenta))))
Dim File As Byte() = Nothing
Try
Using httpClient = New HttpClient()
httpClient.Timeout = New TimeSpan(0, 15, 0)
Using request = New HttpRequestMessage(HttpMethod.Get, Url)
request.Headers.Add("ADSToken", Encripta(String.Format("CVEEMPRESA={0}&TICKS={1}&CVEUSUARIO={2}", CveEmpresa, DateTime.UtcNow.Ticks, CveUsuarioCreo)))
Dim response = httpClient.SendAsync(request).Result
If response.StatusCode = Net.HttpStatusCode.OK Then
File = response.Content.ReadAsByteArrayAsync().Result
End If
End Using
End Using
Catch ex As Exception
File = Nothing
OnError("Ocurrió un error al descargar la factura", ex)
End Try
Return File
End Function
Private Sub GenerarPDF(Optional Formato As String = "PDF")
If DtVentas IsNot Nothing Then