This commit is contained in:
JORGE LUIS CAUDILLO ESPARZA
2024-08-13 06:49:54 -07:00
parent 693cf55ac8
commit 7c38c8aeb8
3 changed files with 81 additions and 60 deletions

View File

@@ -187,7 +187,7 @@
</tr>
</thead>
</table>
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePeriodo, CveTipoPeriodo,CveSubTipoPeriodo, Ejercicio, Numero, FechaInicio,FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, Estatus, CveTurno"
<asp:GridView ID="GvDatos" runat="server" AutoGenerateColumns="False" DataKeyNames="CvePeriodo, CveTipoPeriodo,CveSubTipoPeriodo, Ejercicio, Mes,Numero, FechaInicio,FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, Estatus, CveTurno"
CssClass="table table-striped table-advance table-hover mysmallbtn ScrollAD Widthall GvDatos" data-tableheader=".tableheader" EmptyDataText="No se encontraron Periodos Registrados"
GridLines="None" data-rows="0" ShowHeader="false">
<Columns>
@@ -383,6 +383,12 @@
<div class="col-xs-4">
<asp:TextBox ID="TxtNumeroAdd" runat="server" CssClass=" form-control input-sm" CausesValidation="true" MaxLength="70" ValidationGroup="GrpGuardar" Width="100%"></asp:TextBox>
</div>
<div class="col-xs-2" style="text-align: left;">
Mes:
</div>
<div class="col-xs-4">
<asp:TextBox ID="TxtMes" runat="server" CssClass=" form-control input-sm" CausesValidation="true" MaxLength="70" ValidationGroup="GrpGuardar" Width="100%"></asp:TextBox>
</div>
</div>
<br />
<div class="row">

View File

@@ -227,8 +227,8 @@ Partial Class Nomina_CatPeriodos
RegistraScript("$('#divAddPeriodo').modal('show');")
End Sub
Protected Sub BtnAgregar_Click(sender As Object, e As System.EventArgs) Handles BtnAgregar.Click
Dim ObjNom_Periodos As New ClsNominas
Dim mensajeerror As String = ""
Dim EsInicioMes As Boolean
Dim EsFinMes As Boolean
Dim EsInicioSS As Boolean
@@ -237,72 +237,85 @@ Partial Class Nomina_CatPeriodos
Dim EsFinAño As Boolean
Dim FueCalculado As Boolean
Dim Numero As Integer = TxtNumeroAdd.Text.Trim.ToEntero()
Dim FechaInicio As Date = TxtFechaInicioAdd.Text.Trim.ToDate
Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim.ToDate
Dim Mes As Integer = FechaFin.Month
Dim FechaInicio As Date = TxtFechaInicioAdd.Text().Trim.ToDate()
Dim FechaFin As Date = TxtFechaFinAdd.Text.Trim().ToDate()
Dim Mes As Integer = TxtMes.Text.Trim().ToEntero()
If Not ((FechaFin.Month = 12 And (Mes = 1)) OrElse (FechaFin.Month = 1 And (Mes = 12)) OrElse (Math.Abs(FechaFin.Month - Mes) <= 1)) OrElse
Mes > 12 OrElse Mes < 1 Then
TxtMes.Text = FechaFin.Month.ToString()
mensajeerror = "El mes seleccionado para el periodo de nómina debe ser el mes actual, el mes anterior, o el mes siguiente a la fecha de finalización."
End If
Dim Ejercicio As Integer = FechaFin.Year
Dim CveTipoPeriodo As Integer = DdlTipoPeriodoAdd.SelectedValue.ToEntero()
Dim Estatus As Integer = DdlEstatusAdd.SelectedValue.ToEntero()
Dim CvePeriodo As Integer = hdnCvePerido.Value.ToEntero()
Dim CveSubTipoPeriodo As Integer = TxtCveSubTipoPeriodoAdd.Text.ToEntero()
If CveSubTipoPeriodo <= 1 Then
CveSubTipoPeriodo = 1
End If
For Each item As ListItem In CBLchk.Items
Select Case item.Value.ToEntero()
Case 1
If item.Selected Then EsInicioMes = True Else EsInicioMes = False
Case 2
If item.Selected Then EsFinMes = True Else EsFinMes = False
Case 3
If item.Selected Then EsInicioSS = True Else EsInicioSS = False
Case 4
If item.Selected Then EsFinSS = True Else EsFinSS = False
Case 5
If item.Selected Then EsInicioAño = True Else EsInicioAño = False
Case 6
If item.Selected Then EsFinAño = True Else EsFinAño = False
Case 7
If item.Selected Then FueCalculado = True Else FueCalculado = False
End Select
Next
If Comando = "Agregar" Then
If (mensajeerror = "") Then
If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
Using ObjNom_Periodos As New ClsNominas
If CveSubTipoPeriodo <= 1 Then
CveSubTipoPeriodo = 1
End If
For Each item As ListItem In CBLchk.Items
Select Case item.Value.ToEntero()
Case 1
If item.Selected Then EsInicioMes = True Else EsInicioMes = False
Case 2
If item.Selected Then EsFinMes = True Else EsFinMes = False
Case 3
If item.Selected Then EsInicioSS = True Else EsInicioSS = False
Case 4
If item.Selected Then EsFinSS = True Else EsFinSS = False
Case 5
If item.Selected Then EsInicioAño = True Else EsInicioAño = False
Case 6
If item.Selected Then EsFinAño = True Else EsFinAño = False
Case 7
If item.Selected Then FueCalculado = True Else FueCalculado = False
End Select
Next
If Comando = "Agregar" Then
If ObjNom_Periodos.AddPeriodo(CveTipoPeriodo, Ejercicio, Mes, Numero, FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, UsuarioActual.CveUsuario, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), DdlEstatus.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ElseIf Comando = "Actualizar" Then
If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
Alert("El nuevo Periodo se guardó correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
ElseIf Comando = "Actualizar" Then
If ObjNom_Periodos.UpdatePeriodo(FechaInicio, FechaFin, EsInicioMes, EsFinMes, EsInicioSS, EsFinSS, EsInicioAño, EsFinAño, FueCalculado, CveTipoPeriodo, Ejercicio, Mes, Numero, Estatus, CvePeriodo, UsuarioActual.CveEmpresa, DdlTurno.SelectedValue.ToEntero(), CveSubTipoPeriodo) Then
Alert("Los cambios se guardaron correctamente.", TipoMensaje.MsgInformacion)
UpDatos.Update()
ViewState("DTNom_Periodos") = ObjNom_Periodos.DtResultados.FiltraParametros("CveEmpresa = " & UsuarioActual.CveEmpresa)
GlobalDTNominasPeriodos(-1, -1, UsuarioActual.CveEmpresa) = Nothing
CargaDatos()
If String.IsNullOrEmpty(ViewState("Orden").ToString()) Then
CargaGrid(ViewState("Orden").ToString())
Else
CargaGrid("")
End If
End If
End Using
RegistraScript("$('#divAddPeriodo').modal('hide');")
Else
Alert(mensajeerror, TipoMensaje.MsgAdvertencia)
End If
RegistraScript("$('#divAddPeriodo').modal('hide');")
'ObjNom_Periodos.Dispose()
End Sub
@@ -321,6 +334,7 @@ Partial Class Nomina_CatPeriodos
TxtFechaFinAdd.Text = GvRow.DataKey("FechaFin").ToString()
DdlEstatusAdd.SelectedValueExist(GvRow.DataKey("Estatus").ToString().ToEntero())
hdnCvePerido.Value = GvRow.DataKey("CvePeriodo").ToString()
TxtMes.Text = GvRow.DataKey("Mes").ToString()
TxtCveSubTipoPeriodoAdd.Text = GvRow.DataKey("CveSubTipoPeriodo").ToString()
For Each item As ListItem In CBLchk.Items
@@ -351,6 +365,7 @@ Partial Class Nomina_CatPeriodos
TxtNumeroAdd.Text = ""
TxtFechaInicioAdd.Text = ""
TxtFechaFinAdd.Text = ""
TxtMes.Text = ""
DdlEstatusAdd.SelectedValueExist(-1)
DdlTurno.SelectedValueExist(-1)
For Each item As ListItem In CBLchk.Items

View File

@@ -2533,13 +2533,13 @@
OnRowDataBound="GVNominaPendiente_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Código">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("Codigo")%>'> </asp:Label>
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("Codigo") %>' NavigateUrl='<%# Eval("CvePersonal", "~/RH/Personal.aspx?CvePersonal={0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Empleado" ItemStyle-CssClass="text-left">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Eval("NombreCompleto")%>'> </asp:Label>
<ItemTemplate>
<asp:HyperLink runat="server" Text='<%# Eval("NombreCompleto") %>' NavigateUrl='<%# Eval("CvePersonal", "~/RH/Personal.aspx?CvePersonal={0}") %>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Periodo" ItemStyle-CssClass="text-left">