Mitarbeiter - Urlaubsaliquotierung auch bei Kündigung

This commit is contained in:
2024-01-19 13:40:42 +01:00
parent 71d471563d
commit 5b897e5ab1
2 changed files with 355 additions and 345 deletions

View File

@@ -313,7 +313,7 @@ Public Class frmMitarbDetails
cboTeam.changeItem(If(mitarbeiter.mit_teamId, ""))
cbxHO.Checked = mitarbeiter.mit_homeoffice
cbxTimasNichtStempeln.Checked = mitarbeiter.mit_timasNichtStempeln
cbxTimasNichtStempeln1.Checked = mitarbeiter.mit_timasNichtStempeln
@@ -589,7 +589,7 @@ Public Class frmMitarbDetails
mitarbeiter.mit_PersonalNr = txtLohnNr.Text
mitarbeiter.mit_telefonnr = txtTelNr.Text
mitarbeiter.mit_homeoffice = cbxHO.Checked
mitarbeiter.mit_timasNichtStempeln = cbxTimasNichtStempeln.Checked
mitarbeiter.mit_timasNichtStempeln = cbxTimasNichtStempeln1.Checked
If IsNumeric(cboPersonal._value) AndAlso cboPersonal._value > 0 Then
@@ -1334,7 +1334,7 @@ Public Class frmMitarbDetails
Private Sub datEinstiegsdatum_ValueChanged(sender As Object, e As EventArgs) Handles datEinstiegsdatum.ValueChanged, cbUrlaubInStund.CheckedChanged, txtUrlaubsabsp.TextChanged
Private Sub datEinstiegsdatum_ValueChanged(sender As Object, e As EventArgs) Handles datEinstiegsdatum.ValueChanged, cbUrlaubInStund.CheckedChanged, txtUrlaubsabsp.TextChanged, cboDaysPerWeek.SelectedIndexChanged
If cbxEinsteigsDat.Checked And mitarbeiter.mit_einstiegsdatum <> "" Then
@@ -1343,59 +1343,67 @@ Public Class frmMitarbDetails
If txtWoStd.Text <> "" AndAlso IsNumeric(txtWoStd.Text) AndAlso cboDaysPerWeek.Text <> "" AndAlso IsNumeric(cboDaysPerWeek.Text) Then
Dim einstiegsdat As Date = CDate(mitarbeiter.mit_einstiegsdatum)
Dim endOfCurrentYear = New DateTime(einstiegsdat.Year, 12, 31)
Dim span = endOfCurrentYear - einstiegsdat
Dim days As Double = span.TotalDays
Dim uansp As Double = 0
Dim aliquU As Double = 0
If cbxGekuendigt.Checked AndAlso mitarbeiter.mit_kuendigungsdatum <> "" AndAlso CDate(mitarbeiter.mit_kuendigungsdatum).ToShortDateString >= DateTime.Parse("01/01/2000") Then
Dim kuendigungsdatum As Date = CDate(mitarbeiter.mit_kuendigungsdatum)
span = kuendigungsdatum - einstiegsdat
End If
Dim days As Double = span.TotalDays
Dim uansp As Double = 0
Dim aliquU As Double = 0
calcUrlaubsabspruch(cbUrlaubInStund.Checked, uansp)
If days > 0 AndAlso uansp > 0 Then
If IsNumeric(txtUrlaubsabsp.Text) Then uansp = txtUrlaubsabsp.Text
If Not cbUrlaubInStund.Checked Then
aliquU = Math.Round((uansp / 365) * span.TotalDays, 2, MidpointRounding.AwayFromZero)
txtaliquUA.Text = aliquU
lblHoursOrDays2.Text = "D"
Else
aliquU = Math.Round((uansp / 365) * span.TotalDays, 2, MidpointRounding.AwayFromZero)
txtaliquUA.Text = aliquU
lblHoursOrDays2.Text = "H"
End If
calcUrlaubsabspruch(cbUrlaubInStund.Checked)
If days > 0 AndAlso uansp > 0 Then
If IsNumeric(txtUrlaubsabsp.Text) Then uansp = txtUrlaubsabsp.Text
If Not cbUrlaubInStund.Checked Then
aliquU = Math.Round((uansp / 365) * span.TotalDays, 2, MidpointRounding.AwayFromZero)
txtaliquUA.Text = aliquU
lblHoursOrDays2.Text = "D"
Else
aliquU = Math.Round((uansp / 365) * span.TotalDays, 2, MidpointRounding.AwayFromZero)
txtaliquUA.Text = aliquU
lblHoursOrDays2.Text = "H"
End If
End If
End If
End If
End If
End Sub
Private Sub cboDaysPerWeek_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboDaysPerWeek.SelectedIndexChanged
'Private Sub cboDaysPerWeek_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboDaysPerWeek.SelectedIndexChanged
calcUrlaubsabspruch(cbUrlaubInStund.Checked)
' calcUrlaubsabspruch(cbUrlaubInStund.Checked)
End Sub
'End Sub
Private Sub calcUrlaubsabspruch(UrlaubInStunden As Boolean)
Private Sub calcUrlaubsabspruch(UrlaubInStunden As Boolean, ByRef urlaubsabspruch As Double)
If Not UrlaubInStunden Then
If cboDaysPerWeek.SelectedItem <> "" Then
If Not cbabwJahresurlaub.Checked Then
txtUrlaubsabsp.Text = 5 * cboDaysPerWeek.SelectedItem
urlaubsabspruch = 5 * cboDaysPerWeek.SelectedItem
End If
lblHoursOrDays1.Text = "D"
End If
Else
If cboDaysPerWeek.SelectedItem <> "" AndAlso IsNumeric(txtWoStd.Text) AndAlso txtWoStd.Text > 0 Then
If Not cbabwJahresurlaub.Checked Then
txtUrlaubsabsp.Text = (txtWoStd.Text / cboDaysPerWeek.SelectedItem) * cboDaysPerWeek.SelectedItem * 5
urlaubsabspruch = (txtWoStd.Text / cboDaysPerWeek.SelectedItem) * cboDaysPerWeek.SelectedItem * 5
End If
lblHoursOrDays1.Text = "H"
End If
End If
txtUrlaubsabsp.Text = urlaubsabspruch
End Sub