Mitarbeiter-Logik, Abrechnung AMBAR

This commit is contained in:
2024-06-20 13:30:06 +02:00
parent ffd45e15a7
commit 93fcc43346
3 changed files with 96 additions and 85 deletions

View File

@@ -101,7 +101,8 @@ Public Class frmFaktSammelRgDrucken
FirmaTmp = "VERAGIMEX"
End If
FirmaTmp = "AMBAR"
Label5.Visible = True
cboFaktGrp.Visible = True
Select Case FirmaTmp
Case "VERAG"
@@ -127,6 +128,8 @@ Public Class frmFaktSammelRgDrucken
cboFirma.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [tblFirma] WHERE FIRMENGRUPPE IN ('AMBAR') ", False, "FMZOLL")
cboFirma.changeItem("24")
cboSB.fillWithSQL("SELECT [mit_username] FROM [tblMitarbeiter] where mit_firma='AMBAR' and mit_gekuendigt=0 AND (mit_abteilung IN ('VRR','BH') OR (SELECT COUNT(*) FROM [tblBerechtigungsObjekteZuordnung] where [beroz_beroId]=90 AND [beroz_bergrId]=[mit_id] AND beroz_art='B')>0) order by mit_username", False, "ADMIN", True)
Label5.Visible = False
cboFaktGrp.Visible = False
End Select
' cboFirma.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [tblFirma] WHERE Firma_ID NOT IN(3) ORDER BY Firma_ID ", True, "FMZOLL")
cboFirma.changeItem(Firma)

View File

@@ -28,7 +28,6 @@ Partial Class frmMitarbeitersuche
Me.Button4 = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button()
Me.PictureBox2 = New System.Windows.Forms.PictureBox()
Me.sbMitarbeiter = New VERAG_PROG_ALLGEMEIN.MySearchBox()
Me.pnlMain = New System.Windows.Forms.Panel()
Me.pnl = New System.Windows.Forms.Panel()
Me.Button3 = New System.Windows.Forms.Button()
@@ -60,7 +59,7 @@ Partial Class frmMitarbeitersuche
Me.pnlMotto = New System.Windows.Forms.Panel()
Me.lblMotto = New System.Windows.Forms.Label()
Me.Label7 = New System.Windows.Forms.Label()
Me.btn = New System.Windows.Forms.Button()
Me.btnEdit = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.picGeschlecht = New System.Windows.Forms.PictureBox()
Me.Label10 = New System.Windows.Forms.Label()
@@ -83,6 +82,7 @@ Partial Class frmMitarbeitersuche
Me.lblFirma = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.sbMitarbeiter = New VERAG_PROG_ALLGEMEIN.MySearchBox()
Me.pnlSrch.SuspendLayout()
CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit()
Me.pnlMain.SuspendLayout()
@@ -155,32 +155,6 @@ Partial Class frmMitarbeitersuche
Me.PictureBox2.TabIndex = 18
Me.PictureBox2.TabStop = False
'
'sbMitarbeiter
'
Me.sbMitarbeiter._allowFreitext = False
Me.sbMitarbeiter._AllowSetValue = False
Me.sbMitarbeiter._allowSpaceAsSplitter = True
Me.sbMitarbeiter._autoSizeGross = False
Me.sbMitarbeiter._hideIfListEmpty = True
Me.sbMitarbeiter._value = Nothing
Me.sbMitarbeiter.conn_art = "FMZOLL"
Me.sbMitarbeiter.dgvpos = "LEFT"
Me.sbMitarbeiter.DISPLAY_PARAM = Nothing
Me.sbMitarbeiter.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!)
Me.sbMitarbeiter.INVISIBLE_COLUMNS = Nothing
Me.sbMitarbeiter.key_visible = False
Me.sbMitarbeiter.KEYPARAM = Nothing
Me.sbMitarbeiter.Location = New System.Drawing.Point(45, 11)
Me.sbMitarbeiter.Name = "sbMitarbeiter"
Me.sbMitarbeiter.searchActive = True
Me.sbMitarbeiter.Size = New System.Drawing.Size(582, 29)
Me.sbMitarbeiter.SQL_ORDER_BY = Nothing
Me.sbMitarbeiter.SQL_SELECT = Nothing
Me.sbMitarbeiter.SQL_WHERE = Nothing
Me.sbMitarbeiter.SQL_WhereParamList = Nothing
Me.sbMitarbeiter.TabIndex = 0
Me.sbMitarbeiter.usrcntl = Nothing
'
'pnlMain
'
Me.pnlMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
@@ -209,7 +183,7 @@ Partial Class frmMitarbeitersuche
Me.pnl.Controls.Add(Me.Panel3)
Me.pnl.Controls.Add(Me.PictureBox3)
Me.pnl.Controls.Add(Me.pnlMotto)
Me.pnl.Controls.Add(Me.btn)
Me.pnl.Controls.Add(Me.btnEdit)
Me.pnl.Controls.Add(Me.Label1)
Me.pnl.Controls.Add(Me.picGeschlecht)
Me.pnl.Controls.Add(Me.Label10)
@@ -297,6 +271,7 @@ Partial Class frmMitarbeitersuche
Me.pnlZeiten.Name = "pnlZeiten"
Me.pnlZeiten.Size = New System.Drawing.Size(624, 66)
Me.pnlZeiten.TabIndex = 22
Me.pnlZeiten.Visible = False
'
'btnAkten
'
@@ -565,20 +540,20 @@ Partial Class frmMitarbeitersuche
Me.Label7.TabIndex = 10
Me.Label7.Text = "Motto:"
'
'btn
'btnEdit
'
Me.btn.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.btn.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn.Image = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.stift
Me.btn.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.btn.Location = New System.Drawing.Point(702, 9)
Me.btn.Name = "btn"
Me.btn.Size = New System.Drawing.Size(70, 58)
Me.btn.TabIndex = 9
Me.btn.Text = "Bearbeiten"
Me.btn.TextAlign = System.Drawing.ContentAlignment.BottomCenter
Me.btn.UseVisualStyleBackColor = True
Me.btn.Visible = False
Me.btnEdit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnEdit.Image = Global.VERAG_PROG_ALLGEMEIN.My.Resources.Resources.stift
Me.btnEdit.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.btnEdit.Location = New System.Drawing.Point(702, 9)
Me.btnEdit.Name = "btnEdit"
Me.btnEdit.Size = New System.Drawing.Size(70, 58)
Me.btnEdit.TabIndex = 9
Me.btnEdit.Text = "Bearbeiten"
Me.btnEdit.TextAlign = System.Drawing.ContentAlignment.BottomCenter
Me.btnEdit.UseVisualStyleBackColor = True
Me.btnEdit.Visible = False
'
'Label1
'
@@ -815,6 +790,32 @@ Partial Class frmMitarbeitersuche
Me.Label3.Text = "Niederlassung:"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'sbMitarbeiter
'
Me.sbMitarbeiter._allowFreitext = False
Me.sbMitarbeiter._AllowSetValue = False
Me.sbMitarbeiter._allowSpaceAsSplitter = True
Me.sbMitarbeiter._autoSizeGross = False
Me.sbMitarbeiter._hideIfListEmpty = True
Me.sbMitarbeiter._value = Nothing
Me.sbMitarbeiter.conn_art = "FMZOLL"
Me.sbMitarbeiter.dgvpos = "LEFT"
Me.sbMitarbeiter.DISPLAY_PARAM = Nothing
Me.sbMitarbeiter.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.0!)
Me.sbMitarbeiter.INVISIBLE_COLUMNS = Nothing
Me.sbMitarbeiter.key_visible = False
Me.sbMitarbeiter.KEYPARAM = Nothing
Me.sbMitarbeiter.Location = New System.Drawing.Point(45, 11)
Me.sbMitarbeiter.Name = "sbMitarbeiter"
Me.sbMitarbeiter.searchActive = True
Me.sbMitarbeiter.Size = New System.Drawing.Size(582, 29)
Me.sbMitarbeiter.SQL_ORDER_BY = Nothing
Me.sbMitarbeiter.SQL_SELECT = Nothing
Me.sbMitarbeiter.SQL_WHERE = Nothing
Me.sbMitarbeiter.SQL_WhereParamList = Nothing
Me.sbMitarbeiter.TabIndex = 0
Me.sbMitarbeiter.usrcntl = Nothing
'
'frmMitarbeitersuche
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -855,7 +856,7 @@ Partial Class frmMitarbeitersuche
Friend WithEvents pnlSrch As Windows.Forms.Panel
Friend WithEvents pnlMain As Windows.Forms.Panel
Friend WithEvents btn As Windows.Forms.Button
Friend WithEvents btnEdit As Windows.Forms.Button
Friend WithEvents lblAbteilung As Windows.Forms.Label
Friend WithEvents lblNiederlassung As Windows.Forms.Label
Friend WithEvents lblFirma As Windows.Forms.Label

View File

@@ -62,11 +62,12 @@ Public Class frmMitarbeitersuche
Private Sub sbMitarbeiter_PropertyChanged() Handles sbMitarbeiter.VALUE_CHANGED
requestDone = False
initMA(False)
End Sub
Sub initMA(Optional callTimasSaldo As Boolean = True)
btn.Visible = False
btnEdit.Visible = False
pnl.Visible = False
'lblTimasZeiten.Visible = False
lblTimasSaldo.Visible = False
@@ -166,13 +167,7 @@ Public Class frmMitarbeitersuche
PictureBox3.BackgroundImage = Nothing
End Select
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", "SDL") Then
'pnlZeiten.Visible = True
btn.Visible = True
btnSettings.Visible = True
End If
requestDone = Not callTimasSaldo
'requestDone = Not callTimasSaldo
initTimasData()
If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_timasId IsNot Nothing Then
@@ -181,6 +176,11 @@ Public Class frmMitarbeitersuche
pnlZeiten.Visible = False
End If
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", "SDL") Then
btnEdit.Visible = True
btnSettings.Visible = True
End If
If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MA_TeamBearbeiten", "SDL") Then
If MA.getFirma = VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA Then 'MA derselben Firma bearbeiten
btnSettings.Visible = True
@@ -222,14 +222,14 @@ Public Class frmMitarbeitersuche
pnlMotto.Visible = False
pic.BackgroundImage = My.Resources.personGray_m
picGeschlecht.Visible = False
'pnlZeiten.Visible = False
pnlZeiten.Visible = False
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn.Click
Private Sub btn_Click(sender As Object, e As EventArgs) Handles btnEdit.Click
If sbMitarbeiter._value = "" Then Exit Sub
Dim f As New frmMitarbeitersucheBearbeiten(sbMitarbeiter._value)
f.ShowDialog(Me)
@@ -421,78 +421,85 @@ Public Class frmMitarbeitersuche
'normales kommen/gehen
Dim a As MsgBoxResult = MsgBox(IIf(cbxHomeoffice.Checked, "Homeoffice", "Büro") & vbNewLine & sender.text & " für " & VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME & vbNewLine & Now.ToString(), vbYesNo)
If a = vbYes Then
Dim info
timas.setTimeEntry(cAllgemein.MITARBEITER, Now, info, art, resultCode)
MsgBox(info)
Thread.Sleep(2000) 'warten bis Eintrag in Timas-DB
requestDone = False
initTimasData()
End If
If a = vbYes Then
Dim info
timas.setTimeEntry(cAllgemein.MITARBEITER, Now, info, art, resultCode)
MsgBox(info)
Thread.Sleep(2000) 'warten bis Eintrag in Timas-DB
requestDone = False
initTimasData()
End If
End If
End If
End Sub
Private Sub initTimasData()
lblStatusZE.Visible = False
btn.Visible = True
'lblStatusZE.Visible = False
'btnEdit.Visible = False
'Eintrag für Zeitübersicht
'lblTimasZeiten.Visible = True
lblTimasSaldo.Visible = True
lblTimasSaldo.Visible = False
lblTimasSaldo.Text = ""
If Not requestDone Then
lblTimasSaldo.Text = ""
Dim dtZeiten As New DataTable
If timas IsNot Nothing Then
Dim isServiceRunning As Boolean = True
timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text, "dailyBalanceYesterday", isServiceRunning, "time")
If Not isServiceRunning Then
'Abfrage konnte nicht durchgeführt werden.
MsgBox("Abfragefehler am Timas-Server!")
'Exit Sub
End If
lblStatusZE.Visible = True
Dim checkEntry As Boolean = timas.getTimeEntries(MA.mit_timasId, dtZeiten,, requestDone)
online = checkEntry
If requestDone Then
If checkEntry Then
'PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_green
lblStatusZE.BackColor = Color.Green
lblStatusZE.Text = "ONLINE"
btnZEGehen.Enabled = True
btnZEKommen.Enabled = False
btnAkten.Enabled = False
Else
' PictureBox9.Image = VERAG_PROG_ALLGEMEIN.My.Resources.Resources.uhr_red
lblStatusZE.Text = "OFFLINE"
lblStatusZE.BackColor = Color.Firebrick
btnZEGehen.Enabled = False
btnZEKommen.Enabled = True
btnAkten.Enabled = True
End If
Else
'Request wurde nicht verarbeitet -> Verbindungsfehler
lblStatusZE.Text = "Serverfehler"
If MA.mit_timasId Is Nothing Then
lblStatusZE.Text = "keine ZE"
Else
lblStatusZE.Text = "Serverfehler"
End If
lblStatusZE.BackColor = Color.Gray
btnZEGehen.Enabled = False
btnZEKommen.Enabled = False
Button2.Enabled = False
btnAkten.Enabled = False
End If
If VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then
timas.getTimeSaldo(MA.mit_timasId, lblTimasSaldo.Text, "dailyBalanceYesterday", isServiceRunning, "time")
If Not isServiceRunning Then
MsgBox("Abfragefehler am Timas-Server!")
End If
lblStatusZE.Visible = True
lblTimasSaldo.Visible = True
If dtZeiten.Rows.Count > 0 Then
pnlZeiten.Visible = True
Else
pnlZeiten.Visible = False
End If
If dtZeiten.Rows.Count > 0 AndAlso VERAG_PROG_ALLGEMEIN.cAllgemein.USRID = MA.mit_id Then
pnlZeiten.Visible = True
Else
pnlZeiten.Visible = False
End If
End If