From 3a3454130b9513b484fb0ab9e0662477aa131405 Mon Sep 17 00:00:00 2001 From: rrene Date: Mon, 8 Aug 2022 19:24:55 -0700 Subject: [PATCH] descarga POG --- Inventarios/KardexAlmacenHorizontal.aspx | 64 ++++++++++++- Inventarios/KardexAlmacenHorizontal.aspx.vb | 101 +++++++++++++------- 2 files changed, 123 insertions(+), 42 deletions(-) diff --git a/Inventarios/KardexAlmacenHorizontal.aspx b/Inventarios/KardexAlmacenHorizontal.aspx index 3a0c79400..f0c320597 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx +++ b/Inventarios/KardexAlmacenHorizontal.aspx @@ -94,14 +94,15 @@ -
  • - - - +
  • +
  • +
    - +
  • + POG +
  • @@ -298,6 +299,59 @@ + + + diff --git a/Inventarios/KardexAlmacenHorizontal.aspx.vb b/Inventarios/KardexAlmacenHorizontal.aspx.vb index 022798c18..10a1978ea 100644 --- a/Inventarios/KardexAlmacenHorizontal.aspx.vb +++ b/Inventarios/KardexAlmacenHorizontal.aspx.vb @@ -24,6 +24,12 @@ Partial Class Inventarios_KardexAlmacen DdlMarca.Visible = True DdlOrden.SelectedValue = 2 End If + + If UsuarioActual.CveEmpresa = 119 Then + LnkPOG.Visible = True + txtFechaI.Text = Now.ToShortDateString + End If + If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero) ddlProducto2.SelectedValue = If(Request("CvePS") IsNot Nothing, Request("CvePS").ToString, "-1") End If @@ -436,57 +442,78 @@ Partial Class Inventarios_KardexAlmacen End Sub - Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable - SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) - Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) + 'Private Function ReadExcelFile(ByVal flatFilePath As String, ByVal firstRowHasHeaders As Boolean) As DataTable + ' SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) + ' Dim excelFile As ExcelFile = ExcelFile.Load(flatFilePath) - Dim unnamed As Integer = 0 - Dim cols As Integer - Dim columns As String() - Dim curRow As Integer = 0 - Dim curCol As Integer = 0 - Dim dataTable As DataTable = New DataTable() - Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) + ' Dim unnamed As Integer = 0 + ' Dim cols As Integer + ' Dim columns As String() + ' Dim curRow As Integer = 0 + ' Dim curCol As Integer = 0 + ' Dim dataTable As DataTable = New DataTable() + ' Dim worksheet As ExcelWorksheet = excelFile.Worksheets(0) - For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 + ' For cols = 0 To worksheet.Rows(0).AllocatedCells.Count - 1 - If firstRowHasHeaders Then + ' If firstRowHasHeaders Then - If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then - dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim) - Else - dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) - End If + ' If worksheet.Rows(0).Cells(cols).Value IsNot Nothing Then + ' dataTable.Columns.Add(worksheet.Rows(0).Cells(cols).Value.ToString().Trim) + ' Else + ' dataTable.Columns.Add("Unnamed Column " & (System.Threading.Interlocked.Increment(unnamed))) + ' End If - curRow = 1 - Else - dataTable.Columns.Add("Column " & (cols + 1)) - End If + ' curRow = 1 + ' Else + ' dataTable.Columns.Add("Column " & (cols + 1)) + ' End If - Next + ' Next - While curRow < worksheet.Rows.Count + ' While curRow < worksheet.Rows.Count - columns = New String(cols - 1) {} + ' columns = New String(cols - 1) {} - For curCol = 0 To cols - 1 + ' For curCol = 0 To cols - 1 - If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then - columns(curCol) = "" - Else - columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() - End If + ' If worksheet.Rows(curRow).Cells(curCol).Value Is Nothing Then + ' columns(curCol) = "" + ' Else + ' columns(curCol) = worksheet.Rows(curRow).Cells(curCol).Value.ToString() + ' End If - Next + ' Next - dataTable.Rows.Add(columns) - curRow += 1 + ' dataTable.Rows.Add(columns) + ' curRow += 1 - End While + ' End While - Return dataTable + ' Return dataTable - End Function + 'End Function Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control) - End Sub + End Sub + + Private Sub LnkPOG_Click(sender As Object, e As EventArgs) Handles LnkPOG.Click + + RegistraScript(String.Format("$('#{0}').modal();", "DivPOG")) + + End Sub + + Protected Sub BtnDescargarPOG_Click(sender As Object, e As EventArgs) + + Dim Fecha As Date = Now + Dim Nombre As String = IIf(RBLPOG.SelectedValue = "0", "Ventas-", "Existencias-") + + Using ObjInventario As New ClsInventarios + + If ObjInventario.GetJAM_BASF_POG(Fecha) AndAlso ObjInventario.DataSetResultados IsNot Nothing Then + ObjInventario.DataSetResultados.Tables(RBLPOG.SelectedValue.ToEntero).ExportToExcel(Nombre & Fecha.ToShortDateString) + + End If + End Using + + End Sub End Class