diff --git a/App_Code/Timbrado.vb b/App_Code/Timbrado.vb index 7162b74a7..fd0e8afac 100644 --- a/App_Code/Timbrado.vb +++ b/App_Code/Timbrado.vb @@ -3261,6 +3261,8 @@ Public Class Timbrado If cfdi.Xml <> "" Then cfdi.EscribirXml(RutaArchivo & NombreArchivoXML & ".xml") End If + Else + Retorno = "XML No generado " End If #End Region diff --git a/RH/Personal.aspx b/RH/Personal.aspx index bb779887d..7a8037475 100644 --- a/RH/Personal.aspx +++ b/RH/Personal.aspx @@ -3035,7 +3035,14 @@ +
- + @@ -3083,22 +3091,22 @@
- +
- - Días pago + + Días pago
- -
-
+ +
+
- - - + + + @@ -3109,15 +3117,17 @@
-
+
- - Días feriados + + Días feriados
+ +
@@ -3142,10 +3152,7 @@
- - - - +
@@ -3164,6 +3171,7 @@ +
@@ -5796,15 +5804,15 @@ }); - $("#TxtFechaFinVac").prop("readonly", true); - $("#TxtFechaFinVac").on("paste", function (event) { - event.preventDefault(); - }); - $("#TxtFechaFinVac").on("contextmenu", function (event) { - if (event.which === 3) { - event.preventDefault(); - } - }); + //$("#TxtFechaFinVac").prop("readonly", true); + //$("#TxtFechaFinVac").on("paste", function (event) { + // event.preventDefault(); + //}); + //$("#TxtFechaFinVac").on("contextmenu", function (event) { + // if (event.which === 3) { + // event.preventDefault(); + // } + //}); }); } @@ -7326,5 +7334,9 @@ $('#LnkCalculaFechasVacaciones').click(); } + function calculaFechasVacacionesFechaFin() { + $('#LnkCalculaFechasVacacionesFechaFin').click(); + } + diff --git a/RH/Personal.aspx.vb b/RH/Personal.aspx.vb index ab70b76b3..5bf96f3ea 100644 --- a/RH/Personal.aspx.vb +++ b/RH/Personal.aspx.vb @@ -5458,7 +5458,7 @@ Partial Class RH_Personal Protected Sub DdlFormapagovacaciones_SelectedIndexChanged(sender As Object, e As EventArgs) PnlVacfechas.Visible = False PnlVacDias.Visible = False - PnlVacFechapago.Visible = False + 'PnlVacFechapago.Visible = False PnlVacDiasPago.Visible = False PnlVacChecks.Visible = False TxtVacDiasPago.Text = "0" @@ -5467,7 +5467,7 @@ Partial Class RH_Personal Case 1 PnlVacfechas.Visible = True PnlVacDias.Visible = True - PnlVacFechapago.Visible = True + 'PnlVacFechapago.Visible = True PnlVacDiasPago.Visible = True PnlVacChecks.Visible = True Case 2 @@ -5478,15 +5478,15 @@ Partial Class RH_Personal PnlVacfechas.Visible = True PnlVacDias.Visible = True PnlVacDiasPago.Visible = False - PnlVacFechapago.Visible = True + 'PnlVacFechapago.Visible = True Case 4 - PnlVacFechapago.Visible = True + ' PnlVacFechapago.Visible = True PnlVacDiasPago.Visible = True PnlVacChecks.Visible = True Case 5 PnlVacfechas.Visible = True Case 6 - PnlVacFechapago.Visible = True + 'PnlVacFechapago.Visible = True PnlVacDiasPago.Visible = True End Select End Sub @@ -7825,7 +7825,11 @@ Partial Class RH_Personal Dim diaDescanso As Integer = GlobalDTTurno(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DiaDescanso", $" CveTurno = {DdlTurno.SelectedValue.ToEntero}").ToEntero diaDescanso = If(diaDescanso <= 0, 1, diaDescanso) - ContarDiasDeLaSemana(TxtFechaInicioVac.Text.ToDate, TxtVacDiasPago.Text.ToEntero) + LblModalAddVacacionesTitulo.Text = $"Agregar Vacaciones - días disponibles {diaDescanso}" + + UpModalAddVacacionesTitulo.Update() + + CalculaDiasVacaciones(TxtFechaInicioVac.Text.ToDate, TxtVacDiasPago.Text.ToEntero) If Not diaDescanso > 0 Then Alert("El turno no tiene día de descanso, provisionalmente se tomara el domingo.", TipoMensaje.MsgAdvertencia) @@ -7835,18 +7839,51 @@ Partial Class RH_Personal End Sub - Private Sub ContarDiasDeLaSemana(fechaInicio As Date, diasVacaciones As Integer) + Private Sub CalculaDiasVacaciones(fechaInicioParametro As Date, diasVacaciones As Integer, Optional fechaFinParametro As Date = Nothing) + Dim diaDescanso As Integer = GlobalDTTurno(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DiaDescanso", $" CveTurno = {DdlTurno.SelectedValue.ToEntero}").ToEntero + diaDescanso = If(diaDescanso <= 0, 1, diaDescanso) + + + If fechaFinParametro <> Nothing Then + + Dim DiferenciaEntreFechas As Integer = (fechaFinParametro - fechaInicioParametro).Days + 1 + Dim DiasNolavorales As Integer = 0 + Dim FechaTemp As Date = fechaInicioParametro + + For x = 1 To DiferenciaEntreFechas + Dim day_of_week = CType(FechaTemp.DayOfWeek, Integer) + 1 + + If day_of_week = diaDescanso Then + DiasNolavorales = DiasNolavorales + 1 + End If + + FechaTemp = FechaTemp.AddDays(1) + + If 1 = DiferenciaEntreFechas Then + If day_of_week = diaDescanso Then + DiasNolavorales = DiasNolavorales + 1 + End If + End If + Next x + + + If diasVacaciones >= (DiferenciaEntreFechas - DiasNolavorales) Then + diasVacaciones = DiferenciaEntreFechas - DiasNolavorales + TxtVacDiasPago.Text = diasVacaciones.ToString + End If + + + + End If If TxtVacDiasPago.Text.ToEntero > VacDiasDisponibles Then TxtVacDiasPago.Text = VacDiasDisponibles.ToString End If - Dim diaDescanso As Integer = GlobalDTTurno(UsuarioActual.CveEmpresa).FiltroPrimeroValor("DiaDescanso", $" CveTurno = {DdlTurno.SelectedValue.ToEntero}").ToEntero - diaDescanso = If(diaDescanso <= 0, 1, diaDescanso) Dim DiasAgregados As Integer = 0 - Dim FechaFin As Date = fechaInicio + Dim FechaFin As Date = fechaInicioParametro Dim Contador As Integer = 0 For x = 2 To diasVacaciones Dim day_of_week = CType(FechaFin.DayOfWeek, Integer) + 1 @@ -7874,8 +7911,34 @@ Partial Class RH_Personal Protected Sub LnkCalculaFechasVacaciones_Click(sender As Object, e As EventArgs) - ContarDiasDeLaSemana(TxtFechaInicioVac.Text.ToDate, TxtVacDiasPago.Text.ToEntero) + CalculaDiasVacaciones(TxtFechaInicioVac.Text.ToDate, TxtVacDiasPago.Text.ToEntero) End Sub + + Protected Sub LnkCalculaFechasVacacionesFechaFin_Click(sender As Object, e As EventArgs) + + If Not validaFehcasVaciones() Then + Exit Sub + End If + + CalculaDiasVacaciones(TxtFechaInicioVac.Text.ToDate, TxtVacDiasPago.Text.ToEntero, TxtFechaFinVac.Text.ToDate) + + End Sub + + Private Function validaFehcasVaciones() As Boolean + + If Not IsDate(TxtFechaFinVac.Text) Then + Alert("Fecha fin invalida", TipoMensaje.MsgAdvertencia) + Return False + End If + + If Not IsDate(TxtFechaInicioVac.Text) Then + Alert("Fecha de inicio invalida", TipoMensaje.MsgAdvertencia) + Return False + End If + + Return True + End Function + End Class diff --git a/Sistemas/RolesDetalle.aspx b/Sistemas/RolesDetalle.aspx index 97f60dcdf..933b3aefa 100644 --- a/Sistemas/RolesDetalle.aspx +++ b/Sistemas/RolesDetalle.aspx @@ -69,6 +69,67 @@ + + + + +
+
+
+
+
+ + Módulos +
+
+
+
+
+
+ +
+
+
+
+ " style="display: inline-block; margin-right: -20px; width: 150px;" /> + " class="btn btn-circle btn-sm label-info"> +
+
+
+
+ + + + + + + + + + + + P + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+ + @@ -130,65 +191,7 @@ - - - - -
-
-
-
-
- - Módulos -
-
-
-
-
-
- -
-
-
-
- " style="display: inline-block; margin-right: -20px; width: 150px;" /> - " class="btn btn-circle btn-sm label-info"> -
-
-
-
- - - - - - - - - - - - P - - - - - - - - - -
-
-
-
-
-
-
-
-
-
+