diff --git a/Compras/PopUpVerFactura.aspx.vb b/Compras/PopUpVerFactura.aspx.vb
index 88145dd74..7b6ee5275 100644
--- a/Compras/PopUpVerFactura.aspx.vb
+++ b/Compras/PopUpVerFactura.aspx.vb
@@ -223,7 +223,28 @@ Partial Class PopUpVerFactura
End If
End If
+ End If
+ End Sub
+
+
+ Private Sub DescargaArchivoDirecto(RutaArchivo As String)
+ If RutaArchivo <> "" Then
+
+ 'Dim Path As String = String.Format("{0}\{1}", UsuarioActual.Empresa.Ruta, RutaArchivo)
+ Dim Archivo As New System.IO.FileInfo(RutaArchivo)
+
+ If Archivo.Exists Then
+ HttpContext.Current.Response.Clear()
+ HttpContext.Current.Response.ClearContent()
+ HttpContext.Current.Response.ContentType = "application/octet-stream"
+ HttpContext.Current.Response.AppendHeader("Content-disposition", String.Format("attachment; filename={0}", Archivo.Name))
+ HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
+ HttpContext.Current.Response.TransmitFile(RutaArchivo)
+ 'HttpContext.Current.Response.Flush()
+ HttpContext.Current.Response.End()
End If
+ Archivo = Nothing
+ End If
End Sub
Private Sub ReciboAgropecuaria()
@@ -972,6 +993,12 @@ Partial Class PopUpVerFactura
DescargaFactura(UrlParametros)
End If
+ If UrlParametros("OP").ToString = "File" Then
+
+ DescargaArchivoDirecto(UrlParametros("FILE").ToString)
+
+ End If
+
'DESCARGA DOCUMENTO XML O PDF DE LA FACTURA VENTA
If UrlParametros("OP").ToString = "FactVta" Then
DescargaFacturaVenta(UrlParametros)
@@ -1258,6 +1285,13 @@ Partial Class PopUpVerFactura
End If
End If
+ 'IMPRIME ENTREGAS POR REALIZAR
+ If UrlParametros("OP").ToString = "FILE" Then
+ If UrlParametros("CVEASIGNACIONENTREGA") IsNot Nothing And UrlParametros("USUARIOENTREGA") IsNot Nothing Then
+ ImprimeEntregasPorRealizar(UrlParametros("CVEASIGNACIONENTREGA").ToString.ToLong, UrlParametros("USUARIOENTREGA").ToString)
+ End If
+ End If
+
End Sub
Private Function Parametros(Cadena As String) As Hashtable
diff --git a/Inicio.aspx b/Inicio.aspx
index a83974a0a..07c626bb3 100644
--- a/Inicio.aspx
+++ b/Inicio.aspx
@@ -510,136 +510,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
MOTOBATERIAS AMERICA
-
-
-
-
-
-
-
-
-
Cat APS AGM-HT-LTH-CR 2021
-
-
-
+
+
+
+
+
+
+
+
<%# Eval("Nombre") %>
+
+
+
+
+
<%# Eval("Nombre2") %>
+
+
+
+
+
+
+
+
@@ -1481,14 +1372,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1599,22 +1478,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Inicio.aspx.vb b/Inicio.aspx.vb
index e919fbee7..ca405f7d7 100644
--- a/Inicio.aspx.vb
+++ b/Inicio.aspx.vb
@@ -236,9 +236,7 @@ Partial Class Inicio
'Evaluacion del proveedor
CargaEvaluacionProveedor()
- If UsuarioActual.CveEmpresa = 140 Then
- DVDescargasBDH.Visible = True
- End If
+ CargaDocumentacion()
End If
@@ -1298,37 +1296,61 @@ Partial Class Inicio
RegistraScript("$('#DvUnoaUno').modal('hide')")
End Sub
- 'Protected Sub LnkDecargaDoc_Click(sender As Object, e As EventArgs)
- ' Dim NombreArchivo As String = DirectCast(sender, LinkButton).Attributes("NombreArchivo")
- ' Dim filePath As String = $"{Server.MapPath("~")}\Documentacion\140\{DirectCast(sender, LinkButton).Attributes("NombreArchivo")}"
+#Region "DOCUMENTACION"
+ Private Sub CargaDocumentacion()
+ If UsuarioActual.CveEmpresa = 140 Then
+ DVDescargasBDH.Visible = True
- ' Dim Archivo As New System.IO.FileInfo(filePath)
+ Dim TmpDT = New DataTable()
+ Dim ObjDoc As New ClsEdocumentacion
+ If ObjDoc.DocumentacionGet(-1, -1, 1, UsuarioActual.Empresa.CveEmpresa, Modulo:=8) Then
+ Dim dtt As New DataTable
+ dtt = ObjDoc.DtResultados
+ If dtt IsNot Nothing AndAlso dtt.Rows.Count > 0 Then
- ' Dim mimeType As String = Nothing
+ TmpDT.Columns.Add(New DataColumn("Nombre", GetType(String)))
+ TmpDT.Columns.Add(New DataColumn("Liga", GetType(String)))
+ TmpDT.Columns.Add(New DataColumn("Nombre2", GetType(String)))
+ TmpDT.Columns.Add(New DataColumn("Liga2", GetType(String)))
+ 'Dim i As Integer = 0
+ 'Dim Nombre As String = ""
+ 'Dim Liga As String = ""
+ Dim drr As DataRow
+ For Each dr As DataRow In dtt.Rows
- ' If Archivo.Exists Then
+ If (dr("Consec").ToString.ToEntero Mod 2) = 1 Then 'primer renglón
+ drr = TmpDT.NewRow
+ drr("Nombre") = dr("Documentacion").ToString
+ drr("Liga") = String.Format("/Compras/PopUpVerFactura.aspx?p={0}", Encripta(String.Format("op=File&File={0}\Formatos\{1}_{2}", UsuarioActual.Empresa.Ruta, dr("CveDocumentacion"), dr("DocumentacionFormato")).Replace("\", "/").Replace("//", "/")))
+ TmpDT.Rows.Add(drr)
+ Else
+ TmpDT.Rows((dr("Consec").ToString.ToEntero / 2) - 1)("Nombre2") = dr("Documentacion").ToString
+ TmpDT.Rows((dr("Consec").ToString.ToEntero / 2) - 1)("Liga2") = String.Format("/Compras/PopUpVerFactura.aspx?op={0}", Encripta(String.Format("op=File&File={0}\Formatos\{1}_{2}", UsuarioActual.Empresa.Ruta, dr("CveDocumentacion"), dr("DocumentacionFormato")).Replace("\", "/").Replace("//", "/")))
+ End If
+ Next
- ' HttpContext.Current.Response.Buffer = True
- ' HttpContext.Current.Response.Clear()
- ' HttpContext.Current.Response.ClearContent()
- ' HttpContext.Current.Response.ContentType = mimeType
- ' HttpContext.Current.Response.AppendHeader("Content-disposition", "inline; filename=" & NombreArchivo)
- ' HttpContext.Current.Response.AddHeader("Content-Length", Archivo.Length.ToString())
- ' HttpContext.Current.Response.TransmitFile(filePath)
- ' HttpContext.Current.Response.Flush()
- ' HttpContext.Current.Response.SuppressContent = True
- ' HttpContext.Current.ApplicationInstance.CompleteRequest()
- ' HttpContext.Current.Response.End()
+ End If
+ End If
+ ObjDoc.Dispose()
- ' Archivo = Nothing
- ' End If
+ GvDoc.DataSource = TmpDT
+ GvDoc.DataBind()
+ End If
+ End Sub
+ Protected Sub GvDoc_RowDataBound(sender As Object, e As GridViewRowEventArgs)
+ If e.Row.RowType = DataControlRowType.DataRow Then
+ If e.Row.DBCampo("Nombre2") <> "" Then
+ e.Row.FindControl("divdoc20").Visible = True
+ End If
+ End If
+ End Sub
+#End Region
- 'End Sub
End Class