Merge branch 'ADMIN' of https://git.it.verag.ag/edv/ADMIN into ADMIN

This commit is contained in:
2026-05-11 11:30:40 +02:00
5 changed files with 576 additions and 95 deletions

View File

@@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class usrCntlMitarbeiter
Inherits System.Windows.Forms.UserControl
'UserControl überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _
<System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
@@ -20,11 +20,12 @@ Partial Class usrCntlMitarbeiter
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> _
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.Button6 = New System.Windows.Forms.Button()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.btnUEZ_ausz = New System.Windows.Forms.Button()
Me.Button9 = New System.Windows.Forms.Button()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
@@ -44,6 +45,8 @@ Partial Class usrCntlMitarbeiter
Me.dgvFRONTOFFICE = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.TabPage7 = New System.Windows.Forms.TabPage()
Me.dgvVERIMEX = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.TabPage9 = New System.Windows.Forms.TabPage()
Me.dgvDURMAZ = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.TabPage8 = New System.Windows.Forms.TabPage()
Me.dgvTimasNew = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.Panel1 = New System.Windows.Forms.Panel()
@@ -59,8 +62,7 @@ Partial Class usrCntlMitarbeiter
Me.UserKopierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.BerechtigungenSetzenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ContextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.TabPage9 = New System.Windows.Forms.TabPage()
Me.dgvDURMAZ = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.lblAktiv = New System.Windows.Forms.Label()
Me.Panel2.SuspendLayout()
Me.TabControl1.SuspendLayout()
Me.TabPage1.SuspendLayout()
@@ -77,13 +79,13 @@ Partial Class usrCntlMitarbeiter
CType(Me.dgvFRONTOFFICE, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TabPage7.SuspendLayout()
CType(Me.dgvVERIMEX, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TabPage9.SuspendLayout()
CType(Me.dgvDURMAZ, System.ComponentModel.ISupportInitialize).BeginInit()
Me.TabPage8.SuspendLayout()
CType(Me.dgvTimasNew, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel1.SuspendLayout()
Me.Panel3.SuspendLayout()
Me.ContextMenuStrip1.SuspendLayout()
Me.TabPage9.SuspendLayout()
CType(Me.dgvDURMAZ, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button6
@@ -97,6 +99,7 @@ Partial Class usrCntlMitarbeiter
'
'Panel2
'
Me.Panel2.Controls.Add(Me.btnUEZ_ausz)
Me.Panel2.Controls.Add(Me.Button9)
Me.Panel2.Controls.Add(Me.Button6)
Me.Panel2.Controls.Add(Me.Button5)
@@ -108,9 +111,18 @@ Partial Class usrCntlMitarbeiter
Me.Panel2.Size = New System.Drawing.Size(92, 684)
Me.Panel2.TabIndex = 24
'
'btnUEZ_ausz
'
Me.btnUEZ_ausz.Location = New System.Drawing.Point(10, 276)
Me.btnUEZ_ausz.Name = "btnUEZ_ausz"
Me.btnUEZ_ausz.Size = New System.Drawing.Size(75, 49)
Me.btnUEZ_ausz.TabIndex = 22
Me.btnUEZ_ausz.Text = "Check ÜS-Auszahl."
Me.btnUEZ_ausz.UseVisualStyleBackColor = True
'
'Button9
'
Me.Button9.Location = New System.Drawing.Point(10, 262)
Me.Button9.Location = New System.Drawing.Point(9, 236)
Me.Button9.Name = "Button9"
Me.Button9.Size = New System.Drawing.Size(75, 34)
Me.Button9.TabIndex = 21
@@ -318,6 +330,27 @@ Partial Class usrCntlMitarbeiter
Me.dgvVERIMEX.Size = New System.Drawing.Size(875, 616)
Me.dgvVERIMEX.TabIndex = 27
'
'TabPage9
'
Me.TabPage9.Controls.Add(Me.dgvDURMAZ)
Me.TabPage9.Location = New System.Drawing.Point(4, 22)
Me.TabPage9.Name = "TabPage9"
Me.TabPage9.Padding = New System.Windows.Forms.Padding(3)
Me.TabPage9.Size = New System.Drawing.Size(881, 622)
Me.TabPage9.TabIndex = 8
Me.TabPage9.Text = "DURMAZ"
Me.TabPage9.UseVisualStyleBackColor = True
'
'dgvDURMAZ
'
Me.dgvDURMAZ.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvDURMAZ.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvDURMAZ.Dock = System.Windows.Forms.DockStyle.Fill
Me.dgvDURMAZ.Location = New System.Drawing.Point(3, 3)
Me.dgvDURMAZ.Name = "dgvDURMAZ"
Me.dgvDURMAZ.Size = New System.Drawing.Size(875, 616)
Me.dgvDURMAZ.TabIndex = 28
'
'TabPage8
'
Me.TabPage8.Controls.Add(Me.dgvTimasNew)
@@ -341,6 +374,7 @@ Partial Class usrCntlMitarbeiter
'
'Panel1
'
Me.Panel1.Controls.Add(Me.lblAktiv)
Me.Panel1.Controls.Add(Me.cbxDakosy)
Me.Panel1.Controls.Add(Me.cbxZE)
Me.Panel1.Controls.Add(Me.cbx)
@@ -359,7 +393,7 @@ Partial Class usrCntlMitarbeiter
Me.cbxDakosy.AutoSize = True
Me.cbxDakosy.Checked = True
Me.cbxDakosy.CheckState = System.Windows.Forms.CheckState.Indeterminate
Me.cbxDakosy.Location = New System.Drawing.Point(798, 13)
Me.cbxDakosy.Location = New System.Drawing.Point(666, 11)
Me.cbxDakosy.Name = "cbxDakosy"
Me.cbxDakosy.Size = New System.Drawing.Size(62, 17)
Me.cbxDakosy.TabIndex = 52
@@ -372,18 +406,18 @@ Partial Class usrCntlMitarbeiter
Me.cbxZE.AutoSize = True
Me.cbxZE.Checked = True
Me.cbxZE.CheckState = System.Windows.Forms.CheckState.Indeterminate
Me.cbxZE.Location = New System.Drawing.Point(659, 13)
Me.cbxZE.Location = New System.Drawing.Point(559, 13)
Me.cbxZE.Name = "cbxZE"
Me.cbxZE.Size = New System.Drawing.Size(133, 17)
Me.cbxZE.Size = New System.Drawing.Size(101, 17)
Me.cbxZE.TabIndex = 51
Me.cbxZE.Text = "Zeiterfassung-Account"
Me.cbxZE.Text = "TiMAS-Account"
Me.cbxZE.ThreeState = True
Me.cbxZE.UseVisualStyleBackColor = True
'
'cbx
'
Me.cbx.AutoSize = True
Me.cbx.Location = New System.Drawing.Point(567, 13)
Me.cbx.Location = New System.Drawing.Point(480, 13)
Me.cbx.Name = "cbx"
Me.cbx.Size = New System.Drawing.Size(73, 17)
Me.cbx.TabIndex = 25
@@ -395,12 +429,12 @@ Partial Class usrCntlMitarbeiter
'
Me.txtSuche.Location = New System.Drawing.Point(99, 9)
Me.txtSuche.Name = "txtSuche"
Me.txtSuche.Size = New System.Drawing.Size(300, 20)
Me.txtSuche.Size = New System.Drawing.Size(197, 20)
Me.txtSuche.TabIndex = 47
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(405, 6)
Me.Button1.Location = New System.Drawing.Point(318, 7)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.TabIndex = 48
@@ -409,7 +443,7 @@ Partial Class usrCntlMitarbeiter
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(486, 6)
Me.Button2.Location = New System.Drawing.Point(399, 7)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(75, 23)
Me.Button2.TabIndex = 49
@@ -457,26 +491,13 @@ Partial Class usrCntlMitarbeiter
Me.ContextMenuStrip2.Name = "ContextMenuStrip2"
Me.ContextMenuStrip2.Size = New System.Drawing.Size(61, 4)
'
'TabPage9
'lblAktiv
'
Me.TabPage9.Controls.Add(Me.dgvDURMAZ)
Me.TabPage9.Location = New System.Drawing.Point(4, 22)
Me.TabPage9.Name = "TabPage9"
Me.TabPage9.Padding = New System.Windows.Forms.Padding(3)
Me.TabPage9.Size = New System.Drawing.Size(881, 622)
Me.TabPage9.TabIndex = 8
Me.TabPage9.Text = "DURMAZ"
Me.TabPage9.UseVisualStyleBackColor = True
'
'dgvDURMAZ
'
Me.dgvDURMAZ.AKTUALISIERUNGS_INTERVALL = -1
Me.dgvDURMAZ.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvDURMAZ.Dock = System.Windows.Forms.DockStyle.Fill
Me.dgvDURMAZ.Location = New System.Drawing.Point(3, 3)
Me.dgvDURMAZ.Name = "dgvDURMAZ"
Me.dgvDURMAZ.Size = New System.Drawing.Size(875, 616)
Me.dgvDURMAZ.TabIndex = 28
Me.lblAktiv.AutoSize = True
Me.lblAktiv.Location = New System.Drawing.Point(775, 13)
Me.lblAktiv.Name = "lblAktiv"
Me.lblAktiv.Size = New System.Drawing.Size(0, 13)
Me.lblAktiv.TabIndex = 53
'
'usrCntlMitarbeiter
'
@@ -504,14 +525,14 @@ Partial Class usrCntlMitarbeiter
CType(Me.dgvFRONTOFFICE, System.ComponentModel.ISupportInitialize).EndInit()
Me.TabPage7.ResumeLayout(False)
CType(Me.dgvVERIMEX, System.ComponentModel.ISupportInitialize).EndInit()
Me.TabPage9.ResumeLayout(False)
CType(Me.dgvDURMAZ, System.ComponentModel.ISupportInitialize).EndInit()
Me.TabPage8.ResumeLayout(False)
CType(Me.dgvTimasNew, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel1.ResumeLayout(False)
Me.Panel1.PerformLayout()
Me.Panel3.ResumeLayout(False)
Me.ContextMenuStrip1.ResumeLayout(False)
Me.TabPage9.ResumeLayout(False)
CType(Me.dgvDURMAZ, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
@@ -553,4 +574,6 @@ Partial Class usrCntlMitarbeiter
Friend WithEvents cbxDakosy As CheckBox
Friend WithEvents TabPage9 As TabPage
Friend WithEvents dgvDURMAZ As VERAG_PROG_ALLGEMEIN.MyDatagridview
Friend WithEvents btnUEZ_ausz As Button
Friend WithEvents lblAktiv As Label
End Class

View File

@@ -1,6 +1,7 @@
Imports System.ComponentModel
Imports System.Net
Imports System.Text
Imports Mysqlx.XDevAPI.CRUD
Imports VERAG_PROG_ALLGEMEIN
@@ -35,6 +36,10 @@ Public Class usrCntlMitarbeiter
End Sub
Public Sub Tabelle_anzeigen()
btnUEZ_ausz.Visible = False
lblAktiv.Text = ""
If TabControl1.SelectedIndex = 0 Then
showVERAGATILLA("VERAG")
ElseIf TabControl1.SelectedIndex = 1 Then
@@ -52,6 +57,7 @@ Public Class usrCntlMitarbeiter
ElseIf TabControl1.SelectedIndex = 7 Then
showVERAGATILLA("DURMAZ")
ElseIf TabControl1.SelectedIndex = 8 Then
btnUEZ_ausz.Visible = True
If dgvTimasNew IsNot Nothing Then
showTIMAS(False)
End If
@@ -233,7 +239,12 @@ Public Class usrCntlMitarbeiter
Else
Dim timas As New cTimasAPI("timas")
timas.getEmployeeList(dt)
dgvTimasNew.DataSource = dt
Dim dt_onlyActive As New DataTable
dt_onlyActive = dt.Select("[Ausweis-Nr] <> 0 and Vorname <> '' and Nachname <> ''").CopyToDataTable
dgvTimasNew.DataSource = dt_onlyActive
lblAktiv.Text = "AKTIV: " & dt_onlyActive.Rows.Count & "/" & dt.Rows.Count
' MsgBox("ALLE:" & dt.Rows.Count & vbNewLine & "AKIVE:" & dt_onlyActive.Rows.Count)
End If
With dgvTimasNew
@@ -863,7 +874,7 @@ Public Class usrCntlMitarbeiter
Return failureDesc
End If
API_STRING &= "/u"
API_String &= "/u"
rest.AddHeader("Authorization", "Bearer " & API.Rows(0).Item("api_token"))
rest.AddHeader("Content-Type", "multipart/form-data")
@@ -886,7 +897,7 @@ Public Class usrCntlMitarbeiter
rest.AddHeader("Content-Type", "image/jpeg")
success = rest.SetMultipartBodyStream(fileStream)
Dim responseBody As String = rest.FullRequestMultipart("POST", API_STRING)
Dim responseBody As String = rest.FullRequestMultipart("POST", API_String)
If (rest.LastMethodSuccess <> True) Then
Debug.WriteLine(rest.LastErrorText)
Return rest.LastErrorText
@@ -926,7 +937,7 @@ Public Class usrCntlMitarbeiter
dgvTimasNew.Refresh()
End If
Me.Cursor = Cursors.Default
End Sub
@@ -935,5 +946,101 @@ Public Class usrCntlMitarbeiter
Tabelle_anzeigen()
End Sub
Private Sub Button7_Click(sender As Object, e As EventArgs) Handles btnUEZ_ausz.Click
If dgvTimasNew.Rows.Count = 0 Then Exit Sub
Try
Dim dt_Accounts As New DataTable
dt_Accounts.Columns.Add("accountid", GetType(Integer))
Dim ROW_ACC As DataRow = dt_Accounts.NewRow
ROW_ACC("accountid") = "993" 'Auszahlungen ÜS!
dt_Accounts.Rows.Add(ROW_ACC)
'Dim ROW_ACC1 As DataRow = dt_Accounts.NewRow
'ROW_ACC1("accountid") = "1598" 'Auszahlungen ÜS!
'dt_Accounts.Rows.Add(ROW_ACC1)
'Dim ROW_ACC2 As DataRow = dt_Accounts.NewRow
'ROW_ACC2("accountid") = "1235" 'Auszahlungen ÜS!
'dt_Accounts.Rows.Add(ROW_ACC2)
Dim dt_Employee As New DataTable
dt_Employee.Columns.Add("employeeId", GetType(Integer))
dt_Employee.Columns.Add("Vorname", GetType(String))
dt_Employee.Columns.Add("Nachname", GetType(String))
Dim dt_result As New DataTable
Dim dateStart As New Date("2025", "01", "01")
Dim dateEnd = Today()
For Each r As DataGridViewRow In dgvTimasNew.Rows
Dim ROW As DataRow = dt_Employee.NewRow
ROW("employeeId") = r.Cells("Id").Value
ROW("Vorname") = r.Cells("Vorname").Value
ROW("Nachname") = r.Cells("Nachname").Value
dt_Employee.Rows.Add(ROW)
Next
Dim timas As New cTimasAPI("timas")
timas.getTimeAccounts(dateStart, dateEnd, 0, dt_Accounts, dt_result, dt_Employee)
If dt_result.Rows.Count > 0 Then
Dim dt_falschAusbezahlt As New DataTable
dt_falschAusbezahlt = dt_result.Select("multiplier = '-'", "date").CopyToDataTable
If dt_falschAusbezahlt.Rows.Count = 0 Then
MsgBox("keine falsch ausbezahlten Überstunden vorhanden!" & vbNewLine & "Es wird nur geprüft, ob die ausbezahlten Überstunden NICHT negativ sind!")
Exit Sub
Else
' VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_falschAusbezahlt,,,,,,,, True)
Dim query = From fa In dt_falschAusbezahlt.AsEnumerable()
Join emp In dt_Employee.AsEnumerable() On fa.Field(Of Integer)("employeeId") Equals emp.Field(Of Integer)("employeeId")
Select result = fa.ItemArray.Concat({emp.Field(Of String)("Vorname"), emp.Field(Of String)("Nachname")}).ToArray()
' Neue Tabelle erstellen (Struktur erweitern)
Dim dt_merged As New DataTable
' Alte Spalten übernehmen
For Each col As DataColumn In dt_falschAusbezahlt.Columns
dt_merged.Columns.Add(col.ColumnName, col.DataType)
Next
' Neue Spalten hinzufügen
dt_merged.Columns.Add("Vorname", GetType(String))
dt_merged.Columns.Add("Nachname", GetType(String))
' Daten einfügen
For Each row In query
dt_merged.Rows.Add(row)
Next
If dt_merged.Rows.Count > 0 Then
VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_merged,,, "falsch ausbezahlte Überstunden (ÜS sind negativ -> Erhöhen den Saldo)",,,,, True)
End If
End If
End If
Catch ex As Exception
End Try
End Sub
End Class

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.2.5.6")>
<Assembly: AssemblyFileVersion("1.2.5.6")>
<Assembly: AssemblyVersion("1.2.5.7")>
<Assembly: AssemblyFileVersion("1.2.5.7")>

View File

@@ -25,6 +25,7 @@ Partial Class frmStartOptions
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmStartOptions))
Me.pnl = New System.Windows.Forms.Panel()
Me.Button32 = New System.Windows.Forms.Button()
Me.btnEZOLL_1month = New System.Windows.Forms.Button()
Me.btnEZOLL_7days = New System.Windows.Forms.Button()
Me.cbxEZOLLUNISPED = New System.Windows.Forms.CheckBox()
@@ -154,6 +155,10 @@ Partial Class frmStartOptions
Me.PictureBox15 = New System.Windows.Forms.PictureBox()
Me.PictureBox14 = New System.Windows.Forms.PictureBox()
Me.TabPage3 = New System.Windows.Forms.TabPage()
Me.Button31 = New System.Windows.Forms.Button()
Me.Label56 = New System.Windows.Forms.Label()
Me.Button29 = New System.Windows.Forms.Button()
Me.Label55 = New System.Windows.Forms.Label()
Me.btnTesttc = New System.Windows.Forms.Button()
Me.cboTCAPI_Call = New System.Windows.Forms.Button()
Me.Label50cboTCAPI_ = New System.Windows.Forms.Label()
@@ -349,9 +354,6 @@ Partial Class frmStartOptions
Me.lklAufschubkontenATLASEZOLL = New System.Windows.Forms.LinkLabel()
Me.lblRoutineManager = New System.Windows.Forms.Label()
Me.Button21 = New System.Windows.Forms.Button()
Me.Label55 = New System.Windows.Forms.Label()
Me.Button29 = New System.Windows.Forms.Button()
Me.Label56 = New System.Windows.Forms.Label()
Me.MyTextBox3 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtSyskaWdhDateiname = New VERAG_PROG_ALLGEMEIN.MyTextBox()
@@ -393,7 +395,6 @@ Partial Class frmStartOptions
Me.MyTextBox1 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtGJ_UNISPED = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
Me.Button31 = New System.Windows.Forms.Button()
Me.pnl.SuspendLayout()
CType(Me.pbEmailscheck, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox24, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -451,6 +452,7 @@ Partial Class frmStartOptions
'
Me.pnl.BackColor = System.Drawing.Color.White
Me.pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.pnl.Controls.Add(Me.Button32)
Me.pnl.Controls.Add(Me.btnEZOLL_1month)
Me.pnl.Controls.Add(Me.btnEZOLL_7days)
Me.pnl.Controls.Add(Me.cbxEZOLLUNISPED)
@@ -538,6 +540,18 @@ Partial Class frmStartOptions
Me.pnl.Size = New System.Drawing.Size(1229, 946)
Me.pnl.TabIndex = 0
'
'Button32
'
Me.Button32.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button32.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button32.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button32.Location = New System.Drawing.Point(996, 269)
Me.Button32.Name = "Button32"
Me.Button32.Size = New System.Drawing.Size(103, 40)
Me.Button32.TabIndex = 148
Me.Button32.Text = "ZuGFerD-Check"
Me.Button32.UseVisualStyleBackColor = True
'
'btnEZOLL_1month
'
Me.btnEZOLL_1month.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -2054,7 +2068,6 @@ Partial Class frmStartOptions
'
Me.TabPage3.Controls.Add(Me.Button31)
Me.TabPage3.Controls.Add(Me.Label56)
Me.TabPage3.Controls.Add(Me.MyTextBox5)
Me.TabPage3.Controls.Add(Me.Button29)
Me.TabPage3.Controls.Add(Me.Label55)
Me.TabPage3.Controls.Add(Me.btnTesttc)
@@ -2083,6 +2096,7 @@ Partial Class frmStartOptions
Me.TabPage3.Controls.Add(Me.LinkLabel30)
Me.TabPage3.Controls.Add(Me.Label11)
Me.TabPage3.Controls.Add(Me.Panel1)
Me.TabPage3.Controls.Add(Me.MyTextBox5)
Me.TabPage3.Controls.Add(Me.cboTCAPI_Firma)
Me.TabPage3.Controls.Add(Me.MyTextBox06)
Me.TabPage3.Controls.Add(Me.txtCheckATEZMRN)
@@ -2095,6 +2109,50 @@ Partial Class frmStartOptions
Me.TabPage3.Text = "Partner-Systeme"
Me.TabPage3.UseVisualStyleBackColor = True
'
'Button31
'
Me.Button31.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button31.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button31.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button31.Location = New System.Drawing.Point(14, 358)
Me.Button31.Name = "Button31"
Me.Button31.Size = New System.Drawing.Size(123, 24)
Me.Button31.TabIndex = 161
Me.Button31.Text = "Status Updaten"
Me.Button31.UseVisualStyleBackColor = True
'
'Label56
'
Me.Label56.AutoSize = True
Me.Label56.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
Me.Label56.Location = New System.Drawing.Point(144, 334)
Me.Label56.Name = "Label56"
Me.Label56.Size = New System.Drawing.Size(22, 13)
Me.Label56.TabIndex = 160
Me.Label56.Text = "ab:"
'
'Button29
'
Me.Button29.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button29.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button29.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button29.Location = New System.Drawing.Point(14, 328)
Me.Button29.Name = "Button29"
Me.Button29.Size = New System.Drawing.Size(123, 24)
Me.Button29.TabIndex = 158
Me.Button29.Text = "NCTS Einlesen"
Me.Button29.UseVisualStyleBackColor = True
'
'Label55
'
Me.Label55.AutoSize = True
Me.Label55.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label55.Location = New System.Drawing.Point(13, 309)
Me.Label55.Name = "Label55"
Me.Label55.Size = New System.Drawing.Size(96, 13)
Me.Label55.TabIndex = 157
Me.Label55.Text = "MODALTRANS:"
'
'btnTesttc
'
Me.btnTesttc.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -4366,38 +4424,6 @@ Partial Class frmStartOptions
Me.Button21.Text = "AAS Sendung 24h"
Me.Button21.UseVisualStyleBackColor = True
'
'Label55
'
Me.Label55.AutoSize = True
Me.Label55.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label55.Location = New System.Drawing.Point(13, 309)
Me.Label55.Name = "Label55"
Me.Label55.Size = New System.Drawing.Size(96, 13)
Me.Label55.TabIndex = 157
Me.Label55.Text = "MODALTRANS:"
'
'Button29
'
Me.Button29.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button29.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button29.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button29.Location = New System.Drawing.Point(14, 328)
Me.Button29.Name = "Button29"
Me.Button29.Size = New System.Drawing.Size(123, 24)
Me.Button29.TabIndex = 158
Me.Button29.Text = "NCTS Einlesen"
Me.Button29.UseVisualStyleBackColor = True
'
'Label56
'
Me.Label56.AutoSize = True
Me.Label56.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
Me.Label56.Location = New System.Drawing.Point(144, 334)
Me.Label56.Name = "Label56"
Me.Label56.Size = New System.Drawing.Size(22, 13)
Me.Label56.TabIndex = 160
Me.Label56.Text = "ab:"
'
'MyTextBox3
'
Me.MyTextBox3._DateTimeOnly = False
@@ -5251,18 +5277,6 @@ Partial Class frmStartOptions
Me.DataGridViewTextBoxColumn1.MinimumWidth = 8
Me.DataGridViewTextBoxColumn1.Name = "DataGridViewTextBoxColumn1"
'
'Button31
'
Me.Button31.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button31.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button31.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button31.Location = New System.Drawing.Point(14, 358)
Me.Button31.Name = "Button31"
Me.Button31.Size = New System.Drawing.Size(123, 24)
Me.Button31.TabIndex = 161
Me.Button31.Text = "Status Updaten"
Me.Button31.UseVisualStyleBackColor = True
'
'frmStartOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -5716,4 +5730,5 @@ Partial Class frmStartOptions
Friend WithEvents Label56 As Label
Friend WithEvents MyTextBox5 As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents Button31 As Button
Friend WithEvents Button32 As Button
End Class

View File

@@ -6,6 +6,7 @@ Imports System.Security.Cryptography.X509Certificates
Imports System.Text
Imports System.Threading
Imports System.Xml
Imports iTextSharp.text
Imports javax
Imports MDM_Worker
Imports Renci.SshNet
@@ -412,7 +413,7 @@ Public Class frmStartOptions
'---------------------UTA----------------------
importFileFromUTAMailAnhang(pfad, betreff)
ElseIf von.Contains("ids.de@q8.com") Or von.Contains("@ibd.Q8.com") Or von.Contains("isselh@q8.com") Or von.Contains("d.breimaier@verag.ag") Or von.Contains("s.kriegner@verag.ag") Or von.Contains("q8truck.nl@q8.com") Or von.Contains("df@verag.ag") Then
ElseIf von.Contains("@q8.com") Or von.Contains("d.breimaier@verag.ag") Or von.Contains("s.kriegner@verag.ag") Or von.Contains("q8truck.nl@q8.com") Or von.Contains("df@verag.ag") Or von.Contains("df@verag.ag") Then
'---------------------IDS----------------------
importFileFromIDSMailAnhang(pfad, betreff, PARAM)
@@ -930,6 +931,13 @@ Public Class frmStartOptions
UploadCompaniesToCreditsafe(sync)
closeMe()
Case "ZUGFERD_CHECK_DAILY"
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim sendNotificationEmails As Boolean = True
checkZugferd(sendNotificationEmails)
closeMe()
Case Else
'Nur bei manuellem Start wird der fehler ausgegeben
VERAG_PROG_ALLGEMEIN.cAllgemein.ERR_OP_GLOBAL = VERAG_PROG_ALLGEMEIN.ERROR_OP.SHOW
@@ -3514,7 +3522,7 @@ Public Class frmStartOptions
' Datei hochladen
Using fileStream As New FileStream(localFilePath, FileMode.Open)
sftpClient.UploadFile(fileStream, remoteDirectory & Path.GetFileName(localFilePath))
sftpClient.UploadFile(fileStream, remoteDirectory & System.IO.Path.GetFileName(localFilePath))
End Using
Console.WriteLine("Datei erfolgreich hochgeladen!")
@@ -8134,4 +8142,332 @@ repeatRequest:
End Sub
End Class
Private Function checkZugferd(sendNotificationEmails As Boolean) As Boolean
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
'aktuell verwendet Verag360 kein Zugferd und Sammelrechnung 6 geht aktuell noch nicht - 29.04.2026 Start der neuen Funktion!
Dim dt As DataTable = SQL.loadDgvBySql("SELECT RK_ID, dsId, Firma_ID, RechnungsNr FROM [Rechnungsausgang] where [zugferdcheck_daid] is null and [zugferdcheck_datetime] is null and dsId is not null and cast(RechnungsDatum as Date) between '29.04.2026' and CONVERT(DATE, GETDATE()) and Sammelrechnung <> 6 and Firma_ID <> 19 ", "FMZOLL", 100, False)
Dim sumTotal_IMEX As Integer = 0
Dim sumTotal_VERAG As Integer = 0
Dim sumTotal_CS As Integer = 0
Dim sumTotal_US As Integer = 0
Dim sumTotal_AMBAR As Integer = 0
Dim sumTotal_ATILLA As Integer = 0
Dim sumTotal_360 As Integer = 0
Dim sumvalid_IMEX As Integer = 0
Dim sumvalid_VERAG As Integer = 0
Dim sumvalid_CS As Integer = 0
Dim sumvalid_US As Integer = 0
Dim sumvalid_AMBAR As Integer = 0
Dim sumvalid_ATILLA As Integer = 0
Dim sumvalid_360 As Integer = 0
Dim sumInvalid_IMEX As Integer = 0
Dim sumInvalid_VERAG As Integer = 0
Dim sumInvalid_CS As Integer = 0
Dim sumInvalid_US As Integer = 0
Dim sumInvalid_AMBAR As Integer = 0
Dim sumInvalid_ATILLA As Integer = 0
Dim sumInvalid_360 As Integer = 0
Dim sumInvalid_Total As Integer = 0
Dim sumvalid_Total As Integer = 0
Dim sumTotal_Total As Integer = 0
Dim dtVerag As DataTable = dt.Clone()
Dim dtIMEX As DataTable = dt.Clone()
Dim dtAMBAR As DataTable = dt.Clone()
Dim dtUNISPED As DataTable = dt.Clone()
Dim dtCS As DataTable = dt.Clone()
Dim dtATILLA As DataTable = dt.Clone()
Dim dt360 As DataTable = dt.Clone()
Dim Paramslist As New cParameterList(VERAG_PROG_ALLGEMEIN.cAllgemein.PROGID)
Dim fileName = Paramslist.GET_PARAMETER_VALUE("ZUGFeRD_Check_Pfad_JAVA")
Dim arguments = Paramslist.GET_PARAMETER_VALUE("ZUGFeRD_Check_Pfad_CMD")
For Each row In dt.Rows
Dim rkObj As Object = row("RK_ID")
Dim dsObj As Object = row("dsId")
If rkObj IsNot DBNull.Value AndAlso dsObj IsNot DBNull.Value Then
Dim rkId As Integer
Dim dsId As Integer
If Integer.TryParse(rkObj.ToString(), rkId) AndAlso
Integer.TryParse(dsObj.ToString(), dsId) AndAlso
dsId > 0 Then
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER(dsId)
Dim Path As String = DS.GET_TOP1_PATH()
If Path <> "" And System.IO.File.Exists(Path) Then
Try
Dim psi As New ProcessStartInfo()
psi.FileName = fileName
psi.Arguments = arguments & Path
'Workstation Daniel
'psi.FileName = "C:\Program Files\Eclipse Adoptium\jre-11.0.28.6-hotspot\bin\java.exe"
'psi.Arguments = "-jar ""C:\Users\d.breimaier\Downloads\Mustang-CLI-2.21.0.jar"" --no-notices --action validate --source " & Path & ""
psi.RedirectStandardOutput = True
psi.RedirectStandardError = True
psi.UseShellExecute = False
psi.CreateNoWindow = True
Using p As Process = Process.Start(psi)
Dim output = p.StandardOutput.ReadToEnd()
Dim err = p.StandardError.ReadToEnd()
p.WaitForExit()
If output <> "" Then
Dim tmpPath_Report = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("MUSTANG-REPORT_" & rkObj, ".pdf", , False)
Dim PruefungOK = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.CreateValidationPdf(output, Path, rkId, tmpPath_Report)
If tmpPath_Report <> "" Then
'Process.Start(tmpPath_Report)
Dim fileInfo_ZP As New FileInfo(tmpPath_Report)
Dim ZUGF_DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "ZUGFERD", Now().Year, "", "", fileInfo_ZP.Name, -1, False)
ZUGF_DS.uploadDataToDATENSERVER(tmpPath_Report, fileInfo_ZP.Name, fileInfo_ZP.Extension,,,, True)
SQL.doSQL("Update [Rechnungsausgang] SET zugferdcheck_datetime=getDate(),zugferdcheck = " & IIf(PruefungOK, "1", "0") & ", zugferdcheck_daid = " & ZUGF_DS.da_id & " where RK_ID = " & rkId, "FMZOLL")
Select Case row("Firma_ID")
Case 11
sumTotal_CS += 1
If PruefungOK Then
sumvalid_CS += 1
Else
sumInvalid_CS += 1
dtCS.ImportRow(row)
End If
Case 24
sumTotal_AMBAR += 1
If PruefungOK Then
sumvalid_AMBAR += 1
Else
sumInvalid_AMBAR += 1
dtAMBAR.ImportRow(row)
End If
Case 21, 22, 23
sumTotal_US += 1
If PruefungOK Then
sumvalid_US += 1
Else
sumInvalid_US += 1
dtUNISPED.ImportRow(row)
End If
Case 20
sumTotal_IMEX += 1
If PruefungOK Then
sumvalid_IMEX += 1
Else
sumInvalid_IMEX += 1
dtIMEX.ImportRow(row)
End If
Case 19
sumTotal_360 += 1
If PruefungOK Then
sumvalid_360 += 1
Else
sumInvalid_360 += 1
dt360.ImportRow(row)
End If
Case 7
sumTotal_ATILLA += 1
If PruefungOK Then
sumvalid_ATILLA += 1
Else
sumInvalid_ATILLA += 1
dtATILLA.ImportRow(row)
End If
Case Else
sumTotal_VERAG += 1
If PruefungOK Then
sumvalid_VERAG += 1
Else
sumInvalid_VERAG += 1
dtVerag.ImportRow(row)
End If
End Select
End If
End If
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Return False
End Try
End If
End If
End If
Next
If dt.Rows.Count > 0 Then
If Not sendNotificationEmails Then
'VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt,,,,, True,,, True)
Else
Dim Betreff = "ZUGFeRD-CHECK"
'hier ungültigen Prüfungen pro Firma
If dtVerag.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtVerag,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " VERAG", createMailTextZugferd(sumTotal_VERAG, sumvalid_VERAG, sumInvalid_VERAG, "VERAG"),, True, False,,, anhenge)
End If
End If
If dtIMEX.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtIMEX,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " IMEX", createMailTextZugferd(sumTotal_IMEX, sumvalid_IMEX, sumInvalid_IMEX, "IMEX"),, True, False,,, anhenge)
End If
End If
If dtAMBAR.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtAMBAR,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " AMBAR", createMailTextZugferd(sumTotal_AMBAR, sumvalid_AMBAR, sumInvalid_AMBAR, "AMBAR"),, True, False,,, anhenge)
End If
End If
If dtUNISPED.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtUNISPED,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " UNISPED", createMailTextZugferd(sumTotal_US, sumvalid_US, sumInvalid_US, "UNISPED"),, True, False,,, anhenge)
End If
End If
If dtATILLA.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtATILLA,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " ATILLA", createMailTextZugferd(sumTotal_ATILLA, sumvalid_ATILLA, sumInvalid_ATILLA, "ATILLA"),, True, False,,, anhenge)
End If
End If
If dt360.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt360,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " VERAG 360", createMailTextZugferd(sumTotal_360, sumvalid_360, sumInvalid_360, "VERAG 360"),, True, False,,, anhenge)
End If
End If
If dtCS.Rows.Count > 0 Then
Dim empfaneger = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfaneger <> "" Then
Dim path = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dtCS,,,,, False,,, True)
Dim anhenge As New List(Of String)
anhenge.Add(path)
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfaneger, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & "VERAG CS", createMailTextZugferd(sumTotal_CS, sumvalid_CS, sumInvalid_CS, "VERAG CS"),, True, False,,, anhenge)
End If
End If
'hier alle Prüfungen
Dim empfanegerALL = cMitarbeiter.GetEMailRecipientForEmailNotification("ZUGFERD-Check")
If empfanegerALL <> "" Then
sumTotal_Total = sumTotal_VERAG + sumTotal_ATILLA + sumTotal_AMBAR + sumTotal_360 + sumTotal_CS + sumTotal_IMEX + sumTotal_US
sumInvalid_Total = sumInvalid_VERAG + sumInvalid_ATILLA + sumInvalid_AMBAR + sumInvalid_360 + sumInvalid_CS + sumInvalid_IMEX + sumInvalid_US
sumvalid_Total = sumvalid_VERAG + sumvalid_ATILLA + sumvalid_AMBAR + sumvalid_360 + sumvalid_CS + sumvalid_IMEX + sumvalid_US
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(empfanegerALL, IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "TEST-", "") & Betreff & " ALL", createMailTextZugferd(sumTotal_Total, sumvalid_Total, sumInvalid_Total, "ALL"),, True, False)
End If
End If
End If
Return True
End Function
Private Function createMailTextZugferd(total As Integer, valid As Integer, invalid As Integer, Firma As String) As String
Dim MailText = "Auflistung der gültigen/ungültigen ZUGFeRD-Prüfungen vom " & Now.ToShortDateString & " für " & Firma & " <br><br>"
MailText &= "<table border=1>"
MailText &= "<tr><td>Gültig</td><td>Ungültig</td><td>Gesamt</td></tr>"
MailText &= "<tr>"
MailText &= "<td><b>" & valid & "</b></td>"
MailText &= "<td><b>" & invalid & "</b></td>"
MailText &= "<td><b>" & total & "</b></td>"
MailText &= "</tr>"
MailText &= "</table>"
MailText &= "<br><br>Erstellt am: " & Now.ToShortDateString & " um " & Now.ToShortTimeString
MailText &= "<br><br>Automatisch generiertes E-Mail."
Return MailText
End Function
Private Sub Button32_Click_1(sender As Object, e As EventArgs) Handles Button32.Click
Dim sendNotificationEmails = False
Select Case MsgBox("Soll eine Info-Mail an die zuständigen Mitarbeiter geschickt werden?", vbYesNoCancel)
Case MsgBoxResult.Cancel : Exit Sub
Case MsgBoxResult.Yes : sendNotificationEmails = True
Case Else
End Select
checkZugferd(sendNotificationEmails)
End Sub
End Class