Aliquote Urlaubsberechnung, Asfinag, Timas
This commit is contained in:
@@ -1185,7 +1185,7 @@ Public Class frmMitarbDetails
|
||||
|
||||
|
||||
If checkMandatoryFields() Then
|
||||
timas.createEmployee(mitarbeiter, rtfInfoTimas.Text, dtTimas)
|
||||
timas.createEmployee(mitarbeiter, rtfInfoTimas.Text, txtClientNr.Text, dtTimas)
|
||||
If rtfInfoTimas.Visible = False AndAlso rtfInfoTimas.Text <> "" Then MsgBox(rtfInfoTimas.Text)
|
||||
tbcntr_TabIndexChanged(sender, e)
|
||||
End If
|
||||
@@ -1221,6 +1221,11 @@ Public Class frmMitarbDetails
|
||||
Return False
|
||||
End If
|
||||
|
||||
If txtLohnNr.Text = "" AndAlso txtClientNr.Text = "" Then
|
||||
MsgBox("LohnNr und ClientNr prüfen!")
|
||||
Return False
|
||||
End If
|
||||
|
||||
If CDate(mitarbeiter.mit_einstiegsdatum).ToShortDateString <= DateTime.Parse("01/01/2000") Then
|
||||
MsgBox("Einstiegsdatum darf nicht vor 01.01.2000 liegen!")
|
||||
Return False
|
||||
@@ -1247,23 +1252,6 @@ Public Class frmMitarbDetails
|
||||
|
||||
Sub initDGV(dt As DataTable)
|
||||
|
||||
'dgvData.DataSource = dt
|
||||
|
||||
'If dgvData.Columns.Count > 0 Then
|
||||
' With dgvData
|
||||
' .RowHeadersWidth = 10
|
||||
' .Columns("id").Visible = False
|
||||
' .Columns("groupType").Visible = False
|
||||
' .Columns("name").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
|
||||
' .Columns("info").Width = 200
|
||||
' .Columns("set").Width = 20
|
||||
' .Columns("set").HeaderText = "X"
|
||||
|
||||
' End With
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
If dtTimas.Columns.Count > 0 Then
|
||||
|
||||
If TabControl1.TabCount = 0 Then
|
||||
@@ -1341,5 +1329,71 @@ Public Class frmMitarbDetails
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub datEinstiegsdatum_ValueChanged(sender As Object, e As EventArgs) Handles datEinstiegsdatum.ValueChanged, cbUrlaubInStund.CheckedChanged, txtUrlaubsabsp.TextChanged
|
||||
|
||||
If cbxEinsteigsDat.Checked And mitarbeiter.mit_einstiegsdatum <> "" Then
|
||||
|
||||
If CDate(mitarbeiter.mit_einstiegsdatum).ToShortDateString >= DateTime.Parse("01/01/2000") Then
|
||||
|
||||
|
||||
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 IsNumeric(txtUrlaubsabsp.Text) Then uansp = txtUrlaubsabsp.Text
|
||||
|
||||
If days > 0 AndAlso uansp > 0 Then
|
||||
calcUrlaubsabspruch(cbUrlaubInStund.Checked)
|
||||
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
|
||||
|
||||
calcUrlaubsabspruch(cbUrlaubInStund.Checked)
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub calcUrlaubsabspruch(UrlaubInStunden As Boolean)
|
||||
If Not UrlaubInStunden Then
|
||||
If cboDaysPerWeek.SelectedItem <> "" Then
|
||||
If Not cbabwJahresurlaub.Checked Then
|
||||
txtUrlaubsabsp.Text = 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
|
||||
End If
|
||||
lblHoursOrDays1.Text = "H"
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user