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:
@@ -3035,7 +3035,14 @@
|
||||
<div class="modal-content" style="width: 700px;">
|
||||
<div class="modal-header ">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h4 class="modal-title">Agregar Vacaciones</h4>
|
||||
<h4 class="modal-title">
|
||||
<asp:UpdatePanel runat="server" ID="UpModalAddVacacionesTitulo" UpdateMode="Conditional">
|
||||
<ContentTemplate>
|
||||
<asp:Label ID="LblModalAddVacacionesTitulo" runat="server" Text="Agregar Vacaciones"></asp:Label>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
@@ -3066,12 +3073,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<asp:Panel runat="server" ID="PnlVacfechas" CssClass="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
|
||||
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px !important">
|
||||
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
|
||||
<asp:TextBox ID="TxtFechaInicioVac" runat="server" CausesValidation="true" CssClass="form-control input-sm" onblur="calculaFechasVacaciones();" ></asp:TextBox>
|
||||
<asp:TextBox ID="TxtFechaInicioVac" runat="server" CausesValidation="true" CssClass="form-control input-sm" onblur="calculaFechasVacaciones();"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgTxtFechaInicioVac" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
@@ -3083,22 +3091,22 @@
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<asp:Panel runat="server" ID="PnlVacDiasPago" CssClass="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright">
|
||||
<asp:TextBox ID="TxtVacDiasPago" CssClass="form-control input-sm form-small" type="number" runat="server" style="margin-top:20px!important" onblur="calculaFechasVacaciones();" ></asp:TextBox>
|
||||
<asp:Label runat="server" AssociatedControlID="TxtVacDiasPago" style="margin-top:10px!important">Días pago</asp:Label>
|
||||
<asp:TextBox ID="TxtVacDiasPago" CssClass="form-control input-sm form-small" type="number" runat="server" Style="margin-top: 20px!important" onblur="calculaFechasVacaciones();"></asp:TextBox>
|
||||
<asp:Label runat="server" AssociatedControlID="TxtVacDiasPago" Style="margin-top: 10px!important">Días pago</asp:Label>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright " style="width: 100px !important">
|
||||
|
||||
<div class="col-md-3" style="max-height:58px!important">
|
||||
<div class="form-group form-md-line-input input-iconright calendarlinealinput" style="width: 100px !important">
|
||||
<div class="input-group input-sm date date-picker" data-date-format="dd/mm/yyyy" style="width: 160px;">
|
||||
<asp:TextBox ID="TxtFechaFinVac" runat="server" CausesValidation="true" CssClass="form-control input-sm" ClientIDMode="Static"></asp:TextBox>
|
||||
<span class="input-group-btn " >
|
||||
<asp:LinkButton ID="ImgTxtFechaFinVac" class="btn default " Text="<i class='fa fa-calendar'></i>" style="display:none!important" runat="server"></asp:LinkButton>
|
||||
<asp:TextBox ID="TxtFechaFinVac" runat="server" CausesValidation="true" CssClass="form-control input-sm" ClientIDMode="Static" onblur="calculaFechasVacacionesFechaFin()"></asp:TextBox>
|
||||
<span class="input-group-btn ">
|
||||
<asp:LinkButton ID="ImgTxtFechaFinVac" class="btn default " Text="<i class='fa fa-calendar'></i>" runat="server"></asp:LinkButton>
|
||||
</span>
|
||||
<ajax:MaskedEditExtender ID="MEETxtFechaFinVac" runat="server" TargetControlID="TxtFechaFinVac" Mask="99/99/9999" MaskType="Date" DisplayMoney="Left" AcceptNegative="Left"></ajax:MaskedEditExtender>
|
||||
<ajax:CalendarExtender runat="server" ID="CETxtFechaFinVac" TargetControlID="TxtFechaFinVac" PopupButtonID="ImgTxtFechaFinVac" PopupPosition="BottomRight" Enabled="True"></ajax:CalendarExtender>
|
||||
@@ -3109,15 +3117,17 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group form-md-line-input input-iconright calendarlinealinput form-small">
|
||||
<asp:TextBox ID="Txtdiasinabiles" runat="server" TextMode="Number" CausesValidation="true" CssClass="form-control input-sm form-small" ClientIDMode="Static" style="margin-top:20px!important" ></asp:TextBox>
|
||||
<asp:Label runat="server" AssociatedControlID="Txtdiasinabiles" style="margin-top:10px!important" >Días feriados</asp:Label>
|
||||
<asp:TextBox ID="Txtdiasinabiles" runat="server" TextMode="Number" CausesValidation="true" CssClass="form-control input-sm form-small" ClientIDMode="Static" Style="margin-top: 20px!important"></asp:TextBox>
|
||||
<asp:Label runat="server" AssociatedControlID="Txtdiasinabiles" Style="margin-top: 10px!important">Días feriados</asp:Label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<asp:Panel runat="server" ID="PnlVacDias" CssClass="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
@@ -3142,10 +3152,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<asp:Panel runat="server" ID="PnlVacFechapago" CssClass="row">
|
||||
|
||||
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<asp:Panel runat="server" ID="PnlVacChecks" CssClass="row">
|
||||
<div class="col-md-6">
|
||||
@@ -3164,6 +3171,7 @@
|
||||
|
||||
|
||||
<asp:Button runat="server" ClientIDMode="Static" ID="LnkCalculaFechasVacaciones" OnClick="LnkCalculaFechasVacaciones_Click" style="display:none!important" ></asp:Button>
|
||||
<asp:Button runat="server" ClientIDMode="Static" ID="LnkCalculaFechasVacacionesFechaFin" OnClick="LnkCalculaFechasVacacionesFechaFin_Click" style="display:none!important" ></asp:Button>
|
||||
</ContentTemplate>
|
||||
</asp:UpdatePanel>
|
||||
</div>
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
</script>
|
||||
</asp:Content>
|
||||
|
||||
@@ -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