-- mejora
This commit is contained in:
@@ -79,10 +79,8 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
CargaParametrosDetalle()
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(531) = "1" Then
|
||||
|
||||
LblServicioDomicilioFiltro.Visible = True
|
||||
DVServicioDomicilio.Visible = True
|
||||
|
||||
End If
|
||||
|
||||
If UsuarioActual.CveEmpresa.Contiene(7, 122) Then
|
||||
@@ -772,20 +770,12 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
|
||||
Private Sub BtnDescargarPDF_Click(sender As Object, e As EventArgs) Handles BtnDescargarZipPDF.Click
|
||||
|
||||
|
||||
'If Not Directory.Exists(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\") Then
|
||||
' Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory & "Temp\" & UsuarioActual.CveUsuario.ToString & "\")
|
||||
'End If
|
||||
|
||||
|
||||
Dim Archivo As String = String.Empty
|
||||
Dim HuboInexistentes As Boolean = False
|
||||
Dim SBInexistentes As New StringBuilder : SBInexistentes.Append("No se pudieron anexar los siguientes archivos:<br />")
|
||||
|
||||
Dim ArchivoDestino As String = String.Format("{0}Temp\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, Now.ToString("yyyyMMddhhmmss") & UsuarioActual.CveUsuario.ToString)
|
||||
|
||||
Dim archiveZip As ZipArchive = ZipFile.Open(ArchivoDestino, ZipArchiveMode.Create)
|
||||
|
||||
Dim DTVentas As DataTable = TmpDT.FiltraParametros("", "", {"CveVenta", "TipoDocumento", "Folio", "SerieFolio"})
|
||||
|
||||
Try
|
||||
@@ -797,10 +787,8 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
If Drow("TipoDocumento").ToString.Trim <> String.Empty Then
|
||||
Archivo = String.Format("{0}PDF/{1}/{2}.pdf", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString)
|
||||
If File.Exists(Archivo) Then
|
||||
|
||||
archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".pdf")
|
||||
|
||||
If UsuarioActual.CveRol = 1 Then
|
||||
If UsuarioActual.CveRol = 1 OrElse UsuarioActual.CveEmpresa = 119 Then
|
||||
Archivo = String.Format("{0}XML/{1}/{2}.xml", UsuarioActual.Empresa.Ruta.Replace("\", "/"), Drow("TipoDocumento").ToString, Drow("SerieFolio").ToString)
|
||||
If File.Exists(Archivo) Then
|
||||
archiveZip.CreateEntryFromFile(Archivo, Drow("SerieFolio").ToString & ".xml")
|
||||
@@ -810,7 +798,6 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
SBInexistentes.AppendFormat("Tipo {0}, Folio {1} - {2}<br />", Drow("TipoDocumento").ToString, SerieFolio, Archivo)
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
HuboInexistentes = True
|
||||
SBInexistentes.AppendFormat("Tipo {0}, Folio {1} - {2}<br />", Drow("TipoDocumento").ToString, SerieFolio, Archivo)
|
||||
@@ -818,14 +805,11 @@ Partial Class Ventas_RepProductosServiciosDetalle
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
|
||||
archiveZip.Dispose()
|
||||
|
||||
|
||||
Response.Clear()
|
||||
Response.ContentType = "application/zip"
|
||||
Response.AddHeader("content-disposition", $"attachment; filename=facturas{Now.ToString("yyyyMMddhhmmss")}.zip")
|
||||
|
||||
Reference in New Issue
Block a user