Ueberstunden auszahlen ATILLA Bugfix

This commit is contained in:
2024-03-26 17:45:17 +01:00
parent 04441b28b3
commit ba3cd9da89
2 changed files with 143 additions and 13 deletions

View File

@@ -1,8 +1,10 @@

Imports System.Globalization
Imports System.Text
Imports System.Threading
Imports System.Windows.Forms
Imports DocumentFormat.OpenXml.EMMA
Public Class frmUeberstundenauszahlen
@@ -268,10 +270,14 @@ Public Class frmUeberstundenauszahlen
If overwrittenSum > 0 Then
txtAuszManuell.Text = overwrittenSum
txtAusz.Visible = False
txtAusz_hhmm.Visible = False
txtAuszManuell.Visible = True
txtAuszManuell_hhmm.Visible = True
Else
txtAusz.Visible = True
txtAusz_hhmm.Visible = True
txtAuszManuell.Visible = False
txtAuszManuell_hhmm.Visible = False
End If
@@ -395,6 +401,62 @@ Public Class frmUeberstundenauszahlen
End Sub
Private Sub txtAuszManuell_TextChanged(sender As Object, e As EventArgs) Handles txtAuszManuell.TextChanged
'If txtAuszManuell.Text <> "" AndAlso IsNumeric(txtAuszManuell.Text) Then
' txtAuszManuell_hhmm.Text = fixTime(txtAuszManuell.Text)
'End If
End Sub
Private Sub txtAuszManuell_hhmm_TextChanged(sender As Object, e As EventArgs) Handles txtAuszManuell_hhmm.TextChanged
If txtAuszManuell_hhmm.Text <> "" AndAlso txtAuszManuell_hhmm.Text.Contains(":") AndAlso Not txtAuszManuell_hhmm.Text.EndsWith(":") Then
Try
Dim timeToDouble = txtAuszManuell_hhmm.Text
Dim ts As TimeSpan = New TimeSpan(Integer.Parse(timeToDouble.Split(":"c)(0)), Integer.Parse(timeToDouble.Split(":"c)(1)), 0)
txtAuszManuell.Text = Math.Round(ts.TotalHours, 2)
'txtAusz.Text = ts.Hours & "," & ts.Minutes
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End If
End Sub
Private Sub txtAusz_hhmm_TextChanged(sender As Object, e As EventArgs) Handles txtAusz_hhmm.TextChanged
If txtAusz_hhmm.Text <> "" AndAlso txtAusz_hhmm.Text.Contains(":") AndAlso Not txtAusz_hhmm.Text.EndsWith(":") Then
Try
Dim timeToDouble = txtAusz_hhmm.Text
Dim ts As TimeSpan = New TimeSpan(Integer.Parse(timeToDouble.Split(":"c)(0)), Integer.Parse(timeToDouble.Split(":"c)(1)), 0)
txtAusz.Text = Math.Round(ts.TotalHours, 2)
'txtAusz.Text = ts.Hours & "," & ts.Minutes
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End If
End Sub
Private Sub txtAusz_hhmm_KeyPress(sender As Object, e As KeyPressEventArgs)
Select Case Asc(e.KeyChar)
Case 48 To 57, 8, 44, 46, 58
Case Else
e.Handled = True
End Select
End Sub
Private Sub txtAusz_hhmm_Validated(sender As Object, e As EventArgs)
End Sub
Private Sub txtAusz_TextChanged(sender As Object, e As EventArgs) Handles txtAusz.TextChanged
calcUeberstunden()
@@ -523,7 +585,8 @@ Public Class frmUeberstundenauszahlen
If gesamt > 0 Then
Dim row = dtsetEntries.NewRow
row.Item("accountid") = 1598
row.Item("value") = gesamt.ToString.Replace(",", ".") * (-1)
Dim value = gesamt * (-1)
row.Item("value") = value.ToString.Replace(",", ".")
dtsetEntries.Rows.InsertAt(row, dtsetEntries.Rows.Count)
row = dtsetEntries.NewRow
@@ -628,16 +691,15 @@ Public Class frmUeberstundenauszahlen
ues.uest_systemuser = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
ues.SAVE()
End If
MsgBox("Erfolgreich aus Timas zurückgesetzt!")
picDel.Visible = False
Thread.Sleep(1000) 'warten bis Eintrag in Timas-DB
getUeberstunden(cbxabwDatum.Checked)
End If
picDel.Visible = False
Thread.Sleep(1000) 'warten bis Eintrag in Timas-DB
getUeberstunden(cbxabwDatum.Checked)
End If
End If
End Sub
Public Function RoundOfDigits(ByVal Value As Decimal, ByVal Digits As Integer) As Decimal
@@ -818,4 +880,25 @@ Public Class frmUeberstundenauszahlen
Next
End Sub
Private Function fixTime(val As String) As String
Try
If val <> "" AndAlso IsNumeric(val) Then
Dim hours = Convert.ToInt32(val)
Dim minutes = (val Mod hours) * 60
Return hours & ":" & minutes
Else
Return ""
End If
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Function
End Class