APIZugange, Mitarbeiter, StartOptions, UTA.

This commit is contained in:
2024-08-27 10:11:30 +02:00
parent 2535a268a7
commit 6f3dbaa305
16 changed files with 6976 additions and 97 deletions

View File

@@ -878,7 +878,7 @@ Public Class cUTA
Return cnt
End Function
Public Function readAndSaveUTA(objFileRead As StreamReader, fi As FileInfo) As Boolean
Public Function readAndSaveUTA(objFileRead As StreamReader, fi As FileInfo, cnt As Integer) As Boolean
Dim booHeaderVorhanden = False
@@ -1219,7 +1219,7 @@ Public Class cUTA
End Select
Loop
cnt = CInt(lngRecordCount)
objFileRead.Close()
Return True

View File

@@ -233,7 +233,6 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
Dim downloadedFile As Stream = IO.File.Create(filePath)
client.DownloadFile(Path + remoteFileName, downloadedFile)
If IO.File.Exists(filePath) AndAlso deleteAfterDownload Then client.DeleteFile(Path + remoteFileName) 'Datei nach erfolgreichem Herunterladen vom Server löschen
@@ -364,11 +363,10 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
frmStartOptions.moveFile_DateBack(d, zielpfad & "Invoice_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
If fi.Name.ToLower.Contains("pdf") Then addDGVEinarbeitung("PDF", fi.Name)
If fi.Name.ToLower.Contains("pdf") Then addDGVEinarbeitung("PDF", fi.Name)
dgvEinarbeitung.Refresh()
dgvEinarbeitung.Refresh()
End If
End If
End Select
@@ -383,9 +381,9 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
'------------------ .UTA ------------------
'------------------------------------------
If Not deleteTable Then
deleteTable = uta.clearimporttable()
End If
'If Not deleteTable Then
' deleteTable = uta.clearimporttable()
'End If
If fi.Extension.ToLower = ".uta" Then
@@ -530,22 +528,24 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
Try
Dim fi As FileInfo = New FileInfo(d)
Dim cnt = 0
Dim objFileRead As StreamReader = New StreamReader(d)
If uta.readAndSaveUTA(objFileRead, fi) Then
If uta.readAndSaveUTA(objFileRead, fi, cnt) Then
addDGVEinarbeitung(fi.Name, "OK")
Else
addDGVEinarbeitung(fi.Name, "Fehler")
End If
readUTA = "Zeilen: " & cnt
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
MsgBox(ex.StackTrace & ex.Message)
End Try
End Function

View File

@@ -169,6 +169,8 @@ Partial Class frmStartOptions
Me.LinkLabel30 = New System.Windows.Forms.LinkLabel()
Me.Label11 = New System.Windows.Forms.Label()
Me.TabPage4 = New System.Windows.Forms.TabPage()
Me.LinkLabel62 = New System.Windows.Forms.LinkLabel()
Me.LinkLabel60 = New System.Windows.Forms.LinkLabel()
Me.LinkLabel61 = New System.Windows.Forms.LinkLabel()
Me.Label40 = New System.Windows.Forms.Label()
Me.txtTransactionID = New VERAG_PROG_ALLGEMEIN.MyTextBox()
@@ -243,6 +245,7 @@ Partial Class frmStartOptions
Me.lblRoutineManager = New System.Windows.Forms.Label()
Me.txtGJ_UNISPED = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Button21 = New System.Windows.Forms.Button()
Me.cbxOnlyBilledTransactions = New System.Windows.Forms.CheckBox()
Me.pnl.SuspendLayout()
CType(Me.PictureBox23, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox22, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -2145,6 +2148,9 @@ Partial Class frmStartOptions
'
'TabPage4
'
Me.TabPage4.Controls.Add(Me.cbxOnlyBilledTransactions)
Me.TabPage4.Controls.Add(Me.LinkLabel62)
Me.TabPage4.Controls.Add(Me.LinkLabel60)
Me.TabPage4.Controls.Add(Me.LinkLabel61)
Me.TabPage4.Controls.Add(Me.Label40)
Me.TabPage4.Controls.Add(Me.txtTransactionID)
@@ -2201,11 +2207,33 @@ Partial Class frmStartOptions
Me.TabPage4.Text = "VERAG 360"
Me.TabPage4.UseVisualStyleBackColor = True
'
'LinkLabel62
'
Me.LinkLabel62.AutoSize = True
Me.LinkLabel62.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel62.Location = New System.Drawing.Point(622, 374)
Me.LinkLabel62.Name = "LinkLabel62"
Me.LinkLabel62.Size = New System.Drawing.Size(226, 13)
Me.LinkLabel62.TabIndex = 120
Me.LinkLabel62.TabStop = True
Me.LinkLabel62.Text = "nicht abgerechete Transaktionen aktualisieren"
'
'LinkLabel60
'
Me.LinkLabel60.AutoSize = True
Me.LinkLabel60.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel60.Location = New System.Drawing.Point(662, 131)
Me.LinkLabel60.Name = "LinkLabel60"
Me.LinkLabel60.Size = New System.Drawing.Size(144, 13)
Me.LinkLabel60.TabIndex = 119
Me.LinkLabel60.TabStop = True
Me.LinkLabel60.Text = "Neueste Settlements abrufen"
'
'LinkLabel61
'
Me.LinkLabel61.AutoSize = True
Me.LinkLabel61.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel61.Location = New System.Drawing.Point(658, 300)
Me.LinkLabel61.Location = New System.Drawing.Point(657, 351)
Me.LinkLabel61.Name = "LinkLabel61"
Me.LinkLabel61.Size = New System.Drawing.Size(158, 13)
Me.LinkLabel61.TabIndex = 118
@@ -2216,7 +2244,7 @@ Partial Class frmStartOptions
'
Me.Label40.AutoSize = True
Me.Label40.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label40.Location = New System.Drawing.Point(658, 185)
Me.Label40.Location = New System.Drawing.Point(658, 235)
Me.Label40.Name = "Label40"
Me.Label40.Size = New System.Drawing.Size(20, 13)
Me.Label40.TabIndex = 116
@@ -2238,7 +2266,7 @@ Partial Class frmStartOptions
Me.txtTransactionID._WaehrungZeichen = True
Me.txtTransactionID.BackColor = System.Drawing.SystemColors.Window
Me.txtTransactionID.ForeColor = System.Drawing.Color.Black
Me.txtTransactionID.Location = New System.Drawing.Point(691, 182)
Me.txtTransactionID.Location = New System.Drawing.Point(691, 232)
Me.txtTransactionID.MaxLength = 10
Me.txtTransactionID.MaxLineLength = -1
Me.txtTransactionID.MaxLines_Warning = ""
@@ -2253,7 +2281,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel59.AutoSize = True
Me.LinkLabel59.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel59.Location = New System.Drawing.Point(670, 205)
Me.LinkLabel59.Location = New System.Drawing.Point(670, 255)
Me.LinkLabel59.Name = "LinkLabel59"
Me.LinkLabel59.Size = New System.Drawing.Size(149, 13)
Me.LinkLabel59.TabIndex = 114
@@ -2264,7 +2292,7 @@ Partial Class frmStartOptions
'
Me.Label39.AutoSize = True
Me.Label39.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label39.Location = New System.Drawing.Point(657, 246)
Me.Label39.Location = New System.Drawing.Point(657, 296)
Me.Label39.Name = "Label39"
Me.Label39.Size = New System.Drawing.Size(28, 13)
Me.Label39.TabIndex = 113
@@ -2274,7 +2302,7 @@ Partial Class frmStartOptions
'
Me.Label38.AutoSize = True
Me.Label38.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label38.Location = New System.Drawing.Point(656, 365)
Me.Label38.Location = New System.Drawing.Point(656, 439)
Me.Label38.Name = "Label38"
Me.Label38.Size = New System.Drawing.Size(23, 13)
Me.Label38.TabIndex = 112
@@ -2284,7 +2312,7 @@ Partial Class frmStartOptions
'
Me.Label37.AutoSize = True
Me.Label37.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label37.Location = New System.Drawing.Point(656, 346)
Me.Label37.Location = New System.Drawing.Point(656, 420)
Me.Label37.Name = "Label37"
Me.Label37.Size = New System.Drawing.Size(28, 13)
Me.Label37.TabIndex = 111
@@ -2294,7 +2322,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel58.AutoSize = True
Me.LinkLabel58.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel58.Location = New System.Drawing.Point(663, 106)
Me.LinkLabel58.Location = New System.Drawing.Point(663, 156)
Me.LinkLabel58.Name = "LinkLabel58"
Me.LinkLabel58.Size = New System.Drawing.Size(126, 13)
Me.LinkLabel58.TabIndex = 110
@@ -2317,7 +2345,7 @@ Partial Class frmStartOptions
Me.txtBatchNr._WaehrungZeichen = True
Me.txtBatchNr.BackColor = System.Drawing.SystemColors.Window
Me.txtBatchNr.ForeColor = System.Drawing.Color.Black
Me.txtBatchNr.Location = New System.Drawing.Point(666, 132)
Me.txtBatchNr.Location = New System.Drawing.Point(666, 182)
Me.txtBatchNr.MaxLength = 3
Me.txtBatchNr.MaxLineLength = -1
Me.txtBatchNr.MaxLines_Warning = ""
@@ -2332,7 +2360,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel57.AutoSize = True
Me.LinkLabel57.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel57.Location = New System.Drawing.Point(663, 155)
Me.LinkLabel57.Location = New System.Drawing.Point(663, 205)
Me.LinkLabel57.Name = "LinkLabel57"
Me.LinkLabel57.Size = New System.Drawing.Size(166, 13)
Me.LinkLabel57.TabIndex = 108
@@ -2342,7 +2370,7 @@ Partial Class frmStartOptions
'DateTimePicker2
'
Me.DateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.DateTimePicker2.Location = New System.Drawing.Point(691, 359)
Me.DateTimePicker2.Location = New System.Drawing.Point(691, 433)
Me.DateTimePicker2.Name = "DateTimePicker2"
Me.DateTimePicker2.Size = New System.Drawing.Size(85, 20)
Me.DateTimePicker2.TabIndex = 107
@@ -2350,7 +2378,7 @@ Partial Class frmStartOptions
'DateTimePicker1
'
Me.DateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.DateTimePicker1.Location = New System.Drawing.Point(691, 340)
Me.DateTimePicker1.Location = New System.Drawing.Point(691, 414)
Me.DateTimePicker1.Name = "DateTimePicker1"
Me.DateTimePicker1.Size = New System.Drawing.Size(85, 20)
Me.DateTimePicker1.TabIndex = 106
@@ -2359,7 +2387,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel56.AutoSize = True
Me.LinkLabel56.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel56.Location = New System.Drawing.Point(656, 382)
Me.LinkLabel56.Location = New System.Drawing.Point(656, 456)
Me.LinkLabel56.Name = "LinkLabel56"
Me.LinkLabel56.Size = New System.Drawing.Size(114, 13)
Me.LinkLabel56.TabIndex = 105
@@ -2369,7 +2397,7 @@ Partial Class frmStartOptions
'datVon
'
Me.datVon.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.datVon.Location = New System.Drawing.Point(691, 246)
Me.datVon.Location = New System.Drawing.Point(691, 296)
Me.datVon.Name = "datVon"
Me.datVon.Size = New System.Drawing.Size(85, 20)
Me.datVon.TabIndex = 104
@@ -2378,7 +2406,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel55.AutoSize = True
Me.LinkLabel55.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel55.Location = New System.Drawing.Point(658, 274)
Me.LinkLabel55.Location = New System.Drawing.Point(658, 324)
Me.LinkLabel55.Name = "LinkLabel55"
Me.LinkLabel55.Size = New System.Drawing.Size(108, 13)
Me.LinkLabel55.TabIndex = 103
@@ -2389,7 +2417,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel54.AutoSize = True
Me.LinkLabel54.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel54.Location = New System.Drawing.Point(663, 89)
Me.LinkLabel54.Location = New System.Drawing.Point(663, 106)
Me.LinkLabel54.Name = "LinkLabel54"
Me.LinkLabel54.Size = New System.Drawing.Size(157, 13)
Me.LinkLabel54.TabIndex = 102
@@ -3086,6 +3114,19 @@ Partial Class frmStartOptions
Me.Button21.Text = "AAS Sendung 24h"
Me.Button21.UseVisualStyleBackColor = True
'
'cbxOnlyBilledTransactions
'
Me.cbxOnlyBilledTransactions.AutoSize = True
Me.cbxOnlyBilledTransactions.Checked = True
Me.cbxOnlyBilledTransactions.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxOnlyBilledTransactions.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbxOnlyBilledTransactions.Location = New System.Drawing.Point(670, 84)
Me.cbxOnlyBilledTransactions.Name = "cbxOnlyBilledTransactions"
Me.cbxOnlyBilledTransactions.Size = New System.Drawing.Size(172, 17)
Me.cbxOnlyBilledTransactions.TabIndex = 121
Me.cbxOnlyBilledTransactions.Text = "nur verrechnete Transaktionen"
Me.cbxOnlyBilledTransactions.UseVisualStyleBackColor = True
'
'frmStartOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -3359,4 +3400,7 @@ Partial Class frmStartOptions
Friend WithEvents Label38 As Label
Friend WithEvents Label37 As Label
Friend WithEvents LinkLabel61 As LinkLabel
Friend WithEvents LinkLabel60 As LinkLabel
Friend WithEvents LinkLabel62 As LinkLabel
Friend WithEvents cbxOnlyBilledTransactions As CheckBox
End Class

View File

@@ -4427,10 +4427,11 @@ Public Class frmStartOptions
Dim totalPages = 0
Dim batchrequestNr = 0
fehler = mse.getNewestTransactions(token, dt, batchrequestNr, totalPages, 0)
fehler = mse.getNewestTransactions(token, dt, batchrequestNr, totalPages, 0, cbxOnlyBilledTransactions.Checked)
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
@@ -4442,6 +4443,7 @@ Public Class frmStartOptions
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
@@ -4474,6 +4476,7 @@ Public Class frmStartOptions
fehler = mse.getInvoices(token, invoice, datVon.Value, datVon.Value)
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
@@ -4498,6 +4501,7 @@ Public Class frmStartOptions
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
Next
@@ -4576,6 +4580,7 @@ Public Class frmStartOptions
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Else
Dim totalPages = 1
@@ -4641,17 +4646,18 @@ Public Class frmStartOptions
Me.Visible = True
End Sub
Private Sub LinkLabel59_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel59.LinkClicked, LinkLabel61.LinkClicked
Private Sub LinkLabel59_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel59.LinkClicked, LinkLabel61.LinkClicked, LinkLabel62.LinkClicked
If sender Is LinkLabel59 Then
If Not IsNumeric(txtTransactionID.Text) Then
MsgBox("ID muss 10stellige Nr sein!")
Me.Visible = True
Exit Sub
End If
If CInt(txtTransactionID.Text) < 100000000 AndAlso CInt(txtTransactionID.Text) > 199999999 Then
MsgBox("falsche ID")
Me.Visible = True
Exit Sub
End If
@@ -4669,6 +4675,7 @@ Public Class frmStartOptions
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Else
@@ -4676,13 +4683,15 @@ Public Class frmStartOptions
If sender Is LinkLabel59 Then
dtTransactionID.Columns.Add("transaction_id", GetType(String))
dtTransactionID.Columns.Add("found", GetType(Boolean))
Dim R As DataRow = dtTransactionID.NewRow
R("transaction_id") = txtTransactionID.Text
R("found") = True
dtTransactionID.Rows.Add(R)
Else
ElseIf sender Is LinkLabel61 Then
dtTransactionID = SQL.loadDgvBySql("select [transaction_id] FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & datVon.Value & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions])", "FMZOLL")
dtTransactionID = SQL.loadDgvBySql("select [transaction_id], CAST(1 AS BIT) as found FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & datVon.Value & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions])", "FMZOLL")
If dtTransactionID.Rows.Count = 0 Then
MsgBox("Zu diesem Rechnungsdatum gibt es keine Rechnung!")
Me.Visible = True
@@ -4694,6 +4703,21 @@ Public Class frmStartOptions
Exit Sub
End If
ElseIf sender Is LinkLabel62 Then
dtTransactionID = SQL.loadDgvBySql("select bills.[transaction_id], CAST(1 AS BIT) as found FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id] where trans.[transaction_status] <> 'Billed' and [invoice_date] = '" & datVon.Value & " '", "FMZOLL")
If dtTransactionID.Rows.Count = 0 Then
MsgBox("Zu diesem Rechnungsdatum gibt es keine Rechnung!")
Me.Visible = True
Exit Sub
End If
If Not vbYes = MsgBox("Möchten Sie die " & dtTransactionID.Rows.Count & " Transaktionen aktualisieren?" & vbNewLine & "Dieser Vorgang dauert je nach Anzahl der Transaktionen etwas.", vbYesNoCancel) Then
Me.Visible = True
Exit Sub
End If
End If
@@ -4704,11 +4728,83 @@ Public Class frmStartOptions
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
Else
Dim dv = New DataView(dtTransactionID)
Dim dtMissingTransactions As New DataTable
dv.RowFilter = "found = false"
dtMissingTransactions = dv.ToTable
If dtMissingTransactions.Rows.Count > 0 Then
Dim b = New System.Text.StringBuilder()
For Each resultRow In dtTransactionID.Rows
b.Append(resultRow(0) & vbNewLine)
Next
MsgBox(dtTransactionID.Rows.Count & " nicht gefundene Transaktionen:" & vbNewLine & b.ToString)
Me.Visible = True
End If
End If
End If
Me.Visible = True
End Sub
Private Sub LinkLabel60_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel60.LinkClicked
Me.Visible = False
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxTestsystem.Checked
Dim mse As New cMSEAPI("MSE")
Dim fehler As String = ""
Dim token = mse.createJWT(fehler)
Dim dt As New DataTable
If fehler <> "" Then
MsgBox(fehler)
Else
Dim totalPages = 0
Dim batchrequestNr = 0
fehler = mse.getNewestSettlements(token, dt, batchrequestNr, totalPages, 0)
If fehler <> "" Then
MsgBox(fehler)
Me.Visible = True
Exit Sub
End If
'Newest Settlements werden nicht benötigt, erst beim Abrufen der RECHNUNG sollen die dazugehörigen Settlements abgerufen werden, allerdings müssen diese initial 1x per API abgerufen werden (mittels getNewSettlements , ansonsten können Sie nicht gefunden werden)!
'sollten sie dennoch gespeichert werden, dann fogenden Code aktivieren:
'-------------START----------------------------------------------
'If totalPages > 1 Then
' For i = 2 To totalPages
' If dt.Rows.Count > 0 Then dt.Clear()
' fehler = mse.getSettlementsFromBatchNrAndPage(token, dt, batchrequestNr, totalPages, i)
' If fehler <> "" Then
' MsgBox(fehler)
' Exit Sub
' End If
' i = i + 1
' Next
'End If
'-------------ENDE----------------------------------------------
End If
Me.Visible = True
End Sub
End Class