Reloj Checador 2024.04.15
This commit is contained in:
@@ -2719,6 +2719,27 @@ Public Class ClsRH
|
||||
OnError("Ocurrió un error al consultar las Asistencias del Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function GetPersonalPreAsistenciaRegistros(InicioPeriodo As Date, FinPeriodo As Date, CveEmpresa As Integer) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
|
||||
SqlDataAdapter("PA_RH_PersonalPreAsistenciaRegistrosGet")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@InicioPeriodo", SqlDbType.Date).Value = InicioPeriodo
|
||||
.Add("@FinPeriodo", SqlDbType.Date).Value = FinPeriodo
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
Retorno = True
|
||||
Catch ex As SqlException
|
||||
OnError("Ocurrió un error al consultar las Asistencias del Personal.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
@@ -2768,6 +2789,44 @@ Public Class ClsRH
|
||||
End Function
|
||||
|
||||
|
||||
Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer) As Boolean
|
||||
|
||||
Dim Retorno As Boolean = False
|
||||
Data = New DataTable
|
||||
'SqlAdapter = New SqlDataAdapter("PA_RH_PersonalAsistenciasAddUpd", SqlConexion)
|
||||
'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
|
||||
SqlDataAdapter("PA_RH_PersonalPreAsistenciasAddUpd")
|
||||
With SqlAdapter.SelectCommand.Parameters
|
||||
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
|
||||
.Add("@Fecha", SqlDbType.Date).Value = Fecha
|
||||
.Add("@CveAsistenciasInasistencias", SqlDbType.Int).Value = CveAsistenciasInasistencias
|
||||
.Add("@PorcentajePago", SqlDbType.Float).Value = PorcentajePago
|
||||
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
|
||||
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
|
||||
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
|
||||
End With
|
||||
|
||||
Try
|
||||
SqlAdapter.Fill(Data)
|
||||
CveAsistencia = SqlAdapter.SelectCommand.Parameters("@RETURN_VALUE").Value.ToString.ToEntero
|
||||
Retorno = True
|
||||
Catch Ex1 As SqlException
|
||||
If Ex1.Message.Contains("Número: 2627;") Then
|
||||
Alert("Ya se registró la Asistencia del día " & Fecha & " para el empleado.", TipoMensaje.MsgAdvertencia)
|
||||
ElseIf Ex1.Message.Contains("x50102;") Then
|
||||
Alert("No se puede editar o agregar la asistencia ya que se encuentra vinculada a un periodo autorizado.", TipoMensaje.MsgAdvertencia)
|
||||
GuardaLog(String.Format("{0} DESCRIPCIÓN DETALLADA: {1} {2} {3}", "Ocurrió un error al editar o agregar la asistencia ", Ex1.ToString, vbCrLf, SqlAdapter.SelectCommand.Parameters.ParametrosInfo()))
|
||||
Else
|
||||
Me.OnError("Ocurrió un error al guardar la Asistencia.", Ex1, SqlAdapter.SelectCommand.Parameters.ParametrosInfo())
|
||||
End If
|
||||
Catch ex As Exception
|
||||
OnError("Ocurrió un error al guardar la Pre Asistencia.", ex, SqlAdapter.SelectCommand.Parameters.ParametrosInfo)
|
||||
End Try
|
||||
|
||||
Return Retorno
|
||||
End Function
|
||||
|
||||
|
||||
Public Function UpAsistenciaDetalle(CveEmpresa As Integer, CveUsuario As Integer, registros As List(Of RequestUpAsistenciaDetalle)) As Boolean
|
||||
Dim Retorno As Boolean = False
|
||||
Dim xmlProductos As System.Xml.Linq.XDocument = Nothing
|
||||
|
||||
@@ -20743,7 +20743,7 @@ Partial Class Compras_Compras
|
||||
Dim Diferencia As Decimal = saldoTotal - TotalAcumuladoTabla - ValImporte
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{ValSubProyecto}</b> <br>Clasificación: <b>{ValClasificacion}</b> <br>Tipo de gasto: <b>{ValTipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}.</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
|
||||
Else
|
||||
@@ -20751,7 +20751,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{ValSubProyecto}</b> con la clasificación <b>{ValClasificacion}</b>, Tipo de gasto <b>{ValTipoGasto}</b> ", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{ValSubProyecto}</b> <br>Clasificación: <b>{ValClasificacion}</b> <br>Tipo de gasto: <b>{ValTipoGasto}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
End If
|
||||
Else
|
||||
@@ -20808,16 +20808,24 @@ Partial Class Compras_Compras
|
||||
Dim tieneRegistrosConCveSubProyecto As Boolean = resultadosFiltrados.Any(Function(row) CType(row("CveSubProyecto"), Integer) = item.CveSubProyecto)
|
||||
|
||||
If tieneRegistrosConCveSubProyecto Then
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
'Dim saldoTotal As Decimal = (From row In resultadosFiltrados
|
||||
' Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
' row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
' Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
|
||||
Dim saldoTotal As Decimal = (From row In resultadosFiltrados.AsEnumerable()
|
||||
Where row.Field(Of Integer)("CveSubProyecto") = item.CveSubProyecto AndAlso
|
||||
row.Field(Of Integer)("CveClasificacion") = item.CveClasificacion
|
||||
If(row.IsNull("CveClasificacion"),
|
||||
0,
|
||||
row.Field(Of Integer?)("CveClasificacion").GetValueOrDefault()) = item.CveClasificacion
|
||||
Select row.Field(Of Decimal)("Saldo")).Sum()
|
||||
|
||||
If saldoTotal > 0 Then
|
||||
|
||||
Dim Diferencia As Decimal = saldoTotal - item.TotalSum
|
||||
|
||||
If (Diferencia) < 0 Then
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{item.SubProyecto}</b> <br>Clasificación: <b>{item.Clasificacion}</b> <br>Tipo de gasto: <b>{item.TipoGasto}</b>. Se excede por <b>{Math.Abs(Diferencia).FormatoNumero}.</b>", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
Else
|
||||
@@ -20825,7 +20833,7 @@ Partial Class Compras_Compras
|
||||
End If
|
||||
|
||||
Else
|
||||
Alert($"No hay presupuesto disponible en el subproyecto <b>{item.SubProyecto}</b> con la clasificación <b>{item.Clasificacion}</b>, Tipo de gasto <b>{item.TipoGasto}</b>", TipoMensaje.MsgAdvertencia)
|
||||
Alert($"No hay presupuesto disponible. <br>SubProyecto: <b>{item.SubProyecto}</b> <br>Clasificación: <b>{item.Clasificacion}</b> <br>Tipo de gasto: <b>{item.TipoGasto}</b>.", TipoMensaje.MsgAdvertencia)
|
||||
respuesta = False
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -3252,7 +3252,7 @@ Partial Class Inventarios_EntregaAlmacen
|
||||
Msg.AppendFormat("<br/><a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Consola</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}&Consola={1}", CveMovimiento, Consola)))
|
||||
End If
|
||||
|
||||
If CveMovimientoEntrada > 0 Then
|
||||
If CveMovimientoEntrada > 0 AndAlso Not UsuarioActual.Empresa.Funcionalidad(578).ToEntero = 1 Then
|
||||
Msg.AppendFormat("<br/><br/> Movimiento Entrada (Traspaso): <b><a href=""/Inventarios/EntradasSalidas.aspx?CveMovimiento={0}"" target=""_blank"">{1}</a></b>", CveMovimientoEntrada, FolioEntrada)
|
||||
Msg.AppendFormat("<br/> <a class=""Texto"" target='_blank' href=""/Compras/PopUpVerFactura.aspx?P={0}"">Imprimir Movimiento</a> ", Encripta(String.Format("OP=Alm&CveMovimiento={0}", CveMovimientoEntrada)))
|
||||
End If
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports ADSNetLibrary.SIGAPI.Models.CGame
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
'TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports ADSNetLibrary.SIGAPI.Models.CGame
|
||||
Imports Extensiones
|
||||
Imports GemBox.Spreadsheet
|
||||
Imports Microsoft.Reporting.WebForms
|
||||
|
||||
Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
Inherits ClsPaginas
|
||||
|
||||
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
If Not IsPostBack Then
|
||||
'TxtFechaI.Text = NowADS().AddMonths(-1).ToShortDateString
|
||||
TxtFechaF.Text = NowADS().ToShortDateString
|
||||
CargaCombos()
|
||||
CargaCombos()
|
||||
ddlAlmacen.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
LblOrden.Visible = False
|
||||
DdlOrden.Visible = False
|
||||
@@ -35,18 +35,18 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
DdlIncluyeTransitorios.Items.RemoveAt(0) 'oculta opción "No" en tránsito
|
||||
End If
|
||||
|
||||
If IfNull(Request("CvePS"), "-1").ToString.ToEntero > 0 Then CargarKardex(Request("CvePS").ToString.ToEntero)
|
||||
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")
|
||||
|
||||
If UsuarioActual.Empresa.Funcionalidad(574).ToEntero = 1 Then
|
||||
DVFiltroCodigo.Visible = True
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCombos()
|
||||
|
||||
CargaFuncionalidad105()
|
||||
End If
|
||||
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaCombos()
|
||||
|
||||
CargaFuncionalidad105()
|
||||
CargaPS()
|
||||
|
||||
'Using ObjPS As New ClsProductosServicios
|
||||
@@ -56,25 +56,25 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
'End Using
|
||||
DdlMarca.DataSource = GlobalDTGralMarcas(UsuarioActual.CveEmpresa)
|
||||
DdlMarca.DataBind()
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
ddlAlmacen.DataBind()
|
||||
|
||||
Dim ObjInv As New ClsInventarios()
|
||||
If ObjInv.GetTiposAlmacenes() Then
|
||||
DdlTipoAlmacen.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
DdlTipoAlmacen.DataBind()
|
||||
|
||||
DdlTipoAlmacen.SelectedValueExist(1)
|
||||
|
||||
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValue = Request("CveAlmacen").ToString
|
||||
CargaClasificaciones()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
DdlMarca.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
ddlAlmacen.DataSource = GlobalDTAlmacenUsuarios(UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, -1)
|
||||
ddlAlmacen.DataBind()
|
||||
|
||||
Dim ObjInv As New ClsInventarios()
|
||||
If ObjInv.GetTiposAlmacenes() Then
|
||||
DdlTipoAlmacen.DataSource = ObjInv.DtResultados
|
||||
End If
|
||||
ObjInv.Dispose()
|
||||
DdlTipoAlmacen.DataBind()
|
||||
|
||||
DdlTipoAlmacen.SelectedValueExist(1)
|
||||
|
||||
If IfNull(Request("CveAlmacen"), "-1").ToString.ToEntero > 0 Then ddlAlmacen.SelectedValue = Request("CveAlmacen").ToString
|
||||
CargaClasificaciones()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaClasificaciones()
|
||||
Dim CveClasificacion As Integer = If(Request("CveClasificacion") IsNot Nothing, Request("CveClasificacion").ToString, "-1").ToEntero
|
||||
|
||||
Dim ObjClasificaciones As New ClsClasificaciones
|
||||
@@ -89,193 +89,193 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
DdlClasificacion.DataBind()
|
||||
End If
|
||||
End If
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS()
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
|
||||
If Not ddlProducto2.UsaWebService Then
|
||||
'Dim Filtro = If(DdlClasificacion.SelectedValue >= 0, String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue), "")
|
||||
ddlProducto2.ddl.Items.Clear()
|
||||
ddlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero).FiltraParametros($"CveTipoPS=2", "PSCodigo")
|
||||
ddlProducto2.DataBind()
|
||||
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaFuncionalidad105()
|
||||
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
DdlProveedor.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If ddlProducto2.UsaWebService Then
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.ClientID)
|
||||
DdlClasificacion.AutoPostBack = False
|
||||
|
||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||
Else
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
|
||||
DdlProveedor.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
|
||||
|
||||
DdlUnidadMedida.Items.Clear()
|
||||
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
DdlUnidadMedida.DataBind()
|
||||
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
CargarKardex(CveProducto)
|
||||
'If CveProducto > 0 Then
|
||||
|
||||
'Else
|
||||
' Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
ObjClasificaciones.Dispose()
|
||||
|
||||
DdlClasificacion.DataBind()
|
||||
DdlClasificacion.SelectedValueExist(CveClasificacion)
|
||||
|
||||
End Sub
|
||||
Protected Sub DdlClasificacion_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles DdlClasificacion.SelectedIndexChanged
|
||||
CargaPS()
|
||||
End Sub
|
||||
Private Sub CargaPS()
|
||||
|
||||
If Not ddlProducto2.UsaWebService Then
|
||||
'Dim Filtro = If(DdlClasificacion.SelectedValue >= 0, String.Format("CveClasificacion={0}", DdlClasificacion.SelectedValue), "")
|
||||
ddlProducto2.ddl.Items.Clear()
|
||||
ddlProducto2.DataSource = GlobalDTPSSimplificado(UsuarioActual.CveEmpresa, CveClasificacion:=DdlClasificacion.SelectedValue.ToEntero).FiltraParametros($"CveTipoPS=2", "PSCodigo")
|
||||
ddlProducto2.DataBind()
|
||||
ddlProducto2.ddl.Items.Insert(0, New ListItem(" Seleccione ", "-1"))
|
||||
End If
|
||||
End Sub
|
||||
Private Sub CargaFuncionalidad105()
|
||||
ddlProducto2.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
DdlProveedor.setEsWebService(UsuarioActual.Empresa.Funcionalidad(105) = "1")
|
||||
|
||||
If ddlProducto2.UsaWebService Then
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-Estatus", "-1")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-pagina", "Inventarios")
|
||||
ddlProducto2.ddlWS.Attributes.Add("data-idClasificacion", DdlClasificacion.ClientID)
|
||||
DdlClasificacion.AutoPostBack = False
|
||||
|
||||
DdlProveedor.Attributes.Add("data-metodo", "getproveedores")
|
||||
Else
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
ddlProducto2.ddl.Items.Add(New ListItem("*** Actualizar listado de Productos o Servicios ***", "-2"))
|
||||
|
||||
DdlProveedor.ddl.Items.Add(New ListItem("Seleccione", "-1"))
|
||||
DdlProveedor.DataSource = GlobalDTCompProveedores(UsuarioActual.CveEmpresa)
|
||||
DdlProveedor.DataBind()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
Protected Sub ddlProducto_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlProducto2.selectedindexchange
|
||||
|
||||
DdlUnidadMedida.Items.Clear()
|
||||
DdlUnidadMedida.DataSource = GlobalDTProductosServiciosEquivalencias(ddlProducto2.SelectedValue.ToEntero, -1, UsuarioActual.CveEmpresa)
|
||||
DdlUnidadMedida.DataBind()
|
||||
DdlUnidadMedida.Items.Insert(0, New ListItem("Todos", "-1"))
|
||||
|
||||
End Sub
|
||||
Protected Sub btConsultar_Click(sender As Object, e As EventArgs) Handles btConsultar.Click
|
||||
Dim CveProducto As Integer = ddlProducto2.SelectedValue.ToEntero
|
||||
CargarKardex(CveProducto)
|
||||
'If CveProducto > 0 Then
|
||||
|
||||
'Else
|
||||
' Alert("Seleccione un producto.", TipoMensaje.MsgAdvertencia)
|
||||
'End If
|
||||
|
||||
End Sub
|
||||
Private Sub CargarKardex(CvePS As Integer)
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim ObjMovimientos As New ClsInventarios
|
||||
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
' Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim FechaF As Date = TxtFechaF.Text.ToDate
|
||||
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero
|
||||
Dim dt As DataTable = Nothing
|
||||
Dim ObjMovimientos As New ClsInventarios
|
||||
Dim FechaI As String = "-1" ' If(TxtFechaI.Text <> "" AndAlso TxtFechaI.Text <> "__/__/____", TxtFechaI.Text, "-1")
|
||||
' Dim FechaF As String = If(TxtFechaF.Text <> "" AndAlso TxtFechaF.Text <> "__/__/____", TxtFechaF.Text, "-1")
|
||||
Dim FechaF As Date = TxtFechaF.Text.ToDate
|
||||
Dim CveAlmacenes As String = ddlAlmacen.GetSelectedValues()
|
||||
Dim CveProveedorCompra As Integer = If(DdlProveedor.SelectedValue.ToEntero > 0, DdlProveedor.SelectedValue.ToEntero, -1)
|
||||
Dim Marcas As String = If(DdlMarca.GetSelectedValuesM = "", "-1", DdlMarca.GetSelectedValuesM)
|
||||
Dim GPO As Integer = Ddlgrupo.SelectedValue.ToEntero
|
||||
Dim IncluyeTransitorios As Integer = DdlIncluyeTransitorios.SelectedValue.ToEntero
|
||||
|
||||
|
||||
Dim CodigoInicio As String = If(TxtCodigoInicio.Text.Trim.Length = 0, "-1", TxtCodigoInicio.Text.Trim)
|
||||
Dim CodigoFin As String = If(TxtCodigoFinal.Text.Trim.Length = 0, "-1", TxtCodigoFinal.Text.Trim)
|
||||
|
||||
Dim CodigoFin As String = If(TxtCodigoFinal.Text.Trim.Length = 0, "-1", TxtCodigoFinal.Text.Trim)
|
||||
|
||||
If ObjMovimientos.GetKardexAlmacenHorizontal(CvePS, FechaF, -1, DdlUnidadMedida.SelectedValue.ToEntero, CveProveedorCompra, DdlTipoAlmacen.SelectedValue.ToEntero(), IncluyeTransitorios,
|
||||
DdlClasificacion.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, CondicionExistencias:=DdlExistencia.SelectedValue.ToEntero,
|
||||
Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO, CodigoPS:=TxtPS.Text,
|
||||
CodigoInicio:=CodigoInicio, CodigoFin:=CodigoFin) Then
|
||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||
dt = ObjMovimientos.DtResultados
|
||||
Dim ListaBorrar As New List(Of DataColumn)
|
||||
For index As Integer = 3 To dt.Columns.Count - 1
|
||||
Dim TotColumna As Double = 0
|
||||
For Each Dr As DataRow In dt.Rows
|
||||
TotColumna += Dr.Item(index).ToString.ToDouble
|
||||
Orden:=DdlOrden.SelectedValue.ToEntero(), Marcas:=Marcas, IncluyeProyectado:=DdlProyeccionFiltro.SelectedValue.ToEntero, CveAlmacenes:=CveAlmacenes, GPO:=GPO, CodigoPS:=TxtPS.Text,
|
||||
CodigoInicio:=CodigoInicio, CodigoFin:=CodigoFin) Then
|
||||
If ObjMovimientos.DtResultados IsNot Nothing AndAlso ObjMovimientos.DtResultados.Rows.Count > 0 Then
|
||||
dt = ObjMovimientos.DtResultados
|
||||
Dim ListaBorrar As New List(Of DataColumn)
|
||||
For index As Integer = 3 To dt.Columns.Count - 1
|
||||
Dim TotColumna As Double = 0
|
||||
For Each Dr As DataRow In dt.Rows
|
||||
TotColumna += Dr.Item(index).ToString.ToDouble
|
||||
Next
|
||||
If Not TotColumna > 0 Then
|
||||
ListaBorrar.Add(dt.Columns(index))
|
||||
End If
|
||||
Next
|
||||
For Each item As DataColumn In ListaBorrar
|
||||
dt.Columns().Remove(item)
|
||||
Next
|
||||
dt.AcceptChanges()
|
||||
GvDatos.DataSource = dt
|
||||
Else
|
||||
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
|
||||
GvDatos.Columns.Clear()
|
||||
Next
|
||||
For Each item As DataColumn In ListaBorrar
|
||||
dt.Columns().Remove(item)
|
||||
Next
|
||||
dt.AcceptChanges()
|
||||
GvDatos.DataSource = dt
|
||||
Else
|
||||
Alert("La búsqueda no contiene resultados.", TipoMensaje.MsgAdvertencia)
|
||||
GvDatos.Columns.Clear()
|
||||
dt = Nothing
|
||||
Exit Sub
|
||||
Exit Sub
|
||||
End If
|
||||
Else
|
||||
ObjMovimientos.Dispose()
|
||||
Alert("Ocurrió un error al consultar el Kardex.", TipoMensaje.MsgError)
|
||||
Exit Sub
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
For index = 4 To GvDatos.Rows(0).Cells.Count - 1
|
||||
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|"c)(0)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
|
||||
'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
|
||||
|
||||
'e.Row.Attributes.Add("style", " max-height:31px!important")
|
||||
|
||||
GvDatos.DataBind()
|
||||
|
||||
For index = 4 To GvDatos.Rows(0).Cells.Count - 1
|
||||
GvDatos.HeaderRow.Cells(index).Text = GvDatos.HeaderRow.Cells(index).Text.Split("|"c)(0)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Protected Sub GvDatos_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowDataBound
|
||||
|
||||
If e.Row.RowType = DataControlRowType.DataRow Then
|
||||
'Dim Liga As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={e.Row.DataKey("CveAlmacen")}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
|
||||
'e.Row.FCHyperLink("HplAlmacen").NavigateUrl = Liga
|
||||
|
||||
If e.Row.RowIndex = 0 Then
|
||||
e.Row.CssClass = "Totales"
|
||||
End If
|
||||
|
||||
|
||||
'e.Row.Attributes.Add("style", " max-height:31px!important")
|
||||
|
||||
e.Row.HorizontalAlign = HorizontalAlign.Right
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
||||
Dim Index As Integer = 0
|
||||
|
||||
For Each Cells As TableCell In e.Row.Cells
|
||||
Dim Celda As String = Cells.Text
|
||||
If IsNumeric(Celda) Then
|
||||
Dim CveAlmacen2 As Integer = -1
|
||||
If Index >= 5 Then
|
||||
Dim Array As String() = GvDatos.HeaderRow.Cells(Index).Text.Split("|"c)
|
||||
If Array.Length > 1 Then
|
||||
CveAlmacen2 = Array(1).ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If Celda.ToDouble = 0 Then
|
||||
Cells.Text = ""
|
||||
Else
|
||||
Dim ce = DirectCast(Cells, System.Web.UI.WebControls.DataControlFieldCell)
|
||||
|
||||
If ce.ContainingField.HeaderText = "CP" Then
|
||||
Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
ElseIf ce.ContainingField.HeaderText = "Valor" Then
|
||||
Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
'ElseIf ce.ContainingField.HeaderText = "Total" Then
|
||||
' Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
Else
|
||||
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
|
||||
End If
|
||||
End If
|
||||
e.Row.Cells(e.Row.Cells.GetCellIndex(Cells)).Width = Unit.Pixel(80)
|
||||
'Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
|
||||
'Cells.Text = String.Format("<a href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2)
|
||||
End If
|
||||
Index = Index + 1
|
||||
Next
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
|
||||
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
|
||||
' e.Row.Cells(0).Width = New Unit("200px")
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.Cells(3).Visible = False
|
||||
If e.Row.RowType = DataControlRowType.Header Then
|
||||
'e.Row.Cells(6).ToolTip = "Costo"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
Imprimir("Excel")
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
e.Row.Cells(0).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(1).HorizontalAlign = HorizontalAlign.Left
|
||||
e.Row.Cells(2).HorizontalAlign = HorizontalAlign.Left
|
||||
Dim Index As Integer = 0
|
||||
|
||||
For Each Cells As TableCell In e.Row.Cells
|
||||
Dim Celda As String = Cells.Text
|
||||
If IsNumeric(Celda) Then
|
||||
Dim CveAlmacen2 As Integer = -1
|
||||
If Index >= 5 Then
|
||||
Dim Array As String() = GvDatos.HeaderRow.Cells(Index).Text.Split("|"c)
|
||||
If Array.Length > 1 Then
|
||||
CveAlmacen2 = Array(1).ToEntero
|
||||
End If
|
||||
End If
|
||||
|
||||
If Celda.ToDouble = 0 Then
|
||||
Cells.Text = ""
|
||||
Else
|
||||
Dim ce = DirectCast(Cells, System.Web.UI.WebControls.DataControlFieldCell)
|
||||
|
||||
If ce.ContainingField.HeaderText = "CP" Then
|
||||
Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
ElseIf ce.ContainingField.HeaderText = "Valor" Then
|
||||
Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
'ElseIf ce.ContainingField.HeaderText = "Total" Then
|
||||
' Cells.Text = Cells.Text.FormatoNumero(2)
|
||||
Else
|
||||
Cells.Text = String.Format("{0:#,###.##}", Cells.Text.ToDecimal)
|
||||
End If
|
||||
End If
|
||||
e.Row.Cells(e.Row.Cells.GetCellIndex(Cells)).Width = Unit.Pixel(80)
|
||||
'Dim Liga2 As String = String.Format($"/Inventarios/Kardex.aspx?CvePS={ddlProducto2.SelectedValue.ToEntero}&CveAlmacen={CveAlmacen2}&CveUM={DdlUnidadMedida.SelectedValue.ToEntero}&FechaI={TxtFechaI.Text}&FechaF={TxtFechaF.Text}")
|
||||
'Cells.Text = String.Format("<a href=""{1}"">{0}</a>", Celda.FormatoNumero(), Liga2)
|
||||
End If
|
||||
Index = Index + 1
|
||||
Next
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GvDatos_RowCreated(sender As Object, e As GridViewRowEventArgs) Handles GvDatos.RowCreated
|
||||
'Escondo CvePS y CveAlmacén (Se generan por autogeneratecolumns por eso se borran por aqui).
|
||||
' e.Row.Cells(0).Width = New Unit("200px")
|
||||
e.Row.Cells(2).Visible = False
|
||||
e.Row.Cells(3).Visible = False
|
||||
If e.Row.RowType = DataControlRowType.Header Then
|
||||
'e.Row.Cells(6).ToolTip = "Costo"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub LnkExportar_Click(sender As Object, e As EventArgs) Handles LnkExportar.Click
|
||||
|
||||
Imprimir("Excel")
|
||||
End Sub
|
||||
Private Sub Imprimir(Optional reporte As String = "PDF")
|
||||
If GvDatos.Rows.Count > 0 Then
|
||||
Dim StrFiltro As New StringBuilder
|
||||
If DdlProveedor.SelectedValue.ToEntero > 0 Then StrFiltro.AppendFormat("Proveedor: {0},", DdlProveedor.SelectedText)
|
||||
@@ -284,7 +284,7 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
ExportToExcelG(GvDatos, "ExistenciasHorizontal_" & TxtFechaF.Text, "Existencias Almacen", UsuarioActual, StrFiltro.ToString, 100, 200)
|
||||
Else
|
||||
Alert("Debe consultar para generar un excel", TipoMensaje.MsgAdvertencia)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub ExportToExcelG(Gv As GridView, NombreArchivoXLSx As String, Optional Titulo As String = "Reporte", Optional Usuario As Usuario = Nothing, Optional Filtros As String = "", Optional AlturaImagen As Double = 100, Optional AnchoImagen As Double = 100)
|
||||
@@ -371,12 +371,12 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
|
||||
excel.Save(HttpContext.Current.Response, $"{NombreArchivoXLSx}.xlsx")
|
||||
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub LnkProyectado_Click(sender As Object, e As EventArgs)
|
||||
RegistraScript(String.Format("$('#{0}').modal();", "DivProyeccion"))
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnDescargarFormato_Click(sender As Object, e As EventArgs)
|
||||
Dim Directorio As String = ModExtensiones.DirectorioBaseEmpresas & "Empresas\Grales\Formatos\KardexProyeccion.xlsx"
|
||||
|
||||
@@ -392,8 +392,8 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
Response.TransmitFile(Archivo.FullName)
|
||||
Response.End()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub BtnAgregarProyeccion_Click(sender As Object, e As EventArgs)
|
||||
If TxtProyeccionExcel.getfiles().Archivos.Count > 0 Then
|
||||
Dim file As Archivo = TxtProyeccionExcel.getfiles().Archivos(0)
|
||||
@@ -418,8 +418,8 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
End If
|
||||
|
||||
AgregarProyeccion(dt)
|
||||
End Sub
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub AgregarProyeccion(dt As DataTable)
|
||||
Dim TieneError As Boolean = False
|
||||
Dim StrCodigo As New StringBuilder
|
||||
@@ -460,8 +460,8 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
ObjInventarios.Dispose()
|
||||
RegistraScript(String.Format("$('#{0}').modal('hide');", "DivProyeccion"))
|
||||
|
||||
End Sub
|
||||
|
||||
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)
|
||||
@@ -512,8 +512,8 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
|
||||
' Return dataTable
|
||||
|
||||
'End Function
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
'End Function
|
||||
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
|
||||
End Sub
|
||||
|
||||
Private Sub LnkPOG_Click(sender As Object, e As EventArgs) Handles LnkPOG.Click
|
||||
@@ -599,4 +599,4 @@ Partial Class Inventarios_KardexAlmacenHorizontal
|
||||
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Class
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
<asp:UpdatePanel runat="server" ID="UpAgregar" UpdateMode="Conditional" >
|
||||
<asp:UpdatePanel runat="server" ID="UpAcciones" UpdateMode="Conditional" >
|
||||
<ContentTemplate>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="BtnAgregar" Visible="false" data-toggle="tooltip" data-placement="left" title="Procesar" Text="<i class='fa fa-plus'></i> Procesar"></asp:LinkButton>
|
||||
</li>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkEnviarAsistencia" Visible="false" data-toggle="tooltip" data-placement="left" title="Enviar Asistencia" Text="<i class='fa fa-arrow-right'></i> Enviar Asistencia"
|
||||
OnClick="LnkEnviarAsistencia_Click"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -32,46 +36,28 @@
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
<div class="titlefiltros caption ">
|
||||
|
||||
|
||||
<ul class="list-inline text-size-12">
|
||||
<li>Ejercicio:
|
||||
|
||||
<asp:DropDownList ID="DdlEjercicios" runat="server" OnSelectedIndexChanged="DdlEjercicios_SelectedIndexChanged" AutoPostBack="true"
|
||||
style="width: 120px !important;" CssClass="select2me" DataValueField="Ejercicio" DataTextField="Ejercicio"></asp:DropDownList>
|
||||
|
||||
</li>
|
||||
<li>Tipo Periodo:
|
||||
<asp:DropDownList ID="DdlTipoPeriodo" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="width: 120px !important;" ValidationGroup="GrpGuardar" DataTextField="TipoPeriodo" DataValueField="CveTipoPeriodo">
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<li><asp:label ID="LblPeriodo" runat="server" Visible="true" >Periodo:</asp:label>
|
||||
<asp:DropDownList ID="DdlRango" Visible="true" AutoPostBack="true" runat="server" CssClass="form-control input-sm select2me" Style="width: 275px !important;" DataTextField="NominaEstatus" DataValueField="CvePeriodo" ValidationGroup="GrpGuardar">
|
||||
</asp:DropDownList>
|
||||
<li>
|
||||
Período:
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me"
|
||||
DataTextField="NominaEstatus" DataValueField="CvePeriodo" style="width: 120px !important;" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
</li>
|
||||
<%--<li>Fecha Inicio:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtInicio" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaInicio" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEEFecha" runat="server" TargetControlID="TxtInicio" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CEFecha" TargetControlID="TxtInicio" PopupButtonID="ImgFechaInicio" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:RequiredFieldValidator ID="RFVFecha" runat="server" ControlToValidate="TxtInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha inicio''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CVFecha" runat="server" ControlToValidate="TxtInicio" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha1" runat="server" HighlightCssClass="vco" TargetControlID="RFVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="VCOFecha2" runat="server" HighlightCssClass="vco" TargetControlID="CVFecha" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>
|
||||
<li>Fecha Fin:
|
||||
<div class="input-group input-sm date date-picker " data-date-format="dd/mm/yyyy" style="display: inline-block;">
|
||||
<asp:TextBox ID="TxtFechaFin" runat="server" CssClass="form-control input-sm" CausesValidation="true" MaxLength="10" Width="82px "></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgFechaFin" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="MEETxtFechaFin" runat="server" TargetControlID="TxtFechaFin" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtFechaFin" TargetControlID="TxtFechaFin" PopupButtonID="ImgFechaFin" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
|
||||
<asp:RequiredFieldValidator ID="RfvTxtFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha Fin''</b> es necesario, por favor ingréselo." ValidationGroup="GrpEmitirImprimir"></asp:RequiredFieldValidator>
|
||||
<asp:CompareValidator ID="CvTxtFechaFin" runat="server" ControlToValidate="TxtFechaFin" Display="None" ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Fecha''</b> no tiene el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpEmitirImprimir"></asp:CompareValidator>
|
||||
|
||||
<ajax:ValidatorCalloutExtender ID="RfvcTxtFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<ajax:ValidatorCalloutExtender ID="CvcTxtFechaFin" runat="server" HighlightCssClass="vco" TargetControlID="CvTxtFechaFin" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</li>--%>
|
||||
|
||||
<li>SubProyecto:
|
||||
<asp:DropDownList ID="DdlSubProyecto" runat="server" CssClass="form-control input-sm select2me" Style="width: 135px; !important;" DataTextField="SubProyecto" DataValueField="CveSubproyecto">
|
||||
</asp:DropDownList>
|
||||
@@ -340,7 +326,7 @@
|
||||
<div class="modal-footer">
|
||||
<div class="row">
|
||||
<asp:Button ID="BtnGuardar" Visible="true" runat="server" Text="Guardar" class="btn btn-primary" OnClick="BtnGuardar_Click" />
|
||||
<asp:Button ID="BtnEstusAsistenciaModal" Visible="false" runat="server" class="btn btn-success" Text="Aceptar" />
|
||||
<%--<asp:Button ID="BtnEstusAsistenciaModal" Visible="false" runat="server" class="btn btn-success" Text="Aceptar" />--%>
|
||||
<button id="Button4" runat="server" type="button" class="btn default" data-dismiss="modal">Cerrar</button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Option Strict On
|
||||
|
||||
Imports Extensiones
|
||||
Imports System.Data
|
||||
|
||||
@@ -60,16 +61,16 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property DTPeridos As DataTable
|
||||
Private Property DTPeriodos As DataTable
|
||||
Get
|
||||
If ViewState("DTPeridoso") Is Nothing Then
|
||||
If ViewState("DTPeriodos") Is Nothing Then
|
||||
Return New DataTable
|
||||
Else
|
||||
Return DirectCast(ViewState("DTPeridoso"), DataTable)
|
||||
Return DirectCast(ViewState("DTPeriodos"), DataTable)
|
||||
End If
|
||||
End Get
|
||||
Set(value As DataTable)
|
||||
ViewState("DTPeridoso") = value
|
||||
ViewState("DTPeriodos") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -153,11 +154,26 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
End Property
|
||||
|
||||
|
||||
'Private Property dtPeriodos As DataTable
|
||||
' Get
|
||||
' If ViewState("dtPeriodos") Is Nothing Then
|
||||
' Return Nothing
|
||||
' Else
|
||||
' Return DirectCast(ViewState("dtPeriodos"), DataTable)
|
||||
' End If
|
||||
' End Get
|
||||
' Set(value As DataTable)
|
||||
' ViewState("dtPeriodos") = value
|
||||
' End Set
|
||||
'End Property
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub RH_RepChecadorIncidencias_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
If Not Page.IsPostBack Then
|
||||
cargaEjercicios()
|
||||
CargaCombos()
|
||||
End If
|
||||
|
||||
@@ -165,6 +181,81 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Private Sub cargaEjercicios()
|
||||
Dim EjercicioActual As Integer = UsuarioActual.Empresa.EjercicioActual
|
||||
If EjercicioActual = 0 Then
|
||||
EjercicioActual = Now.Year
|
||||
End If
|
||||
|
||||
Dim dtejercicio As DataTable = Nothing
|
||||
Using objnom As New ClsNominas()
|
||||
If objnom.GetEjercicios(UsuarioActual.CveEmpresa) Then
|
||||
dtejercicio = objnom.DtResultados
|
||||
End If
|
||||
End Using
|
||||
|
||||
DdlEjercicios.DataSource = dtejercicio
|
||||
DdlEjercicios.DataBind()
|
||||
|
||||
Dim litem As ListItem = Nothing
|
||||
If dtejercicio IsNot Nothing AndAlso dtejercicio.Rows.Count > 0 Then
|
||||
If dtejercicio.Compute("COUNT(Ejercicio)", String.Format("Ejercicio={0}", EjercicioActual)).ToString.ToEntero = 0 Then
|
||||
litem = New ListItem(EjercicioActual.ToString(), EjercicioActual.ToString())
|
||||
DdlEjercicios.Items.Insert(0, litem)
|
||||
End If
|
||||
If dtejercicio.Compute("COUNT(Ejercicio)", String.Format("Ejercicio={0}", EjercicioActual - 1)).ToString.ToEntero = 0 Then
|
||||
litem = New ListItem((EjercicioActual - 1).ToString(), (EjercicioActual - 1).ToString())
|
||||
DdlEjercicios.Items.Insert(1, litem)
|
||||
' DdlEjerciciosCM.Items.Insert(1, litem)
|
||||
End If
|
||||
Else
|
||||
litem = New ListItem(EjercicioActual.ToString(), EjercicioActual.ToString())
|
||||
DdlEjercicios.Items.Insert(0, litem)
|
||||
'DdlEjerciciosCM.Items.Insert(0, litem)
|
||||
litem = New ListItem((EjercicioActual - 1).ToString(), (EjercicioActual - 1).ToString())
|
||||
DdlEjercicios.Items.Insert(1, litem)
|
||||
'DdlEjerciciosCM.Items.Insert(1, litem)
|
||||
End If
|
||||
|
||||
If DdlEjercicios.Items.Count > 0 Then
|
||||
DdlEjercicios.SelectedIndex = 0
|
||||
End If
|
||||
|
||||
' Additional method to check if selected value exists, and set it if it does
|
||||
DdlEjercicios.SelectedValueExist(Now.Year.ToString())
|
||||
End Sub
|
||||
|
||||
Protected Sub DdlEjercicios_SelectedIndexChanged(sender As Object, e As EventArgs)
|
||||
cargaPeriodos()
|
||||
End Sub
|
||||
|
||||
Private Sub cargaPeriodos()
|
||||
BtnConsultar.Enabled = False
|
||||
Dim tipoPeriodo As Integer = DdlTipoPeriodo.SelectedValue.ToEntero()
|
||||
Dim ejercicio As Integer = DdlEjercicios.SelectedValue.ToEntero()
|
||||
DTPeriodos = Nothing
|
||||
|
||||
If DdlTipoPeriodo.SelectedValue.ToEntero() > 0 Then
|
||||
Using objPeriodos As New ClsNominas()
|
||||
If objPeriodos.GetPeriodos(tipoPeriodo, UsuarioActual.CveEmpresa, ejercicio, -1, -1) Then
|
||||
If objPeriodos.DtResultados.Rows.Count = 0 Then
|
||||
Alert("No existen periodos registrados en este año y tipo de periodo, ¿desea registrarlos masivamente?", TipoMensaje.MsgConfirmacion, "$(""#divCargaMasiva"").modal(""show"");", TextoConfirmacion:="Aceptar", TextoSegundoBoton:="No")
|
||||
End If
|
||||
DTPeriodos = objPeriodos.DtResultados.FiltraParametros("Estatus IN (1,2,3,4,5)")
|
||||
End If
|
||||
End Using
|
||||
|
||||
BtnConsultar.Enabled = True
|
||||
End If
|
||||
|
||||
DdlPeriodo.DataSource = DTPeriodos
|
||||
DdlPeriodo.DataBind()
|
||||
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione", "-1"))
|
||||
UPFiltros.Update()
|
||||
'muestraPeriodo()
|
||||
End Sub
|
||||
|
||||
Private Sub CargaCombos()
|
||||
|
||||
|
||||
@@ -198,10 +289,10 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
lblTituloPagina.Text = ""
|
||||
|
||||
If DdlRango.SelectedIndex > 0 Then
|
||||
lblTituloPagina.Text = DdlRango.SelectedItem.Text
|
||||
If DdlPeriodo.SelectedIndex > 0 Then
|
||||
lblTituloPagina.Text = DdlPeriodo.SelectedItem.Text
|
||||
|
||||
Dim DtTemp As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
||||
Dim DtTemp As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||
FechaInicioPeriodo = DtTemp(0)("FechaInicio").ToString().ToDate
|
||||
FechaFinPeriodo = DtTemp(0)("FechaFin").ToString().ToDate
|
||||
End If
|
||||
@@ -212,8 +303,8 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
Protected Sub DdlTipoPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlTipoPeriodo.SelectedIndexChanged
|
||||
|
||||
DdlRango.Items.Clear()
|
||||
DTPeridos = Nothing
|
||||
DdlPeriodo.Items.Clear()
|
||||
DTPeriodos = Nothing
|
||||
|
||||
Dim objRh As New ClsRH
|
||||
|
||||
@@ -222,53 +313,57 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
CveTipoPeriodo = DdlTipoPeriodo.SelectedValue.ToEntero
|
||||
DiasPeriodo = DTTipoPeriodoDatos.FiltraParametros(" CveTipoPeriodo = " & DdlTipoPeriodo.SelectedValue)(0)("DiasPeriodo").ToString().ToEntero
|
||||
|
||||
Dim objNomina As New ClsNominas
|
||||
|
||||
If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
|
||||
cargaPeriodos()
|
||||
|
||||
TxtFechaModal.Text = ""
|
||||
lblTituloPagina.Text = ""
|
||||
UpTituloPagina.Update()
|
||||
UpModalFechaBody.Update()
|
||||
'Dim objNomina As New ClsNominas
|
||||
|
||||
If objNomina.DtResultados.Rows.Count > 0 Then
|
||||
BtnConsultar.Enabled = True
|
||||
DTPeridos = objNomina.DtResultados
|
||||
Dim DTPeridosView As DataView = DTPeridos.DefaultView
|
||||
DTPeridosView.Sort = " FechaInicio desc "
|
||||
DTPeridos = DTPeridosView.ToTable
|
||||
DdlRango.DataSource = objNomina.DtResultados
|
||||
'If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
|
||||
|
||||
' LblPeriodo.Visible = True
|
||||
'DdlRango.Visible = True
|
||||
Else
|
||||
' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});")
|
||||
Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia)
|
||||
DTPeridos = Nothing
|
||||
DdlRango.DataSource = Nothing
|
||||
End If
|
||||
Else
|
||||
DTPeridos = Nothing
|
||||
DdlRango.DataSource = Nothing
|
||||
End If
|
||||
' TxtFechaModal.Text = ""
|
||||
' lblTituloPagina.Text = ""
|
||||
' UpTituloPagina.Update()
|
||||
' UpModalFechaBody.Update()
|
||||
|
||||
Dim DtTempFechaInicial As DataTable = DTPeridos.FiltraParametros("Estatus = 1")
|
||||
' If objNomina.DtResultados.Rows.Count > 0 Then
|
||||
' BtnConsultar.Enabled = True
|
||||
' DTPeriodos = objNomina.DtResultados
|
||||
' Dim DTPeridosView As DataView = DTPeriodos.DefaultView
|
||||
' DTPeridosView.Sort = " FechaInicio desc "
|
||||
' DTPeriodos = DTPeridosView.ToTable
|
||||
' DdlPeriodo.DataSource = objNomina.DtResultados
|
||||
|
||||
objNomina.Dispose()
|
||||
DdlRango.DataBind()
|
||||
' ' LblPeriodo.Visible = True
|
||||
' 'DdlRango.Visible = True
|
||||
' Else
|
||||
' ' RegistraScript("$('#ModalModalFecha').modal({ backdrop: 'static', keyboard: false});")
|
||||
' Alert("No se encontraron periodos disponibles.", TipoMensaje.MsgAdvertencia)
|
||||
' DTPeriodos = Nothing
|
||||
' DdlPeriodo.DataSource = Nothing
|
||||
' End If
|
||||
'Else
|
||||
' DTPeriodos = Nothing
|
||||
' DdlPeriodo.DataSource = Nothing
|
||||
'End If
|
||||
'objNomina.Dispose()
|
||||
|
||||
Dim DtTempFechaInicial As DataTable = DTPeriodos.FiltraParametros("Estatus = 1")
|
||||
|
||||
|
||||
DdlPeriodo.DataBind()
|
||||
|
||||
If DtTempFechaInicial.Rows.Count > 0 Then
|
||||
Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero
|
||||
DdlRango.SelectedValueExist(temCvePeriodoNomi)
|
||||
DdlPeriodo.SelectedValueExist(temCvePeriodoNomi)
|
||||
End If
|
||||
|
||||
DdlRango.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
|
||||
UPFiltros.Update()
|
||||
' BtnConsultar.Enabled = True
|
||||
Else
|
||||
|
||||
DTPeridos = Nothing
|
||||
DdlRango.DataSource = Nothing
|
||||
DTPeriodos = Nothing
|
||||
DdlPeriodo.DataSource = Nothing
|
||||
|
||||
'DdlRango.Visible = False
|
||||
' LblPeriodo.Visible = Fale
|
||||
@@ -281,7 +376,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
GeneraFechasInicioFinPerdiodo()
|
||||
End Sub
|
||||
|
||||
Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlRango.SelectedIndexChanged
|
||||
Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged
|
||||
|
||||
GeneraFechasInicioFinPerdiodo()
|
||||
UpTituloPagina.Update()
|
||||
@@ -302,7 +397,8 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
Dim dt As New DataTable
|
||||
|
||||
Dim Retardos As Integer = 0
|
||||
Dim DTAsistenciasInasistencias As New DataTable
|
||||
'Dim DTAsistenciasInasistencias As New DataTable
|
||||
Dim DTPreAsistenciasInasistencias As New DataTable
|
||||
Dim DTChecadorRegistros As New DataTable
|
||||
Dim DTHorarios As New DataTable
|
||||
Dim DTDiasInhabiles As New DataTable
|
||||
@@ -376,7 +472,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
Resultados.Columns.Add("TipoCorto")
|
||||
Resultados.Columns.Add("Sancion")
|
||||
|
||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then
|
||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlPeriodo.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim FiltroSubProyecto As String = ""
|
||||
Dim filtroturno = If(DdlTurno.SelectedValue = "-1", "", $"AND CveTurno = { DdlTurno.SelectedValue}")
|
||||
@@ -388,7 +484,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
'DtPersonal = GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto)
|
||||
|
||||
Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
||||
Dim DtTempPeriodo As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
||||
|
||||
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable()
|
||||
@@ -439,8 +535,12 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
DtVacaciones = objRH.DtResultados
|
||||
End If
|
||||
|
||||
If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
||||
DTAsistenciasInasistencias = objRH.DtResultados
|
||||
'If objRH.GetPersonalAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
||||
' DTAsistenciasInasistencias = objRH.DtResultados
|
||||
'End If
|
||||
|
||||
If objRH.GetPersonalPreAsistenciaRegistros(FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.CveEmpresa) Then
|
||||
DTPreAsistenciasInasistencias = objRH.DtResultados
|
||||
End If
|
||||
|
||||
'If objRH.ChecadorPreAsistenciaRegistrosAsistenciasGet(CveTipoPeriodo, FechaInicioPeriodo, FechaFinPeriodo, UsuarioActual.Empresa.CveEmpresa) Then
|
||||
@@ -536,122 +636,166 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
Dim tabladelDia As DataTable = registrosPersonal.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND FechaRegistro >= '" & tempDatetime1.ToShortDateString & "' AND FechaRegistro <= '" & tempDatetime2.ToString() & "'")
|
||||
|
||||
If DTAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha >= '" & Fecha & "'").Rows.Count > 0 Then
|
||||
ReRow("CveAsistenciasInasistencias") = DTAsistenciasInasistencias(0)("CveAsistenciasInasistencias").ToString()
|
||||
|
||||
|
||||
|
||||
If DTPreAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha = '" & Fecha & "'").Rows.Count > 0 Then
|
||||
ReRow("CveAsistenciasInasistencias") = DTPreAsistenciasInasistencias.FiltraParametros(" CvePersonal = " & dRow(0).ToString() & " AND Fecha = '" & Fecha & "'")(0)("CveAsistenciasInasistencias").ToString()
|
||||
|
||||
If ReRow("CveAsistenciasInasistencias").ToString.ToEntero > 0 Then
|
||||
|
||||
Dim drowAsistenciaInasistencia As DataRow = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAsistenciasInasistencias={ReRow("CveAsistenciasInasistencias").ToString.ToEntero}")
|
||||
|
||||
ReRow("Asistio") = drowAsistenciaInasistencia("AplicaAsistencia").ToString = "Aplica"
|
||||
ReRow("PorcentajePago") = DTPreAsistenciasInasistencias(0)("PorcentajePago").ToString.ToDecimal
|
||||
ReRow("Descanso") = drowAsistenciaInasistencia("AplicaVacacion").ToString = "Aplica"
|
||||
ReRow("DiaInhabil") = "False"
|
||||
ReRow("DiaVacacion") = drowAsistenciaInasistencia("AplicaVacacion").ToString = "Aplica"
|
||||
ReRow("FaltaRetardosAcumulados") = drowAsistenciaInasistencia("AplicaFalta").ToString = "Aplica"
|
||||
ReRow("Retraso") = drowAsistenciaInasistencia("AplicaRetardo").ToString = "Aplica"
|
||||
ReRow("FaltaRetraso") = False 'Not drowAsistenciaInasistencia("AplicaAsistencia").ToString = "Aplica"
|
||||
ReRow("TipoCorto") = drowAsistenciaInasistencia("TipoCorto").ToString
|
||||
End If
|
||||
End If
|
||||
|
||||
Dim CountRegistros As Integer = tabladelDia.Rows.Count
|
||||
If Not ReRow("CveAsistenciasInasistencias").ToString.ToEntero > 0 Then
|
||||
|
||||
Dim Inconsistencia As Boolean = False
|
||||
'If tabladelDia.Rows.Count > 0 AndAlso tabladelDia.Rows.Count <> 4 And DiaLaboral = False Then
|
||||
If tabladelDia.Rows.Count > 0 AndAlso tabladelDia.Rows.Count <> 4 Then
|
||||
'Dim drowAsistenciaInasistencia As DataRow = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltroPrimero($"CveAsistenciasInasistencias={ReRow("CveAsistenciasInasistencias").ToString.ToEntero}")
|
||||
|
||||
If Not DiaLaboral Then
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
ReRow("Descanso") = "True"
|
||||
End If
|
||||
ReRow("Asistio") = False
|
||||
ReRow("PorcentajePago") = 0
|
||||
ReRow("Descanso") = False
|
||||
ReRow("DiaInhabil") = False
|
||||
ReRow("DiaVacacion") = False
|
||||
ReRow("FaltaRetardosAcumulados") = False
|
||||
ReRow("Retraso") = False
|
||||
ReRow("FaltaRetraso") = False
|
||||
ReRow("TipoCorto") = "_ND"
|
||||
|
||||
Dim TempDTValidaciones As DataTable = DTDiasInhabiles.FiltraParametros(" FechaInhabil = '" & Fecha.ToString() & "'")
|
||||
If TempDTValidaciones.Rows.Count > 0 Then
|
||||
ReRow("PorcentajePago") = "100"
|
||||
ReRow("DiaInhabil") = "True"
|
||||
ReRow("DiaInhabilStr") = TempDTValidaciones(0)("DiaInhabil").ToString()
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
ReRow("DiaInhabil") = "False"
|
||||
ReRow("DiaInhabilStr") = ""
|
||||
End If
|
||||
Else
|
||||
Dim CountRegistros As Integer = tabladelDia.Rows.Count
|
||||
Dim Inconsistencia As Boolean = False
|
||||
|
||||
TempDTValidaciones = DtVacaciones.FiltraParametros(" Fecha = '" & Fecha.ToString() & "' AND CvePersonal = " & dRow(0).ToString())
|
||||
If Not DiaLaboral Then
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
ReRow("Descanso") = "True"
|
||||
End If
|
||||
|
||||
If TempDTValidaciones.Rows.Count > 0 Then
|
||||
ReRow("DiaVacacion") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Dim TempDTValidaciones As DataTable = DTDiasInhabiles.FiltraParametros(" FechaInhabil = '" & Fecha.ToString() & "'")
|
||||
If TempDTValidaciones.Rows.Count > 0 Then
|
||||
ReRow("PorcentajePago") = "100"
|
||||
ReRow("DiaInhabil") = "True"
|
||||
ReRow("DiaInhabilStr") = TempDTValidaciones(0)("DiaInhabil").ToString()
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
ReRow("DiaInhabil") = "False"
|
||||
ReRow("DiaInhabilStr") = ""
|
||||
End If
|
||||
|
||||
Else
|
||||
ReRow("DiaVacacion") = "False"
|
||||
End If
|
||||
TempDTValidaciones = DtVacaciones.FiltraParametros(" Fecha = '" & Fecha.ToString() & "' AND CvePersonal = " & dRow(0).ToString())
|
||||
|
||||
|
||||
If Fecha >= NowADS() Then
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
|
||||
If ReRow("DiaVacacion").ToString() <> "True" And ReRow("Descanso").ToString() <> "True" Then
|
||||
|
||||
If CountRegistros > 0 Then
|
||||
|
||||
FechaHoraRegistroEntrada = DateTime.Parse(tabladelDia(0)("FechaRegistro").ToString())
|
||||
FechaHoraRegistroSalida = DateTime.Parse(tabladelDia(tabladelDia.Rows.Count - 1)("FechaRegistro").ToString())
|
||||
|
||||
If Not (FechaHoraRegistroEntrada - FechaHoraEntrada).TotalMinutes > TolFalEntradaMin Then
|
||||
If (FechaHoraRegistroEntrada - FechaHoraEntrada).TotalMinutes > TolRetEntradaMin Then
|
||||
|
||||
Retardos = Retardos + 1
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Retardo"
|
||||
|
||||
If Retardos >= TolRetAcumulados Then
|
||||
ReRow("Asistio") = "False"
|
||||
ReRow("FaltaRetardosAcumulados") = "True"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & " Falta por " & TolRetAcumulados & " acumulados. "
|
||||
Retardos = 0
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaRetardo
|
||||
ReRow("PorcentajePago") = "100"
|
||||
End If
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
End If
|
||||
Else
|
||||
Asistencia = False
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Falta por retardo."
|
||||
ReRow("FaltaRetraso") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
End If
|
||||
|
||||
If FechahoraSalida > FechaHoraRegistroSalida Then
|
||||
|
||||
Dim diferenciasalidaMinutos As Integer = (FechahoraSalida - FechaHoraRegistroSalida).TotalMinutes.ToString().ToEntero
|
||||
|
||||
If RetSalidaAntes Then
|
||||
If diferenciasalidaMinutos > TolSalidaAntesMin Then
|
||||
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "True"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Retraso por salida antes de tiempo (" & diferenciasalidaMinutos & " minutos)."
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaRetardo
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "False"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Salida antes de tiempo (" & diferenciasalidaMinutos & " minutos)."
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If TempDTValidaciones.Rows.Count > 0 Then
|
||||
ReRow("DiaVacacion") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaDescanso
|
||||
ReRow("PorcentajePago") = "100"
|
||||
|
||||
Else
|
||||
ReRow("Asistio") = "False"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
ReRow("DiaVacacion") = "False"
|
||||
End If
|
||||
|
||||
|
||||
If Fecha >= NowADS() Then
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
|
||||
If ReRow("DiaVacacion").ToString() <> "True" And ReRow("Descanso").ToString() <> "True" Then
|
||||
|
||||
If CountRegistros > 0 Then
|
||||
|
||||
FechaHoraRegistroEntrada = DateTime.Parse(tabladelDia(0)("FechaRegistro").ToString())
|
||||
FechaHoraRegistroSalida = DateTime.Parse(tabladelDia(tabladelDia.Rows.Count - 1)("FechaRegistro").ToString())
|
||||
|
||||
If Not (FechaHoraRegistroEntrada - FechaHoraEntrada).TotalMinutes > TolFalEntradaMin Then
|
||||
If (FechaHoraRegistroEntrada - FechaHoraEntrada).TotalMinutes > TolRetEntradaMin Then
|
||||
|
||||
Retardos = Retardos + 1
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Retardo"
|
||||
|
||||
If Retardos >= TolRetAcumulados Then
|
||||
ReRow("Asistio") = "False"
|
||||
ReRow("FaltaRetardosAcumulados") = "True"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & " Falta por " & TolRetAcumulados & " acumulados. "
|
||||
Retardos = 0
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaRetardo
|
||||
ReRow("PorcentajePago") = "100"
|
||||
End If
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
End If
|
||||
Else
|
||||
Asistencia = False
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Falta por retardo."
|
||||
ReRow("FaltaRetraso") = "True"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
End If
|
||||
|
||||
If FechahoraSalida > FechaHoraRegistroSalida Then
|
||||
|
||||
Dim diferenciasalidaMinutos As Integer = (FechahoraSalida - FechaHoraRegistroSalida).TotalMinutes.ToString().ToEntero
|
||||
|
||||
If RetSalidaAntes Then
|
||||
If diferenciasalidaMinutos > TolSalidaAntesMin Then
|
||||
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "True"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Retraso por salida antes de tiempo (" & diferenciasalidaMinutos & " minutos)."
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaRetardo
|
||||
ReRow("PorcentajePago") = "100"
|
||||
Else
|
||||
ReRow("Asistio") = "True"
|
||||
ReRow("Retraso") = "False"
|
||||
ReRow("Mensaje") = ReRow("Mensaje").ToString() & vbLf & "Salida antes de tiempo (" & diferenciasalidaMinutos & " minutos)."
|
||||
ReRow("CveAsistenciasInasistencias") = CveASistenciaInasistenciaAsistio
|
||||
ReRow("PorcentajePago") = "100"
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
ReRow("Asistio") = "False"
|
||||
ReRow("CveAsistenciasInasistencias") = CveAsistenciaInasistenciaFalta
|
||||
ReRow("PorcentajePago") = "0"
|
||||
End If
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If ReRow("Asistio").ToString() = "True" Then ReRow("PorcentajePago") = "100" Else ReRow("PorcentajePago") = "0"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End If
|
||||
|
||||
If ReRow("Asistio").ToString() = "True" Then ReRow("PorcentajePago") = "100" Else ReRow("PorcentajePago") = "0"
|
||||
|
||||
|
||||
'adasdasd
|
||||
|
||||
|
||||
Resultados.Rows.Add(ReRow)
|
||||
@@ -899,7 +1043,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
Dim ColumN As Integer = (dt.Columns.Count) - 2
|
||||
|
||||
For x As Integer = 3 To dt.Columns.Count-1
|
||||
For x As Integer = 3 To dt.Columns.Count - 1
|
||||
GVRegDatos.Columns(x).HeaderText = ""
|
||||
GVRegDatos.Columns(x).Visible = False
|
||||
Next
|
||||
@@ -940,36 +1084,48 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
RRow(ColumN) = "-"
|
||||
|
||||
If ResumenDia(0)("Asistio").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "A" Then
|
||||
RRow(ColumN) = "A|" & filtro
|
||||
End If
|
||||
If ResumenDia(0)("TipoCorto").ToString().Length > 0 Then
|
||||
|
||||
If ResumenDia(0)("DiaVacacion").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "V" Then
|
||||
RRow(ColumN) = "V|" & filtro
|
||||
End If
|
||||
RRow(ColumN) = $"{ResumenDia(0)("TipoCorto").ToString()}|" & filtro
|
||||
|
||||
If ResumenDia(0)("Asistio").ToString() = "False" Or ResumenDia(0)("TipoCorto").ToString() = "F" Then
|
||||
RRow(ColumN) = "F|" & filtro
|
||||
End If
|
||||
Else
|
||||
|
||||
If ResumenDia(0)("Retraso").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "R" Then
|
||||
RRow(ColumN) = "R|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("FaltaRetraso").ToString() = "True" Or TipoCorto = "FR" Then
|
||||
RRow(ColumN) = "FR|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Descanso").ToString() = "True" Or ResumenDia(0)("DiaInhabil").ToString() = "True" Then
|
||||
RRow(ColumN) = "D|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Inconsistencia").ToString() = "True" Then
|
||||
RRow(ColumN) = "IN|" & filtro
|
||||
If ResumenDia(0)("Descanso").ToString() = "True" Then
|
||||
RRow(ColumN) = "IND|" & filtro
|
||||
If ResumenDia(0)("Asistio").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "A" Then
|
||||
RRow(ColumN) = "A|" & filtro
|
||||
End If
|
||||
|
||||
|
||||
If ResumenDia(0)("DiaVacacion").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "V" Then
|
||||
RRow(ColumN) = "V|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Asistio").ToString() = "False" Or ResumenDia(0)("TipoCorto").ToString() = "F" Then
|
||||
RRow(ColumN) = "F|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Retraso").ToString() = "True" Or ResumenDia(0)("TipoCorto").ToString() = "R" Then
|
||||
RRow(ColumN) = "R|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("FaltaRetraso").ToString() = "True" Or TipoCorto = "FR" Then
|
||||
RRow(ColumN) = "FR|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Descanso").ToString() = "True" Or ResumenDia(0)("DiaInhabil").ToString() = "True" Then
|
||||
RRow(ColumN) = "D|" & filtro
|
||||
End If
|
||||
|
||||
If ResumenDia(0)("Inconsistencia").ToString() = "True" Then
|
||||
RRow(ColumN) = "IN|" & filtro
|
||||
If ResumenDia(0)("Descanso").ToString() = "True" Then
|
||||
RRow(ColumN) = "IND|" & filtro
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
Else
|
||||
|
||||
DTTempAsistencias = DTAsistenciasInasistenciasReg.FiltraParametros(filtro)
|
||||
@@ -1027,7 +1183,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
|
||||
|
||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlRango.SelectedValue.ToEntero > 0 Then
|
||||
If DdlTipoPeriodo.SelectedValue.ToEntero > 0 And DdlPeriodo.SelectedValue.ToEntero > 0 Then
|
||||
|
||||
Dim dt As New DataTable
|
||||
Dim DtPersonal As New DataTable
|
||||
@@ -1039,7 +1195,7 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
DTAsistenciasInasistencias = objRH.DtResultados
|
||||
End If
|
||||
|
||||
Dim DtTempPeriodo As DataTable = DTPeridos.FiltraParametros("CvePeriodo = " & DdlRango.SelectedValue.ToEntero)
|
||||
Dim DtTempPeriodo As DataTable = DTPeriodos.FiltraParametros("CvePeriodo = " & DdlPeriodo.SelectedValue.ToEntero)
|
||||
Dim FechaInicioPeriodoFiltro = DtTempPeriodo(0)("FechaInicio").ToString().ToDate
|
||||
|
||||
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros($" CveTipoPeriodo = { DdlTipoPeriodo.SelectedValue} AND CveEstado = 1 " & If(DdlTurno.SelectedValue = "-1", "", $" AND CveTurno = {DdlTurno.SelectedValue}")).AsEnumerable()
|
||||
@@ -1496,9 +1652,9 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
DTRespuesta = DtRespuestaView.ToTable
|
||||
|
||||
DdlRango.DataSource = DTRespuesta
|
||||
DdlRango.DataBind()
|
||||
DdlRango.Items.Insert(0, New ListItem("Seleccionar uno", "-1"))
|
||||
DdlPeriodo.DataSource = DTRespuesta
|
||||
DdlPeriodo.DataBind()
|
||||
DdlPeriodo.Items.Insert(0, New ListItem("Seleccionar uno", "-1"))
|
||||
'DdlRango.Visible = True
|
||||
'LblPeriodo.Visible = True
|
||||
UPFiltros.Update()
|
||||
@@ -1536,6 +1692,14 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
lnkLink.CommandArgument = $"{lnkLink.Text}|{e.Row.DataKey("CvePersonal")}|{e.Row.DataKey("NombreCompleto")}"
|
||||
|
||||
If Instruccion = "_ND" Then
|
||||
lnkLink.Text = "<i class='fa fa-question' aria-hidden='True'></i>"
|
||||
lnkLink.ForeColor = Drawing.Color.DarkOrange
|
||||
lnkLink.ToolTip = "Inconsistencia"
|
||||
lnkLink.Font.Bold = True
|
||||
End If
|
||||
|
||||
|
||||
If Instruccion = "-" Then
|
||||
lnkLink.Text = "<i class='fa fa-check-square' aria-hidden='true'></i>"
|
||||
lnkLink.ForeColor = Drawing.Color.Green
|
||||
@@ -1565,6 +1729,12 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
ContadorFaltas = ContadorFaltas + 1
|
||||
End If
|
||||
|
||||
If Instruccion = "DDV" Then
|
||||
lnkLink.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||
lnkLink.ToolTip = "Dia de descanso."
|
||||
lnkLink.ForeColor = Drawing.Color.Green
|
||||
End If
|
||||
|
||||
If Instruccion = "D" Or Instruccion = "V" Then
|
||||
lnkLink.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||
lnkLink.ToolTip = "Dia de descanso/no laboral/Vacación"
|
||||
@@ -1639,6 +1809,13 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
lnkLink.Font.Bold = True
|
||||
End If
|
||||
|
||||
If Instruccion = "P" Then
|
||||
lnkLink.Text = "<i class='fa fa-exclamation-triangle' aria-hidden='true'></i>"
|
||||
lnkLink.ToolTip = "Permiso."
|
||||
lnkLink.ForeColor = Drawing.Color.DarkOrange
|
||||
lnkLink.Font.Bold = True
|
||||
End If
|
||||
|
||||
If Filtro.Length > 0 Then
|
||||
AddHandler lnkLink.Click, AddressOf Me.DetalleDia_Click
|
||||
End If
|
||||
@@ -1707,6 +1884,14 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
lnkModalImg.Text = ""
|
||||
|
||||
If Instruccion = "_ND" Then
|
||||
lnkModalImg.Text = "<i class='fa fa-question' aria-hidden='True'></i>"
|
||||
lnkModalImg.ForeColor = Drawing.Color.DarkOrange
|
||||
lnkModalImg.ToolTip = "Inconsistencia"
|
||||
lnkModalImg.Font.Bold = True
|
||||
lblModalMensaje.Text = "Inconsistencia"
|
||||
End If
|
||||
|
||||
If Instruccion = "-" Or Instruccion = "A" Then
|
||||
lnkModalImg.Text = "<i class='fa fa-check-square fa-3x' aria-hidden='true'></i>"
|
||||
lnkModalImg.ForeColor = Drawing.Color.Green
|
||||
@@ -1741,6 +1926,15 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
'CveEstado = CveDescanso
|
||||
End If
|
||||
|
||||
|
||||
If Instruccion = "DDV" Then
|
||||
lnkModalImg.Text = "<i Class='fa fa-sun-o fa-3x' aria-hidden='true'></i>"
|
||||
lnkModalImg.ToolTip = "Dia de descanso."
|
||||
lnkModalImg.ForeColor = Drawing.Color.Green
|
||||
lblModalMensaje.Text = "Dia de descanso."
|
||||
'CveEstado = CveDescanso
|
||||
End If
|
||||
|
||||
If Instruccion = "DI" Or Instruccion = "V" Then
|
||||
lnkModalImg.Text = "<i Class='fa fa-sun-o' aria-hidden='true'></i>"
|
||||
lnkModalImg.ToolTip = "Dia de descanso/no laboral/Vacación"
|
||||
@@ -1828,39 +2022,39 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub BtnEstusAsistenciaModal_Click(sender As Object, e As EventArgs) Handles BtnEstusAsistenciaModal.Click
|
||||
'Private Sub BtnEstusAsistenciaModal_Click(sender As Object, e As EventArgs) Handles BtnEstusAsistenciaModal.Click
|
||||
|
||||
Dim myRow As DataRow() ' = DtResultados.NewRow
|
||||
Dim temtDt As New DataTable
|
||||
temtDt = DtResultados.FiltraParametros(FiltroAplicado)
|
||||
' Dim myRow As DataRow() ' = DtResultados.NewRow
|
||||
' Dim temtDt As New DataTable
|
||||
' temtDt = DtResultados.FiltraParametros(FiltroAplicado)
|
||||
|
||||
Dim fecha As String = temtDt(0)("Fecha").ToString()
|
||||
Dim CvePersonal As Integer = temtDt(0)("CvePersonal").ToString().ToEntero
|
||||
Dim filtro As String = String.Format(" CvePersonal = '{0}' AND Fecha = '{1}'", CvePersonal, fecha)
|
||||
' Dim fecha As String = temtDt(0)("Fecha").ToString()
|
||||
' Dim CvePersonal As Integer = temtDt(0)("CvePersonal").ToString().ToEntero
|
||||
' Dim filtro As String = String.Format(" CvePersonal = '{0}' AND Fecha = '{1}'", CvePersonal, fecha)
|
||||
|
||||
Dim AplicaFalta As String = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("AplicaFalta").ToString()
|
||||
' Dim AplicaFalta As String = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("AplicaFalta").ToString()
|
||||
|
||||
|
||||
myRow = DtResultados.Select(filtro)
|
||||
' myRow = DtResultados.Select(filtro)
|
||||
|
||||
If AplicaFalta = "Aplica" Then
|
||||
myRow(0)("Asistio") = "False"
|
||||
myRow(0)("SalarioDiario") = "0"
|
||||
Else
|
||||
myRow(0)("Asistio") = "True"
|
||||
myRow(0)("SalarioDiario") = "100"
|
||||
End If
|
||||
' If AplicaFalta = "Aplica" Then
|
||||
' myRow(0)("Asistio") = "False"
|
||||
' myRow(0)("SalarioDiario") = "0"
|
||||
' Else
|
||||
' myRow(0)("Asistio") = "True"
|
||||
' myRow(0)("SalarioDiario") = "100"
|
||||
' End If
|
||||
|
||||
myRow(0)("CveAsistenciasInasistencias") = DdlAsistenciaInacistencia.SelectedValue
|
||||
' myRow(0)("CveAsistenciasInasistencias") = DdlAsistenciaInacistencia.SelectedValue
|
||||
|
||||
myRow(0)("TipoCorto") = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("TipoCorto").ToString()
|
||||
' myRow(0)("TipoCorto") = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(String.Format(" CveAsistenciasInasistencias = {0} ", DdlAsistenciaInacistencia.SelectedValue))(0)("TipoCorto").ToString()
|
||||
|
||||
RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||
Alert("Actualizado correctamente.")
|
||||
ReprocesarTabla()
|
||||
GvBind()
|
||||
' RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||
' Alert("Actualizado correctamente.")
|
||||
' ReprocesarTabla()
|
||||
' GvBind()
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
Protected Sub BtnAgregar_Click(sender As Object, e As EventArgs) Handles BtnAgregar.Click
|
||||
|
||||
@@ -1997,12 +2191,18 @@ Partial Class RH_RepChecadorPreAsistencia
|
||||
Protected Sub BtnGuardar_Click(sender As Object, e As EventArgs)
|
||||
If DdlAsistenciaInacistencia.SelectedValue.ToEntero > 0 Then
|
||||
Dim ObjPersonal As New ClsRH
|
||||
If ObjPersonal.AddAsistencia(CvePersonalSeleccionado, -1, DdlSubProyecto.SelectedValue.ToEntero, FechaSeleccionada,
|
||||
DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "C") Then
|
||||
'If ObjPersonal.AddAsistencia(CvePersonalSeleccionado, -1, DdlSubProyecto.SelectedValue.ToEntero, FechaSeleccionada, DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, 0, 0, -1, "", UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, "C") Then
|
||||
|
||||
If ObjPersonal.AddPreAsistencia(CvePersonalSeleccionado, FechaSeleccionada, DdlAsistenciaInacistencia.SelectedValue.ToEntero, 100, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa) Then
|
||||
Alert("Registro Actualizado Correctamente.")
|
||||
RegistraScript("$('#divDetallesDia').modal('hide');")
|
||||
CargaDatos()
|
||||
|
||||
End If
|
||||
|
||||
ObjPersonal.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
End Class
|
||||
Reference in New Issue
Block a user