Akustes Karedex, Reporte Asistencias Checador 2024.04.17
This commit is contained in:
@@ -25,6 +25,10 @@
|
||||
<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>
|
||||
<li>
|
||||
<asp:LinkButton runat="server" ID="LnkCargaMasiva" Visible="false" data-toggle="tooltip" data-placement="left" title="Carga Masiva" Text="<i class='fa fa-calendar-plus-o'></i> Carga Masiva"
|
||||
OnClick="LnkCargaMasiva_Click"></asp:LinkButton>
|
||||
</li>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</asp:Content>
|
||||
@@ -34,13 +38,14 @@
|
||||
|
||||
<asp:UpdatePanel ID="UPFiltros" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="">
|
||||
<div class="portlet solid grey-cascade portlet-filter" style="" id="idfiltros">
|
||||
<div class="portlet-title portlet-filterT" style="">
|
||||
<div class="titlefiltros caption ">
|
||||
|
||||
|
||||
<ul class="list-inline text-size-12">
|
||||
<li>Ejercicio:
|
||||
<li><asp:Label runat="server" ID="LblEjecicio" Width="85.1687px">Ejercicio:</asp:Label>
|
||||
|
||||
|
||||
<asp:DropDownList ID="DdlEjercicios" runat="server" OnSelectedIndexChanged="DdlEjercicios_SelectedIndexChanged" AutoPostBack="true"
|
||||
style="width: 120px !important;" CssClass="select2me" DataValueField="Ejercicio" DataTextField="Ejercicio"></asp:DropDownList>
|
||||
@@ -52,7 +57,7 @@
|
||||
</li>
|
||||
<li>
|
||||
Período:
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me"
|
||||
<asp:DropDownList ID="DdlPeriodo" runat="server" CssClass="select2me" AutoPostBack="true" OnSelectedIndexChanged="DdlPeriodo_SelectedIndexChanged"
|
||||
DataTextField="NominaEstatus" DataValueField="CvePeriodo" style="width: 120px !important;" >
|
||||
<asp:ListItem Selected="True" Text="Seleccione" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
@@ -77,10 +82,23 @@
|
||||
</div>
|
||||
<div class="tools">
|
||||
<asp:Button ID="BtnConsultar" runat="server" Text="Consultar" Enabled="false" class="btn btn-primary" OnClick="BtnConsultar_Click" />
|
||||
<a href="javascript:;" class="expand"></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="portlet-body" style="display: none;">
|
||||
|
||||
<ul class="list-inline text-size-12">
|
||||
<li> <asp:Label runat="server" ID="LblDepartamento">Departamento:</asp:Label>
|
||||
<asp:DropDownList ID="DdlDepartamento" runat="server" AppendDataBoundItems="True" DataTextField="Departamento" DataValueField="CveDepartamento" style="width: 120px !important;" CssClass="select2me" >
|
||||
<asp:ListItem Selected="True" Text="Todos" Value="-1"></asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
@@ -88,19 +106,129 @@
|
||||
|
||||
<asp:UpdatePanel ID="UpDatos" runat="server" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
|
||||
<div class="row" runat="server" visible ="false" id="DVEnvioMasivo">
|
||||
<div class="col-md-6">
|
||||
<br />
|
||||
<div id="DVCarga" style="margin-top: -30px!important;">
|
||||
<div class="portlet-title"" style="min-width: 650px;">
|
||||
<asp:UpdatePanel runat="server" class="portlet-content" ID="UpModal" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<div class="portlet-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="portlet-title">
|
||||
<asp:Literal ID="LtlTituloModal" runat="server">Carga Masiva</asp:Literal></h4>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright date date-picker date date-picker" style="min-width: 135px; margin-top: -10px !important;">
|
||||
<label for="<%= TxtFechaCargaMasiva.ClientID.ToString()%>" style="color: #888888;">Fecha: </label>
|
||||
<div class="input-group input-sm input-small date date-picker " data-date-format="dd/mm/yyyy" style="width: 120px !important; padding: 0px; margin-top: -5px !important;">
|
||||
<asp:TextBox ID="TxtFechaCargaMasiva" CssClass="form-control" MaxLength="20" runat="server" Width="100px" Height="28px"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="LnkFechaNacimiento" class="btn default" Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
</div>
|
||||
<ajax:MaskedEditExtender ID="METxtFechaCargaMasiva" runat="server" TargetControlID="TxtFechaCargaMasiva" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtFechaCargaMasiva" TargetControlID="TxtFechaCargaMasiva" PopupButtonID="LnkFechaNacimiento" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
<asp:CompareValidator ID="CVTxtFechaCargaMasiva" runat="server" ControlToValidate="TxtFechaCargaMasiva" Display="None" ErrorMessage="El campo <b>''Fecha''</b> no tienes el formato correcto, por favor intente de nuevo con el siguiente formato: (dd/mm/yyyy)." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardarCarga"></asp:CompareValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCECVTxtFechaCargaMasiva" runat="server" HighlightCssClass="vco" TargetControlID="CVTxtFechaCargaMasiva" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
<asp:RequiredFieldValidator ID="RfvTxtFechaCargaMasiva" runat="server" ControlToValidate="TxtFechaCargaMasiva" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> Es requierido, por favor ingreselo." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardarCarga"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="VCERfvTxtFechaCargaMasiva" runat="server" HighlightCssClass="vco" TargetControlID="RfvTxtFechaCargaMasiva" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlAsistenciaInacistenciaCarga" runat="server" DataTextField="Tipo" DataValueField="CveAsistenciasInasistencias" Class="form-control select2me" Style="width: 100% !important;"></asp:DropDownList>
|
||||
<label for="<%= DdlAsistenciaInacistenciaCarga.ClientID.ToString()%>">Incidencia:</label>
|
||||
<asp:RequiredFieldValidator ID="RfvDdlAsistenciaInacistenciaCarga" runat="server" ControlToValidate="DdlAsistenciaInacistenciaCarga" InitialValue="-1" Display="None" ErrorMessage="El campo <b>''Fecha de Nacimiento''</b> Es requierido, por favor ingreselo." Operator="DataTypeCheck" Type="Date" ValidationGroup="GrpGuardarCarga"></asp:RequiredFieldValidator>
|
||||
<ajax:ValidatorCalloutExtender ID="CVERfvDdlAsistenciaInacistenciaCarga" runat="server" HighlightCssClass="vco" TargetControlID="RfvDdlAsistenciaInacistenciaCarga" Width="350px"></ajax:ValidatorCalloutExtender>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtPorcentajePago" CssClass="form-control " runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender FilterType="Custom" ValidChars="0123456789." runat="server" TargetControlID="TxtPorcentajePago" />
|
||||
<asp:RequiredFieldValidator ID="RFVTxtPorcentajePago" runat="server" ControlToValidate="TxtPorcentajePago" CssClass="help-block errorimput"
|
||||
ErrorMessage="<b><span style='text-decoration: underline'>ERROR:</span></b><br />El campo <b>''Pordentaja de Pago''</b> es necesario, por favor ingréselo." ValidationGroup="GrpGuardarCarga"></asp:RequiredFieldValidator>
|
||||
<label for="<%= TxtPorcentajePago.ClientID.ToString()%>">Pordentaja de Pago:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtHorasDobles" CssClass="form-control " runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender FilterType="Custom" ValidChars="0123456789." runat="server" TargetControlID="TxtHorasDobles" />
|
||||
<label for="<%= TxtHorasDobles.ClientID.ToString()%>">Horas Dobles:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtHorasTriples" CssClass="form-control " runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||
<ajax:FilteredTextBoxExtender FilterType="Custom" ValidChars="0123456789." runat="server" TargetControlID="TxtPorcentajePago" />
|
||||
<label for="<%= TxtPorcentajePago.ClientID.ToString()%>">Horas Triples:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:DropDownList ID="DdlMotivoHoraExtra" runat="server" DataTextField="MotivoHoraExtra" DataValueField="CveMotivoHoraExtra" Class="form-control select2me" Style="width: 100% !important;"></asp:DropDownList>
|
||||
<label for="<%= DdlMotivoHoraExtra.ClientID.ToString()%>">Morivo Horas Extra:</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtObs" CssClass="form-control " runat="server" MaxLength="100" CausesValidation="true"></asp:TextBox>
|
||||
<label for="<%= TxtObs.ClientID.ToString()%>">Observaciones:</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-footer">
|
||||
<br />
|
||||
<div style="width:100%;text-align:right!important" >
|
||||
<asp:LinkButton ID="LnklEnviarCargaMasiva" OnClick="LnklEnviarCargaMasiva_Click" runat="server" class="btn btn-primary" Text="Agregar" ValidationGroup="GrpGuardarCarga" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<asp:GridView ID="GVRegDatos" runat="server" AutoGenerateColumns="false" EmptyDataText="No se encontraron registros" DataKeyNames="CvePersonal,NombreCompleto"
|
||||
CssClass="ADSCROLLER2 table table-striped table-advance table-hover Widthall" data-rows="1" data-cols="3" data-heightmenos="100" data-heightfijo="600" Style="text-align: center;" GridLines="None">
|
||||
<Columns>
|
||||
<asp:TemplateField HeaderText="Codigo" ItemStyle-HorizontalAlign="Left" >
|
||||
<%--<asp:TemplateField HeaderText="Codigo" ItemStyle-HorizontalAlign="Left" >
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="LtlNumero" runat="server" CssClass="truncate" Width="50" Text='<%# Eval("Codigo") %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="Personal" ItemStyle-HorizontalAlign="Left">
|
||||
</asp:TemplateField>--%>
|
||||
<%-- <asp:TemplateField HeaderText="Personal" ItemStyle-HorizontalAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblIPersonal" runat="server" CssClass="truncate" Width="250" Text='<%# Eval("NombreCompleto") %>'> </asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</asp:TemplateField>--%>
|
||||
|
||||
<asp:HyperLinkField DataTextField="Codigo" HeaderText="óodigo" DataNavigateUrlFields="CvePersonal" DataNavigateUrlFormatString="Personal.aspx?CvePersonal={0}" ItemStyle-HorizontalAlign="Left" Target="_blank" />
|
||||
<asp:HyperLinkField DataTextField="NombreCompleto" HeaderText="Personal" DataNavigateUrlFields="CvePersonal" DataNavigateUrlFormatString="Personal.aspx?CvePersonal={0}" ItemStyle-HorizontalAlign="Left" Target="_blank" />
|
||||
<asp:TemplateField HeaderText="Faltas" ItemStyle-HorizontalAlign="Right">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblFaltas" runat="server" CssClass="truncate" Width="50"> </asp:Label>
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user