MERGE
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
Imports System.Runtime.InteropServices.ComTypes
|
||||
|
||||
Imports System.Drawing
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Imports System.Windows.Forms
|
||||
Imports Microsoft.Office.Interop.Outlook
|
||||
Imports Therefore.API
|
||||
Imports System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip
|
||||
|
||||
Public Class frmUeberstundenauszahlen
|
||||
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim MA As cMitarbeiter = Nothing
|
||||
Dim timas As cTimasAPI = New cTimasAPI
|
||||
Dim dt As New DataTable
|
||||
Dim timeaccountdt As New DataTable
|
||||
Dim dtResult As New DataTable
|
||||
'Dim dtbereitsausgezahlteUE As New DataTable
|
||||
Dim tag As cFeiertage
|
||||
Dim auszahlugsdatum As New Date
|
||||
Dim maxUberstundenpruefung As Boolean = True
|
||||
@@ -28,9 +31,44 @@ Public Class frmUeberstundenauszahlen
|
||||
Label7.Text = MA.mit_vname & " " & MA.mit_nname
|
||||
timas.getTimeaccountList(dt)
|
||||
|
||||
'65;"01-Lfd Saldo"
|
||||
'66;02-Krank
|
||||
'67;03-Urlaub
|
||||
'69;"10-Na 22-06"
|
||||
'70;"11-Sa 00-24"
|
||||
'72;"13-So 00-24"
|
||||
'73;"14-FtN 00-24"
|
||||
'438;04-Sonstige
|
||||
'986;Stundenlohn
|
||||
'987;FT-Ersatzzeit
|
||||
'993;"Ausz. ÜS"
|
||||
'1209;Mehrarbeit
|
||||
'1210;"Script hilfskonto WSaldo"
|
||||
'1227;Schichtzulage
|
||||
'1231;Urlaubsstunden
|
||||
'1235;"Überstunden 100% gesamt"
|
||||
'1257;Zuschlag
|
||||
'1272;"unbezahlter Urlaub"
|
||||
'1366;"Mehrarbeit am 25. des Monats gesamt"
|
||||
'1393;"Urlaub (Stunden)"
|
||||
'1550;"AUSZ ÜS 100%"
|
||||
'1551;"AUSZ ÜS 50%"
|
||||
|
||||
'65
|
||||
'69
|
||||
'70
|
||||
'72
|
||||
'73
|
||||
'1209
|
||||
'1235
|
||||
'1550
|
||||
'1551
|
||||
'1553
|
||||
|
||||
|
||||
|
||||
Dim dv = New DataView(dt)
|
||||
dv.RowFilter = "info like '%zuschlag%' Or name = 'Mehrarbeit' Or name like 'Überstunden%' Or info like 'Auszahlungskonto%' Or name like '%01-Lfd Saldo%'"
|
||||
dv.RowFilter = "accountid = 65 Or accountid = 69 Or accountid = 70 Or accountid = 72 Or accountid = 73 Or accountid = 1209 Or accountid = 1235 Or accountid = 1550 Or accountid = 1551 Or accountid = 1553"
|
||||
timeaccountdt = dv.ToTable
|
||||
|
||||
getUeberstunden(False)
|
||||
@@ -66,6 +104,15 @@ Public Class frmUeberstundenauszahlen
|
||||
startdate = (dtpMonat.Value)
|
||||
enddate = (dtpBis.Value)
|
||||
auszahlugsdatum = tag.GetLastyDayYInxMonth(enddate.DayOfWeek, enddate.Month, enddate.Year, True) 'Endmonat des Enddates
|
||||
|
||||
'Dim bereitsgezahlteueberstunden = "select sum(isnull(uest_100,0)) as ue100 , sum(isnull(uest_50,0)) as ue50, sum(isnull(uest_25,0)) as ue25, sum(isnull(uest_0,0)) as ue0
|
||||
'FROM [ADMIN].[dbo].[tblUeberstunden]
|
||||
'where uest_date between '" & startdate & "' and '" & enddate & "' and uest_deleted = 0 and uest_maId = " & MA.mit_id & "
|
||||
'group by uest_maId"
|
||||
|
||||
'dtbereitsausgezahlteUE.Clear()
|
||||
'dtbereitsausgezahlteUE = SQL.loadDgvBySql(bereitsgezahlteueberstunden, "ADMIN", 100, True)
|
||||
|
||||
Else
|
||||
startdate = tag.GetFirstyDayYInxMonth(DateTime.Parse(dtpMonat.Value).DayOfWeek, DateTime.Parse(dtpMonat.Value).Month, DateTime.Parse(dtpMonat.Value).Year, True)
|
||||
enddate = tag.GetLastyDayYInxMonth(DateTime.Parse(dtpMonat.Value).DayOfWeek, DateTime.Parse(dtpMonat.Value).Month, DateTime.Parse(dtpMonat.Value).Year, True)
|
||||
@@ -82,9 +129,8 @@ Public Class frmUeberstundenauszahlen
|
||||
Panel1.Enabled = True
|
||||
End If
|
||||
|
||||
Dim dt = calcUeberstunden(timeaccountdt, dtResult)
|
||||
dt = getUeberstunden(timeaccountdt, dtResult)
|
||||
fillFields(dt)
|
||||
dgvUeberstunden.DataSource = dt
|
||||
|
||||
End If
|
||||
End Sub
|
||||
@@ -112,10 +158,10 @@ Public Class frmUeberstundenauszahlen
|
||||
dtmerged.AcceptChanges()
|
||||
End If
|
||||
|
||||
If (dtmerged.Columns.Contains("date")) Then
|
||||
dtmerged.Columns.Remove("date")
|
||||
dtmerged.AcceptChanges()
|
||||
End If
|
||||
'If (dtmerged.Columns.Contains("date")) Then
|
||||
' dtmerged.Columns.Remove("date")
|
||||
' dtmerged.AcceptChanges()
|
||||
'End If
|
||||
|
||||
|
||||
Dim groups = dtmerged.AsEnumerable().
|
||||
@@ -140,6 +186,87 @@ Public Class frmUeberstundenauszahlen
|
||||
Return dtmerged
|
||||
End Function
|
||||
|
||||
Private Sub cbx100_CheckedChanged(sender As Object, e As EventArgs) Handles cbx100.CheckedChanged, cbx50.CheckedChanged, cx25.CheckedChanged
|
||||
|
||||
txtAusz100.ReadOnly = Not cbx100.Checked
|
||||
txtAusz50.ReadOnly = Not cbx50.Checked
|
||||
txtAusz50vonSaldo.ReadOnly = Not cx25.Checked
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
|
||||
getUeberstunden(cbxabwDatum.Checked)
|
||||
End Sub
|
||||
|
||||
Private Sub picShow_Click(sender As Object, e As EventArgs) Handles picShow.Click
|
||||
|
||||
Try
|
||||
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
Dim frm As New Form
|
||||
Dim dgv As New DataGridView()
|
||||
|
||||
If dt.Rows.Count = 0 Then
|
||||
MsgBox("keine Daten vorhanden!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim dv = New DataView(dt)
|
||||
dv.RowFilter = "accountid = 1550 Or accountid = 1551 Or accountid = 1553"
|
||||
dgv.DataSource = dv.ToTable
|
||||
|
||||
|
||||
If dgv IsNot Nothing Then
|
||||
frm.Size = New Size(500, 500)
|
||||
dgv.Size = New Size(frm.Size.Width, frm.Size.Height)
|
||||
dgv.Dock = DockStyle.Fill
|
||||
dgv.Anchor = AnchorStyles.Left
|
||||
dgv.Anchor = AnchorStyles.Top
|
||||
dgv.ReadOnly = True
|
||||
frm.Controls.Add(dgv)
|
||||
frm.StartPosition = FormStartPosition.CenterScreen
|
||||
frm.ShowDialog()
|
||||
End If
|
||||
|
||||
|
||||
Catch ex As System.Exception
|
||||
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub txtAusz100_TextChanged(sender As Object, e As EventArgs) Handles txtAusz100.TextChanged, txtAusz50.TextChanged, txtAusz50vonSaldo.TextChanged
|
||||
|
||||
overwrittenSum = 0
|
||||
|
||||
If cbx100.Checked AndAlso txtAusz100.Text <> "" AndAlso IsNumeric(txtAusz100.Text) AndAlso CDbl(txtAusz100.Text) >= 0 Then
|
||||
stunden100auszbere = CDbl(txtAusz100.Text)
|
||||
overwrittenSum += stunden100auszbere
|
||||
End If
|
||||
|
||||
If cbx50.Checked AndAlso txtAusz50.Text <> "" AndAlso IsNumeric(txtAusz50.Text) AndAlso CDbl(txtAusz50.Text) >= 0 Then
|
||||
stunden50auszbere = CDbl(txtAusz50.Text)
|
||||
overwrittenSum += stunden50auszbere
|
||||
End If
|
||||
|
||||
If cx25.Checked AndAlso txtAusz50vonSaldo.Text <> "" AndAlso IsNumeric(txtAusz50vonSaldo.Text) AndAlso CDbl(txtAusz50vonSaldo.Text) >= 0 Then
|
||||
stundenlfdSaldobere = RoundOfDigits(txtAusz50vonSaldo.Text, 2)
|
||||
overwrittenSum += stundenlfdSaldobere
|
||||
End If
|
||||
|
||||
If overwrittenSum > 0 Then
|
||||
txtAuszManuell.Text = overwrittenSum
|
||||
txtAusz.Visible = False
|
||||
txtAuszManuell.Visible = True
|
||||
Else
|
||||
txtAusz.Visible = True
|
||||
txtAuszManuell.Visible = False
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub fillFields(dt As DataTable)
|
||||
|
||||
'69 10-Na 22-06
|
||||
@@ -216,35 +343,30 @@ Public Class frmUeberstundenauszahlen
|
||||
picDel.Visible = True
|
||||
Button1.Enabled = False
|
||||
txtAusz.Enabled = False
|
||||
picShow.Visible = True
|
||||
Else
|
||||
Button1.Enabled = True
|
||||
txtAusz.Enabled = True
|
||||
picShow.Visible = False
|
||||
|
||||
End If
|
||||
|
||||
stunden100auszbere = stunden100ausz * 2
|
||||
stunden50auszbere = stunden50ausz * 1.5
|
||||
'If cbxabwDatum.Checked AndAlso dtbereitsausgezahlteUE IsNot Nothing Then
|
||||
|
||||
txt100x2.Text = stunden100auszbere
|
||||
txt50x15.Text = stunden50auszbere
|
||||
' 'If dtbereitsausgezahlteUE.Rows.Count > 0 Then
|
||||
|
||||
'If CDbl(txtlfdSaldo.Text) < 0 Or auszahlugsdatum.Month = Today.Month AndAlso auszahlugsdatum.Year = Today.Year Then
|
||||
'wenn berechneter Saldo negativ, dann ist im Regelfall das aktuelle MOnat noch nicht abgeschlossen!, daher anstatt den berechneten Saldo in overallBalance laden!
|
||||
txtlfdSaldo.Text = timas.getTimeSaldo(MA.mit_timasId, "", "overallBalance")
|
||||
' ' txtberAusz100ZR.Text = CDbl(dtbereitsausgezahlteUE.Rows(0).Item("ue100").ToString)
|
||||
' ' If istTeilzeit Then
|
||||
' ' txtberAusz50ZR.Text = CDbl(dtbereitsausgezahlteUE.Rows(0).Item("ue50").ToString) + CDbl(dtbereitsausgezahlteUE.Rows(0).Item("ue0").ToString)
|
||||
' ' Else
|
||||
' ' txtberAusz25ZR.Text = CDbl(dtbereitsausgezahlteUE.Rows(0).Item("ue25").ToString) + CDbl(dtbereitsausgezahlteUE.Rows(0).Item("ue0").ToString)
|
||||
' ' End If
|
||||
|
||||
' 'End If
|
||||
|
||||
'End If
|
||||
|
||||
|
||||
stundenlfdSaldo = CDbl(txtlfdSaldo.Text)
|
||||
stundenlfdSaldobere = stundenlfdSaldo
|
||||
|
||||
stundenlfdSaldobere -= stunden100auszbere
|
||||
stundenlfdSaldobere -= stunden50auszbere
|
||||
stundenlfdSaldobere = Math.Round(stundenlfdSaldobere, 2)
|
||||
|
||||
|
||||
If stundenlfdSaldo <= 0 Then Button1.Enabled = False
|
||||
|
||||
txtSummeAuszb.Text = stundenlfdSaldo
|
||||
calxMaxauszahlbar()
|
||||
|
||||
End If
|
||||
|
||||
@@ -387,6 +509,13 @@ Public Class frmUeberstundenauszahlen
|
||||
ues.uest_systemuser = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
|
||||
ues.uest_ignoreLimit = Not maxUberstundenpruefung
|
||||
ues.uest_maxUE = CDbl(txtSummeAuszb.Text)
|
||||
ues.uest_paidout_sum = gesamt
|
||||
|
||||
If istTeilzeit Then
|
||||
ues.uest_25 = sum0
|
||||
Else
|
||||
ues.uest_0 = sum0
|
||||
End If
|
||||
|
||||
|
||||
Dim info As String = ""
|
||||
@@ -554,8 +683,12 @@ Public Class frmUeberstundenauszahlen
|
||||
|
||||
If stundenlfdSaldo <= 0 Then Button1.Enabled = False
|
||||
|
||||
txtSummeAuszb.Text = stundenlfdSaldo
|
||||
'txtSummeAuszb.Text = stundenlfdSaldobere
|
||||
If (stunden100bereitsausbezahl + stunden50bereitsausbezahlt + stunden25bereitsausbezahlt) > 0 Then
|
||||
txtSummeAuszb.Text = stundenlfdSaldo
|
||||
Else
|
||||
txtSummeAuszb.Text = stundenlfdSaldobere
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user