Compras Biatico Comprobacion Clasificaiones
This commit is contained in:
@@ -365,7 +365,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Dim i As Integer = 0
|
||||
While i < objInv.DtResultados.Columns.Count
|
||||
|
||||
If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then
|
||||
If Not objInv.DtResultados.Columns(i).ColumnName.Contiene("CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion") AndAlso objInv.DtResultados.SUM(String.Format("[{0}]", objInv.DtResultados.Columns(i).ColumnName)) = 0 Then
|
||||
objInv.DtResultados.Columns.RemoveAt(i)
|
||||
Else
|
||||
i = i + 1
|
||||
@@ -460,8 +460,7 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
|
||||
'Try, generado para cuando el resultado no tiene valores(The source contains no DataRows.), no detenga la ejecucion, no se le puso un count previo, porque el costo se duplica, al preguntar y luego ordenar y convertir a datatable
|
||||
Try
|
||||
DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion"})
|
||||
|
||||
DtPSRetorno = New DataView(DTPS.OrderBy(Function(a) a!PSCodigo).CopyToDataTable).ToTable(True, {"CvePS", "PSCodigo", "PSCodigoClasificacion", "CveClasificacion"})
|
||||
Catch ex As Exception
|
||||
DtPSRetorno = Nothing
|
||||
End Try
|
||||
@@ -469,7 +468,61 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
End If
|
||||
DTPS = Nothing
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If (usuario.TienePermisoProceso(300) Or usuario.TienePermisoProceso(301)) And (DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0) Then
|
||||
|
||||
Dim ObjClasificaciones As New ClsClasificaciones()
|
||||
Dim DTClasificacionesComprobaciones As DataTable
|
||||
|
||||
Dim DTTmp As DataTable = DtPSRetorno.Clone
|
||||
|
||||
|
||||
If ObjClasificaciones.GetClasificacionesComprobaciones(usuario.CveEmpresa) Then
|
||||
|
||||
If usuario.TienePermisoProceso(300) And usuario.TienePermisoProceso(301) Then
|
||||
DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados
|
||||
ElseIf usuario.TienePermisoProceso(300) Then 'TipoComprobacion 1 Biaticos
|
||||
DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 1")
|
||||
Else 'TipoComprobacion 2 Compreobacines
|
||||
DTClasificacionesComprobaciones = ObjClasificaciones.DtResultados.FiltraParametros("TipoComprobacion = 2")
|
||||
End If
|
||||
|
||||
For Each pRow As DataRow In DtPSRetorno.Rows
|
||||
|
||||
For Each drow As DataRow In DTClasificacionesComprobaciones.Rows
|
||||
If pRow("CveClasificacion").ToString.ToEntero = drow("CveClasificacion").ToString.ToEntero Then
|
||||
|
||||
Dim nRow As DataRow = DTTmp.NewRow
|
||||
nRow("CvePS") = pRow("CvePS")
|
||||
nRow("PSCodigo") = pRow("PSCodigo")
|
||||
nRow("PSCodigoClasificacion") = pRow("PSCodigoClasificacion")
|
||||
nRow("CveClasificacion") = pRow("CveClasificacion")
|
||||
DTTmp.Rows.Add(nRow)
|
||||
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
Next
|
||||
|
||||
DtPSRetorno = DTTmp.Copy
|
||||
|
||||
Else
|
||||
'no regresar datos herror al consultar
|
||||
DtPSRetorno.Clear()
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
If DtPSRetorno IsNot Nothing AndAlso DtPSRetorno.Rows.Count > 0 Then
|
||||
|
||||
|
||||
DtPSRetorno.Columns("CvePS").ColumnName = "id"
|
||||
DtPSRetorno.Columns(PSCodigoDescripcion).ColumnName = "text"
|
||||
If PSCodigoDescripcion = "PSCodigo" Then
|
||||
@@ -477,8 +530,10 @@ Public Class SIGWeb : Implements IHttpHandler, IRequiresSessionState
|
||||
Else
|
||||
DtPSRetorno.Columns().Remove("PSCodigo")
|
||||
End If
|
||||
|
||||
retorno = JsonConvert.SerializeObject(DtPSRetorno).ToString
|
||||
context.Response.Write(retorno)
|
||||
|
||||
Else
|
||||
context.Response.Write("[]")
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user