RH Personal ajuste solicitud vaciones, timbrado else al no generar xml pac 4, roles detalle lista de usuarios cambio orden de epstañas
This commit is contained in:
@@ -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 <b>{diaDescanso}</b>"
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user