PA Universo Productos

This commit is contained in:
HECTOR RODRIGUEZ
2021-07-23 21:19:44 -07:00
parent dc42599b83
commit 919203ab20

View File

@@ -649,63 +649,14 @@ Partial Class Inventarios_InventarioFisicoDetalle
Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder Dim IncluyePS, ExcluyePS, IncluyeClasificacion, ExcluyeClasificacion, IncluyeProveedor As New StringBuilder
Dim ObjInventario As New ClsInventarios Dim ObjInventario As New ClsInventarios
If ObjInventario.GetInventarioFisicoDetallesClasificacion(CveInventarioFisico, UsuarioActual.CveEmpresa) Then If ObjInventario.GetInventarioFisicoUniversoProductos(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = ObjInventario.DtResultados
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
IncluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
Next
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
ExcluyeClasificacion.AppendFormat("{0},", dr("CveClasificacion"))
Next
End If
End If End If
If ObjInventario.GetInventarioFisicoDetallesProductosServicios(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = ObjInventario.DtResultados
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
IncluyePS.AppendFormat("{0},", dr("CvePS"))
Next
For Each dr As DataRow In dt.FiltraParametros("Incluye = 0").Rows
ExcluyePS.AppendFormat("{0},", dr("CvePS"))
Next
End If
End If
If ObjInventario.GetInventarioFisicoDetallesProveedores(CveInventarioFisico, UsuarioActual.CveEmpresa) Then
Dim dt As DataTable = ObjInventario.DtResultados
Dim str As New StringBuilder
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
For Each dr As DataRow In dt.FiltraParametros("Incluye = 1").Rows
IncluyeProveedor.AppendFormat("{0},", dr("CveProveedor"))
Next
End If
End If
Dim dtPS As DataTable = GlobalDTPS(UsuarioActual.CveEmpresa)
If IncluyePS.ToString <> "" Then
dtPS = dtPS.FiltraParametros(String.Format("CvePS IN ({0})", IncluyePS.ToString.TrimEnd(",")))
End If
If ExcluyePS.ToString <> "" Then
dtPS = dtPS.FiltraParametros(String.Format("CvePS NOT IN ({0})", ExcluyePS.ToString.TrimEnd(",")))
End If
If IncluyeClasificacion.ToString <> "" Then
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion IN ({0})", IncluyeClasificacion.ToString.TrimEnd(",")))
End If
If ExcluyeClasificacion.ToString <> "" Then
dtPS = dtPS.FiltraParametros(String.Format("CveClasificacion NOT IN ({0})", ExcluyeClasificacion.ToString.TrimEnd(",")))
End If
If IncluyeProveedor.ToString <> "" Then
dtPS = dtPS.FiltraParametros(String.Format("CveProveedorCompra IN ({0})", IncluyeProveedor.ToString.TrimEnd(",")))
End If
dtPS = dtPS.FiltraParametros("", "PS", {"Codigo", "PS", "Clasificacion", "ProveedorCompra"})
Dim NombreArchivo As String Dim NombreArchivo As String
SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet) SpreadsheetInfo.SetLicense(ModExtensiones.SerialGemBoxSpreadsheet)
Dim workbook As New ExcelFile() Dim workbook As New ExcelFile()
Dim worksheet = workbook.Worksheets.Add("Productos") Dim worksheet = workbook.Worksheets.Add("Productos")
worksheet.InsertDataTable(dtPS, New InsertDataTableOptions() With worksheet.InsertDataTable(ObjInventario.DtResultados, New InsertDataTableOptions() With
{ {
.ColumnHeaders = True, .ColumnHeaders = True,
.StartRow = 0, .StartRow = 0,