diff --git a/App_Code/ClsGenerales.vb b/App_Code/ClsGenerales.vb
index ef9e785c4..c4b2b01bc 100644
--- a/App_Code/ClsGenerales.vb
+++ b/App_Code/ClsGenerales.vb
@@ -76,7 +76,7 @@ Public Class ClsGenerales
If TransaccionCompartida Is Nothing Then
SqlConexion = New SqlConnection
- SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
+ SqlConexion.ConnectionString = ClsPaginas.UsuarioActualRutaDB
Try
SqlConexion.Open()
Catch ex As Exception
diff --git a/App_Code/ClsInventarios.vb b/App_Code/ClsInventarios.vb
index 387fe8e56..32239a15e 100644
--- a/App_Code/ClsInventarios.vb
+++ b/App_Code/ClsInventarios.vb
@@ -1588,7 +1588,7 @@ Public Class ClsInventarios
End Function
Public Function GetKardex(Entrada As Boolean, Salida As Boolean, CvePS As Integer, FechaI As String, FechaF As String, CveAlmacen As Integer, CveTiposAlmacen As String, CveUnidadMedida As Integer, CveUsuario As Integer, CveEmpresa As Integer,
- Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1", Optional CveMarca As Integer = -1, Optional CveProveedor As Integer = -1) As Boolean
+ Optional AgruparAlmacen As Boolean = False, Optional Serie As String = "-1", Optional CveAlmacenes As String = "-1") As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_Inv_KardexGet")
diff --git a/App_Code/ClsRH.vb b/App_Code/ClsRH.vb
index 5c4a50311..ed19dedff 100644
--- a/App_Code/ClsRH.vb
+++ b/App_Code/ClsRH.vb
@@ -2787,12 +2787,12 @@ 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
+ Public Function AddPreAsistencia(CvePersonal As Integer, Fecha As Date, CveAsistenciasInasistencias As Integer, PorcentajePago As Double, CveUsuario As Integer, CveEmpresa As Integer, Optional HorasDobles As Decimal = 0,
+ Optional HorasTriples As Decimal = 0, Optional CveMotivoHoraExtra As Integer = -1, Optional Observacion As String = "") As Boolean
Dim Retorno As Boolean = False
- Data = New DataTable
- 'SqlAdapter = New SqlDataAdapter("PA_RH_PersonalAsistenciasAddUpd", SqlConexion)
- 'SqlAdapter.SelectCommand.CommandType = CommandType.StoredProcedure
+ Data = New DataTable
+
SqlDataAdapter("PA_RH_PersonalPreAsistenciasAddUpd")
With SqlAdapter.SelectCommand.Parameters
.Add("@CvePersonal", SqlDbType.Int).Value = CvePersonal
@@ -2801,6 +2801,10 @@ Public Class ClsRH
.Add("@PorcentajePago", SqlDbType.Float).Value = PorcentajePago
.Add("@CveUsuario", SqlDbType.Int).Value = CveUsuario
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@HorasDobles", SqlDbType.Money).Value = HorasDobles
+ .Add("@HorasTriples", SqlDbType.Money).Value = HorasTriples
+ .Add("@CveMotivoHoraExtra", SqlDbType.Int).Value = CveMotivoHoraExtra
+ .Add("@Observacion", SqlDbType.VarChar).Value = Observacion
.Add("@RETURN_VALUE", SqlDbType.Int).Direction = ParameterDirection.ReturnValue
End With
@@ -6702,7 +6706,7 @@ Public Class ClsRH
End Function
- Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer) As Boolean
+ Public Function PreAsistenciaRegistrosGet(InicioPeriodo As Date, FinPeriodo As Date, CveTurno As Integer, CveEmpresa As Integer, IncluyePreAsistencia As Boolean) As Boolean
Dim Retorno As Boolean = False
DataAdapter("PA_RH_ChecadorPreasistenciaRegistrosGet")
@@ -6712,6 +6716,7 @@ Public Class ClsRH
.Add("@FinPeriodo", SqlDbType.Date).Value = FinPeriodo
.Add("@CveTurno", SqlDbType.Int).Value = CveTurno
.Add("@CveEmpresa", SqlDbType.Int).Value = CveEmpresa
+ .Add("@IncluyePreAsistencia", SqlDbType.Bit).Value = IncluyePreAsistencia
End With
Try
diff --git a/Inventarios/Kardex.aspx.vb b/Inventarios/Kardex.aspx.vb
index 6c9e0670e..b1d45e4ba 100644
--- a/Inventarios/Kardex.aspx.vb
+++ b/Inventarios/Kardex.aspx.vb
@@ -353,7 +353,7 @@ Partial Class Inventarios_Kardex
Dim ObjInventarios As New ClsInventarios
If ObjInventarios.GetKardex(Entrada, Salida, CvePS, FechaI, FechaF, CveAlmacen, CveTiposAlmacen.Substring(0, CveTiposAlmacen.Length - 1), DdlUnidadMedida.SelectedValue.ToEntero, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
- ChkAgruparAlmacen.Checked, Serie, CveAlmacenes, CveMarca:=DdlMarca.SelectedValue.ToEntero, CveProveedor:=DdlProveedores.SelectedValue.ToEntero) Then
+ ChkAgruparAlmacen.Checked, Serie, CveAlmacenes) Then
dt = ObjInventarios.DtResultados.Copy
End If
ObjInventarios.Dispose()
diff --git a/OS/OrdenesServicios.aspx b/OS/OrdenesServicios.aspx
index 807df5df5..b10c8df6b 100644
--- a/OS/OrdenesServicios.aspx
+++ b/OS/OrdenesServicios.aspx
@@ -1095,8 +1095,10 @@
Bitacora
-
+ <%--
-
-
+ --%>
+ <%--
-
+ --%>
+
+
+
diff --git a/RH/RepChecadorPreAsistencia.aspx.vb b/RH/RepChecadorPreAsistencia.aspx.vb
index 321280968..1b8f3221e 100644
--- a/RH/RepChecadorPreAsistencia.aspx.vb
+++ b/RH/RepChecadorPreAsistencia.aspx.vb
@@ -265,7 +265,16 @@ Partial Class RH_RepChecadorPreAsistencia
DdlAsistenciaInacistencia.DataSource = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa).FiltraParametros(" CveAsistenciasInasistencias <> 6")
DdlAsistenciaInacistencia.DataBind()
- DdlAsistenciaInacistencia.Items.Insert(0, New ListItem("Seleccionar una opción", "-1"))
+ DdlAsistenciaInacistencia.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
+
+ DdlAsistenciaInacistenciaCarga.DataSource = GlobalDTAsistenciasInasistencias(UsuarioActual.CveEmpresa)
+ DdlAsistenciaInacistenciaCarga.DataBind()
+ DdlAsistenciaInacistenciaCarga.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
+
+ DdlMotivoHoraExtra.DataSource = GlobalDTMotivosHorasExtras(UsuarioActual.CveEmpresa)
+ DdlMotivoHoraExtra.DataBind()
+ DdlMotivoHoraExtra.Items.Insert(0, New ListItem("Seleccione Uno", "-1"))
+
Dim objNom As New ClsNominas
If objNom.GetTiposPeriodos() Then
@@ -286,8 +295,20 @@ Partial Class RH_RepChecadorPreAsistencia
DdlSubProyecto.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTurno.Items.Insert(0, New ListItem("Todos", "-1"))
DdlTurno.SelectedValue = "-1"
+
+ CargaDepartamento()
+ End Sub
+ Private Sub CargaDepartamento()
+ DdlDepartamento.DataSource = GlobalDTDepartamentos(UsuarioActual.CveEmpresa)
+ DdlDepartamento.DataBind()
End Sub
+ Private Sub CargaDdlAsistencia()
+
+
+
+
+ End Sub
Private Sub GeneraFechasInicioFinPerdiodo()
@@ -320,53 +341,54 @@ Partial Class RH_RepChecadorPreAsistencia
cargaPeriodos()
- 'Dim objNomina As New ClsNominas
+ Dim objNomina As New ClsNominas
- 'If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
+ If objNomina.GetPeriodos(DdlTipoPeriodo.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, -1, -1, -1) Then
- ' TxtFechaModal.Text = ""
- ' lblTituloPagina.Text = ""
- ' UpTituloPagina.Update()
- ' UpModalFechaBody.Update()
+ ' TxtFechaModal.Text = ""
+ ' lblTituloPagina.Text = ""
+ ' UpTituloPagina.Update()
+ ' UpModalFechaBody.Update()
- ' 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
+ 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
- ' ' 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()
+ ' ' 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()
+ DdlPeriodo.DataBind()
- If DtTempFechaInicial.Rows.Count > 0 Then
- Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero
- DdlPeriodo.SelectedValueExist(temCvePeriodoNomi)
- End If
+ If DtTempFechaInicial.Rows.Count > 0 Then
+ Dim temCvePeriodoNomi As Integer = DtTempFechaInicial(0)("CvePeriodo").ToString().ToEntero
+ DdlPeriodo.SelectedValueExist(temCvePeriodoNomi)
+ End If
- DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
- UPFiltros.Update()
- ' BtnConsultar.Enabled = True
- Else
+ DdlPeriodo.Items.Insert(0, New ListItem("Seleccione uno", "-1"))
+ UPFiltros.Update()
+ ' BtnConsultar.Enabled = True
+ Else
- DTPeriodos = Nothing
+ DTPeriodos = Nothing
DdlPeriodo.DataSource = Nothing
'DdlRango.Visible = False
@@ -378,6 +400,8 @@ Partial Class RH_RepChecadorPreAsistencia
End If
GeneraFechasInicioFinPerdiodo()
+
+ DdlPeriodo_SelectedIndexChanged(Nothing, Nothing)
End Sub
Private Sub DdlRango_SelectedIndexChanged(sender As Object, e As EventArgs) Handles DdlPeriodo.SelectedIndexChanged
@@ -491,15 +515,27 @@ Partial Class RH_RepChecadorPreAsistencia
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()
+ ' Let Inicio = fila.Field(Of Date)("FechaInicio")
+ ' Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin")
+ ' Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now)
+ ' Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin
+ ' Select fila
+
+ Dim FilCveDepartamento As Integer = DdlDepartamento.SelectedValue.ToEntero
+
Dim FilasFiltradas = From fila In GlobalDTRHPersonal(UsuarioActual.Empresa.CveEmpresa).FiltraParametros(FiltroSubProyecto).AsEnumerable()
- Let Inicio = fila.Field(Of Date)("FechaInicio")
- Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin")
- Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now)
- Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin
- Select fila
+ Let Inicio = fila.Field(Of Date)("FechaInicio")
+ Let FechaFinOriginal = fila.Field(Of Date?)("FechaFin")
+ Let FechaFin = If(FechaFinOriginal.HasValue, FechaFinOriginal.Value, Now)
+ Where Inicio <= FechaInicioPeriodoFiltro AndAlso FechaInicioPeriodoFiltro <= FechaFin _
+ AndAlso (FilCveDepartamento = -1 OrElse fila.Field(Of Integer)("CveDepartamento") = FilCveDepartamento)
+ Select fila
DtPersonal = FilasFiltradas.CopyToDataTable()
+
+
If objRH.ChecadorHorariosGet(-1, 1, UsuarioActual.Empresa.CveEmpresa) Then
DTHorarios = objRH.DtResultados
@@ -531,7 +567,7 @@ Partial Class RH_RepChecadorPreAsistencia
End If
- If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa) Then
+ If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, False) Then
DTChecadorRegistros = objRH.DtResultados
End If
@@ -571,6 +607,13 @@ Partial Class RH_RepChecadorPreAsistencia
Dim Fecha As Date = FechaInicioPeriodo
Dim ContadorFaltas As Integer = 0
+
+ objRH = New ClsRH
+ If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.Empresa.CveEmpresa, True) Then
+ DTChecadorRegistros = objRH.DtResultados
+ End If
+ objRH.Dispose()
+
Dim registrosPersonal As DataTable = DTChecadorRegistros.FiltraParametros(" CvePersonal = " & dRow(0).ToString())
Dim CveTurno As Integer = dRow("CveTurno").ToString.ToEntero
@@ -1169,14 +1212,21 @@ Partial Class RH_RepChecadorPreAsistencia
End Sub
Private Sub GvBind()
+
+ Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero)
+
LnkEnviarAsistencia.Visible = False
+ LnkCargaMasiva.Visible = False
+
If DtDatosTabla.Rows.Count > 0 Then
- 'BtnAgregar.Visible = True
GVRegDatos.DataSource = DtDatosTabla
LnkEnviarAsistencia.Visible = True
+ If Not Enviado Then
+ LnkCargaMasiva.Visible = True
+ End If
+
Else
- 'BtnAgregar.Visible = False
GVRegDatos.DataSource = Nothing
End If
@@ -1861,7 +1911,7 @@ Partial Class RH_RepChecadorPreAsistencia
Dim objRH As New ClsRH
- If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa) Then
+ If objRH.PreAsistenciaRegistrosGet(FechaInicioPeriodo, FechaFinPeriodo, DdlTurno.SelectedValue.ToEntero, UsuarioActual.CveEmpresa, False) Then
DTChecadorRegistros = objRH.DtResultados
End If
@@ -2366,4 +2416,107 @@ Partial Class RH_RepChecadorPreAsistencia
ObjPersonal.Dispose()
End Sub
+ Protected Sub LnkCargaMasiva_Click(sender As Object, e As EventArgs)
+
+ DVEnvioMasivo.Visible = False
+ Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero)
+
+ If Enviado Then
+ Alert("El periodo ya ha sido enviado.", TipoMensaje.MsgAdvertencia)
+ Else
+ DVEnvioMasivo.Visible = True
+ End If
+
+ UpDatos.Update()
+
+ End Sub
+
+ Private Function PeriodoBloqueado(CvePeriodo As Integer) As Boolean
+ Dim respuesta As Boolean = True
+ If CvePeriodo > 0 Then
+ Using objPeriodos As New ClsNominas()
+ If objPeriodos.GetPeriodos(-1, UsuarioActual.CveEmpresa, -1, -1, CvePeriodo) Then
+
+ If objPeriodos.DtResultados.Rows.Count > 0 Then
+ respuesta = Boolean.Parse(objPeriodos.DtResultados.Rows(0)("PreAsistenciaEnviada").ToString)
+ Else
+ respuesta = False
+ End If
+
+ End If
+ End Using
+ End If
+
+ Return respuesta
+
+ End Function
+
+
+ Protected Sub DdlPeriodo_SelectedIndexChanged(sender As Object, e As EventArgs)
+
+ Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero)
+
+ If Enviado Then
+ LnkEnviarAsistencia.Visible = False
+ 'LnkCargaMasiva.Visible = False
+ Else
+ LnkEnviarAsistencia.Visible = True
+ 'LnkCargaMasiva.Visible = True
+ End If
+
+ UPFiltros.Update()
+
+ End Sub
+
+ Protected Sub LnklEnviarCargaMasiva_Click(sender As Object, e As EventArgs)
+
+
+ Dim Enviado As Boolean = PeriodoBloqueado(DdlPeriodo.SelectedValue.ToEntero)
+
+ If Enviado Then
+ Alert($"El periodo {DdlPeriodo.SelectedItem.Text} ya fue enviado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim FechaCarga As Date = TxtFechaCargaMasiva.Text.ToDate
+ Dim ProcesoOK As Boolean = True
+
+ If Not (FechaCarga >= FechaInicioPeriodo AndAlso FechaCarga <= FechaFinPeriodo) Then
+ Alert("La fecha de carga masiva debe de estar en el rango de fechas del período seleccionado.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ If DdlMotivoHoraExtra.SelectedValue.ToEntero > 0 And (TxtHorasDobles.Text.ToDecimal > 0 And TxtHorasTriples.Text.ToDecimal > 0) Then
+ Alert("Debe seleccionar un motivo de horas extra.", TipoMensaje.MsgAdvertencia)
+ Exit Sub
+ End If
+
+ Dim ObjRH As New ClsRH
+ ObjRH.IniciaTransacSQL()
+
+
+ For Each GvRow As GridViewRow In GVRegDatos.Rows
+
+ Dim CvePersonal As Integer = GvRow.DataKey("CvePersonal").ToEntero
+
+ If Not ObjRH.AddPreAsistencia(CvePersonal, FechaCarga, DdlAsistenciaInacistenciaCarga.SelectedValue.ToEntero, TxtPorcentajePago.Text.ToDecimal, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa,
+ TxtHorasDobles.Text.ToDecimal, TxtHorasTriples.Text.ToDecimal, DdlMotivoHoraExtra.SelectedValue.ToEntero, TxtObs.Text) Then
+ ProcesoOK = False
+ Exit For
+ End If
+
+ Next
+
+ If ProcesoOK Then
+ ObjRH.Commit()
+ Alert("Carga realizada correctamente.")
+ CargaDatos()
+ Else
+ ObjRH.RollBack()
+ End If
+
+
+ End Sub
+
+
End Class
\ No newline at end of file