UTA, StartOptions, MDM-Datenverarbeitung

This commit is contained in:
2024-06-21 09:04:16 +02:00
parent b8f878be4c
commit 10bf1270d8
5 changed files with 93 additions and 22 deletions

View File

@@ -21,11 +21,11 @@ Public Class usrCntlDatenarchiv
loaddgv()
cboPartnersystem.Items.Clear()
'cboPartnersystem.Items.Clear()
Dim distinctDT As DataTable = DatenarchivBind.bindingdataTable.DefaultView.ToTable(True, "Param_system")
For Each d As DataRow In distinctDT.Rows
cboPartnersystem.Items.Add(d.Item(0))
If Not cboPartnersystem.Items.Contains(d.Item(0)) Then cboPartnersystem.Items.Add(d.Item(0))
Next

View File

@@ -243,6 +243,8 @@ Public Class cUTA
Property Steuerliches_Lieferland As String
Property Steuerliche_Produktgruppe As String
Property Leistungsort_verlagerbar As Char
Property archiviertDatum As Object
Property archiv As Boolean = False
Public hasEntry = False
@@ -343,6 +345,8 @@ Public Class cUTA
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Steuerliches_Lieferland", Steuerliches_Lieferland))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Steuerliche_Produktgruppe", Steuerliche_Produktgruppe))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Leistungsort_verlagerbar", Leistungsort_verlagerbar))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiviertDatum", archiviertDatum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("archiv", archiv))
Return list
End Function

View File

@@ -1,12 +1,8 @@
Imports System.IO
Imports System.Net
Imports System.Runtime.Remoting
Imports System.Text
Imports System.Text.RegularExpressions
Imports System.Web
Imports System.Xml
Imports DocumentFormat.OpenXml.Bibliography
Imports DocumentFormat.OpenXml.Office2010.Excel
Imports Renci.SshNet
Imports Renci.SshNet.Sftp
Imports VERAG_PROG_ALLGEMEIN
@@ -16,6 +12,7 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
Dim dsNichtErkannt As Integer = 0
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim allowClose = False
Dim deleteFilesAfterDownload = False
Dim rmc As New cRMC
Dim uta As New cUTA
Dim programName As String
@@ -30,12 +27,13 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
Sub New(programName As String, allowClose As Boolean) 'autostart
Sub New(programName As String, allowClose As Boolean, deleteFilesAfterDownload As Boolean) 'autostart
' Dieser Aufruf ist für den Designer erforderlich.
InitializeComponent()
Me.programName = programName
Me.allowClose = allowClose
Me.deleteFilesAfterDownload = deleteFilesAfterDownload
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
End Sub
@@ -100,9 +98,9 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
Dim cnt = 0
Try
If programName.Contains("RMC") Then
DownloadFtpDirectory(rmc.API_STRING & "/", New NetworkCredential(rmc.API.Rows(0).Item("api_user").ToString, rmc.API.Rows(0).Item("api_password").ToString), "", cnt, False)
DownloadFtpDirectory(rmc.API_STRING & "/", New NetworkCredential(rmc.API.Rows(0).Item("api_user").ToString, rmc.API.Rows(0).Item("api_password").ToString), "", cnt, deleteFilesAfterDownload)
ElseIf programName.Contains("UTA") Then
DownloadSFtpDirectory(uta.API_STRING, New NetworkCredential(uta.API.Rows(0).Item("api_user").ToString, uta.API.Rows(0).Item("api_password").ToString), "", cnt, False, "/TRX/" & Now.Year)
DownloadSFtpDirectory(uta.API_STRING, New NetworkCredential(uta.API.Rows(0).Item("api_user").ToString, uta.API.Rows(0).Item("api_password").ToString), "", cnt, deleteFilesAfterDownload, "/TRX/" & Now.Year)
ElseIf programName.Contains("IDS") Then
'DownloadSFtpDirectory(uta.API_STRING, New NetworkCredential(uta.API.Rows(0).Item("api_user").ToString, uta.API.Rows(0).Item("api_password").ToString), "", cnt, False, "/TRX/" & Now.Year)
End If
@@ -331,7 +329,11 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
If Not IO.Directory.Exists(zielpfad & "Invoice_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\") Then IO.Directory.CreateDirectory(zielpfad & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
'File in Datenarchiv sichern:
If fi.Name.ToString.StartsWith("invoice_") Then 'aktuell nur die RMC-Dateien! (später, wenn CSV vollständig, dann alle PDFs importieren! d.breimaier: 2024-06-05
'd.breimaier: 2024-06-05 aktuell nur die RMC-Dateien! (später, wenn CSV vollständig, dann alle PDFs importieren!
'd.breimaier: 2024-06-17 laut Christian Schuster von Comcore (EDV-BEtr. von RMC) nicht möglich CSV mit easytrip und sofico Datensätzen zu ergängen!
If fi.Name.ToString.StartsWith("invoice_") Then
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "RMC", Now.Year, Now.ToString("yyyyMMdd"), frmStartOptions.getFileName(d))
@@ -341,6 +343,15 @@ Public Class frmNachrichtenVerarbeitung_MDM_divers
End If
'copy file to lydia
Dim filepathToLydia = "\\share01\F\Juricevic Datensicherung\RMC_RECHNUNGEN\"
If Dateiname.ToString.ToLower.Contains("nto") Then
frmStartOptions.copyFile(d, filepathToLydia & "NETTO\")
Else
frmStartOptions.copyFile(d, filepathToLydia & "BRUTTO\")
End If
frmStartOptions.moveFile_DateBack(d, zielpfad & "Invoice_PDF\" & Now.Year & "\" & Now.ToString("yyyyMMdd") & "\")
If fi.Name.ToLower.Contains("pdf") Then addDGVEinarbeitung("PDF", fi.Name)

View File

@@ -223,6 +223,10 @@ 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.cbxDateienlöschenRMC = New System.Windows.Forms.CheckBox()
Me.cbxDateienlöschenUTA = New System.Windows.Forms.CheckBox()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.TextBox2 = New System.Windows.Forms.TextBox()
Me.pnl.SuspendLayout()
CType(Me.PictureBox23, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.PictureBox22, System.ComponentModel.ISupportInitialize).BeginInit()
@@ -2125,6 +2129,10 @@ Partial Class frmStartOptions
'
'TabPage4
'
Me.TabPage4.Controls.Add(Me.TextBox2)
Me.TabPage4.Controls.Add(Me.TextBox1)
Me.TabPage4.Controls.Add(Me.cbxDateienlöschenUTA)
Me.TabPage4.Controls.Add(Me.cbxDateienlöschenRMC)
Me.TabPage4.Controls.Add(Me.LinkLabel53)
Me.TabPage4.Controls.Add(Me.Label36)
Me.TabPage4.Controls.Add(Me.Label35)
@@ -2165,7 +2173,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel53.AutoSize = True
Me.LinkLabel53.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel53.Location = New System.Drawing.Point(417, 111)
Me.LinkLabel53.Location = New System.Drawing.Point(432, 161)
Me.LinkLabel53.Name = "LinkLabel53"
Me.LinkLabel53.Size = New System.Drawing.Size(82, 13)
Me.LinkLabel53.TabIndex = 97
@@ -2220,9 +2228,9 @@ Partial Class frmStartOptions
Me.Label32.ForeColor = System.Drawing.Color.Red
Me.Label32.Location = New System.Drawing.Point(564, 61)
Me.Label32.Name = "Label32"
Me.Label32.Size = New System.Drawing.Size(38, 16)
Me.Label32.Size = New System.Drawing.Size(32, 16)
Me.Label32.TabIndex = 92
Me.Label32.Text = "UTA"
Me.Label32.Text = "IDS"
'
'Label31
'
@@ -2231,9 +2239,9 @@ Partial Class frmStartOptions
Me.Label31.ForeColor = System.Drawing.Color.Red
Me.Label31.Location = New System.Drawing.Point(417, 61)
Me.Label31.Name = "Label31"
Me.Label31.Size = New System.Drawing.Size(32, 16)
Me.Label31.Size = New System.Drawing.Size(38, 16)
Me.Label31.TabIndex = 91
Me.Label31.Text = "IDS"
Me.Label31.Text = "UTA"
'
'cbxRMC
'
@@ -2241,7 +2249,7 @@ Partial Class frmStartOptions
Me.cbxRMC._allowFreiText = False
Me.cbxRMC._value = ""
Me.cbxRMC.FormattingEnabled = True
Me.cbxRMC.Location = New System.Drawing.Point(241, 127)
Me.cbxRMC.Location = New System.Drawing.Point(241, 177)
Me.cbxRMC.Name = "cbxRMC"
Me.cbxRMC.Size = New System.Drawing.Size(80, 21)
Me.cbxRMC.TabIndex = 90
@@ -2250,7 +2258,7 @@ Partial Class frmStartOptions
'
Me.LinkLabel52.AutoSize = True
Me.LinkLabel52.LinkColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.LinkLabel52.Location = New System.Drawing.Point(238, 111)
Me.LinkLabel52.Location = New System.Drawing.Point(238, 161)
Me.LinkLabel52.Name = "LinkLabel52"
Me.LinkLabel52.Size = New System.Drawing.Size(109, 13)
Me.LinkLabel52.TabIndex = 84
@@ -2807,6 +2815,50 @@ Partial Class frmStartOptions
Me.Button21.Text = "AAS Sendung 24h"
Me.Button21.UseVisualStyleBackColor = True
'
'cbxDateienlöschenRMC
'
Me.cbxDateienlöschenRMC.AutoSize = True
Me.cbxDateienlöschenRMC.Checked = True
Me.cbxDateienlöschenRMC.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxDateienlöschenRMC.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbxDateienlöschenRMC.Location = New System.Drawing.Point(241, 127)
Me.cbxDateienlöschenRMC.Name = "cbxDateienlöschenRMC"
Me.cbxDateienlöschenRMC.Size = New System.Drawing.Size(15, 14)
Me.cbxDateienlöschenRMC.TabIndex = 98
Me.cbxDateienlöschenRMC.UseVisualStyleBackColor = True
'
'cbxDateienlöschenUTA
'
Me.cbxDateienlöschenUTA.AutoSize = True
Me.cbxDateienlöschenUTA.Checked = True
Me.cbxDateienlöschenUTA.CheckState = System.Windows.Forms.CheckState.Checked
Me.cbxDateienlöschenUTA.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbxDateienlöschenUTA.Location = New System.Drawing.Point(420, 127)
Me.cbxDateienlöschenUTA.Name = "cbxDateienlöschenUTA"
Me.cbxDateienlöschenUTA.Size = New System.Drawing.Size(15, 14)
Me.cbxDateienlöschenUTA.TabIndex = 99
Me.cbxDateienlöschenUTA.UseVisualStyleBackColor = True
'
'TextBox1
'
Me.TextBox1.BackColor = System.Drawing.SystemColors.Menu
Me.TextBox1.Location = New System.Drawing.Point(441, 103)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(73, 55)
Me.TextBox1.TabIndex = 100
Me.TextBox1.Text = "Dateien nach Import von FTP löschen"
'
'TextBox2
'
Me.TextBox2.BackColor = System.Drawing.SystemColors.Menu
Me.TextBox2.Location = New System.Drawing.Point(263, 103)
Me.TextBox2.Multiline = True
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.Size = New System.Drawing.Size(72, 55)
Me.TextBox2.TabIndex = 101
Me.TextBox2.Text = "Dateien nach Import von FTP löschen"
'
'frmStartOptions
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -3060,4 +3112,8 @@ Partial Class frmStartOptions
Friend WithEvents Label33 As Label
Friend WithEvents Label32 As Label
Friend WithEvents Label31 As Label
Friend WithEvents cbxDateienlöschenRMC As CheckBox
Friend WithEvents cbxDateienlöschenUTA As CheckBox
Friend WithEvents TextBox2 As TextBox
Friend WithEvents TextBox1 As TextBox
End Class

View File

@@ -4377,7 +4377,7 @@ Public Class frmStartOptions
Me.Visible = False
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxTestsystem.Checked
If cbxRMC._value = "" Then Exit Sub
Dim f As New frmNachrichtenVerarbeitung_MDM_divers(cbxRMC._value)
Dim f As New frmNachrichtenVerarbeitung_MDM_divers(cbxRMC._value, False, cbxDateienlöschenRMC.Checked)
f.ShowDialog()
Me.Visible = True
End Sub
@@ -4385,7 +4385,7 @@ Public Class frmStartOptions
Private Sub LinkLabel53_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel53.LinkClicked
Me.Visible = False
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxTestsystem.Checked
Dim f As New frmNachrichtenVerarbeitung_MDM_divers("UTA")
Dim f As New frmNachrichtenVerarbeitung_MDM_divers("UTA", False, cbxDateienlöschenUTA.Checked)
f.ShowDialog()
Me.Visible = True
End Sub