This commit is contained in:
2021-11-18 14:59:04 +01:00
parent 05280436a4
commit 98378dd496
51 changed files with 4647 additions and 763 deletions

View File

@@ -475,6 +475,36 @@ Public Class frmMDMNachrichtenVerarbeitung
readPLOSE_Detail = ""
Dim KdnR = ""
Dim plose_RechnungsJahr = ""
Dim plose_RechnungsLieferantCode = ""
Dim plose_RechnungsNr = ""
Dim plose_RechnungsDat = Nothing
Dim plose_Lieferant = Nothing
Dim fi As FileInfo = New FileInfo(d)
If fi.Name.Length > 8 Then
'Dim plose_RechnungsNr = fi.Name.Substring(0, 8)
plose_RechnungsJahr = fi.Name.Substring(0, 2)
plose_RechnungsLieferantCode = fi.Name.Substring(2, 1)
plose_RechnungsNr = fi.Name.Substring(3, 5)
Select Case plose_RechnungsLieferantCode
Case "0" : plose_Lieferant = "PLOSE Sistem Service"
Case "7" : plose_Lieferant = "Consortio PLOSE"
End Select
'FALSCHE WERTE!!!
'If fi.FullName.Contains("_RGDAT_") Then
' Try
' plose_RechnungsDat = CDate(fi.FullName.Substring(fi.FullName.IndexOf("_RGDAT_") + 7, 10))
' Catch ex As Exception
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "PLOSE RG DATUM, FILE: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
' End Try
'End If
End If
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(d, Encoding.UTF8)
MyReader.TextFieldType = FileIO.FieldType.Delimited
MyReader.SetDelimiters(";")
@@ -483,85 +513,82 @@ Public Class frmMDMNachrichtenVerarbeitung
Dim cnt = 0
If True Then
While Not MyReader.EndOfData
Try
currentRow = MyReader.ReadFields()
Dim fi As FileInfo = New FileInfo(d)
If fi.Name.Length > 8 Then
'Dim plose_RechnungsNr = fi.Name.Substring(0, 8)
Dim plose_RechnungsJahr = fi.Name.Substring(0, 2)
Dim plose_RechnungsLieferantCode = fi.Name.Substring(2, 1)
Dim plose_RechnungsNr = fi.Name.Substring(3, 5)
If True Then 'fi.Name.Length > 8 Then
Dim plose_RechnungsDat = Nothing
Dim plose_Lieferant = Nothing
Select Case plose_RechnungsLieferantCode
Case "0" : plose_Lieferant = "PLOSE Sistem Service"
Case "7" : plose_Lieferant = "Consortio PLOSE"
Select Case currentRow(0)
Case "TR1"
'RECHNUGNSDATUM
If currentRow.Length > 1 AndAlso currentRow(1).ToString.Length = 8 Then
Dim datumParse = DateTime.ParseExact(currentRow(1), "yyyyMMdd", Nothing)
plose_RechnungsDat = datumParse 'Rechnungsdatum aus TR1 Datensatz, überschreibt den Wert aus der Dateierstellung
End If
Case "TR5"
If currentRow.Length > 24 AndAlso currentRow(12) <> "839160" Then 'KDNR <> VERAG --> Die Kosten bleiben uns
Dim PLOSE As New MDM_Worker.cPLOSE
PLOSE.plose_Dateiname = fi.Name
PLOSE.plose_RechnungsNr = plose_RechnungsNr
PLOSE.plose_Lieferant = plose_Lieferant
PLOSE.plose_LieferantCode = plose_RechnungsLieferantCode
PLOSE.plose_RechnungsJahr = plose_RechnungsJahr
If plose_RechnungsDat IsNot Nothing Then PLOSE.plose_RechnungsDatum = plose_RechnungsDat
PLOSE.plose_Datensatztyp = SQL.isleernothing(currentRow(0))
PLOSE.plose_KodexMautTankstelle = SQL.isleernothing(currentRow(1))
PLOSE.plose_BeschreibungMautTankstelle = SQL.isleernothing(currentRow(2))
PLOSE.plose_KodexEinfahrt = SQL.isleernothing(currentRow(3))
PLOSE.plose_BeschreibungEinfahrt = SQL.isleernothing(currentRow(4))
PLOSE.plose_KodexAusfahrt = SQL.isleernothing(currentRow(5))
PLOSE.plose_BeschreibungAusfahrt = SQL.isleernothing(currentRow(6))
PLOSE.plose_Kartenkodex = SQL.isleernothing(currentRow(7))
PLOSE.plose_Kontonummer = SQL.isleernothing(currentRow(8))
PLOSE.plose_NummerKarteGeraet = SQL.isleernothing(currentRow(9))
PLOSE.plose_Kennzeichen = SQL.isleernothing(currentRow(10))
PLOSE.plose_InterneNrFahrzeug = SQL.isleernothing(currentRow(11))
PLOSE.plose_POLSEKundennummer = SQL.isleernothing(currentRow(12))
PLOSE.plose_Firmenname = SQL.isleernothing(currentRow(13))
PLOSE.plose_DatumTransaktion = SQL.isleernothingDateFormatstring(currentRow(14))
PLOSE.plose_Produktbeschreibung = SQL.isleernothing(currentRow(15))
PLOSE.plose_Menge = SQL.isNullNothingDbl(currentRow(16))
PLOSE.plose_Preis = SQL.isNullNothingDbl(currentRow(17))
PLOSE.Einheitsrabatt = SQL.isleernothing(currentRow(18))
PLOSE.plose_NettobetragTransaktion = SQL.isNullNothingDbl(currentRow(19))
PLOSE.plose_MWSTBetrag = SQL.isNullNothingDbl(currentRow(20))
PLOSE.plose_BruttobetragTransaktion = SQL.isNullNothingDbl(currentRow(21))
PLOSE.plose_NettobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(22))
PLOSE.plose_MWSTBetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(23))
PLOSE.plose_BruttobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(24))
PLOSE.plose_WaehrungLandDiesntleistung = SQL.isleernothing(currentRow(25))
PLOSE.plose_WaehrungAbbuchung = SQL.isleernothing(currentRow(26))
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(27))
PLOSE.plose_ArtTransaktion = SQL.isleernothing(currentRow(28))
PLOSE.plose_Fahrzeugklasse = SQL.isleernothing(currentRow(29))
PLOSE.plose_KlassenidentifikationEURO = SQL.isleernothing(currentRow(30))
PLOSE.plose_ProduktbeschreibungShort = SQL.isleernothing(currentRow(31))
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(32))
PLOSE.plose_Geraetetyp = SQL.isleernothing(currentRow(33))
PLOSE.plose_ProduktCode = SQL.isleernothing(currentRow(34))
PLOSE.plose_ReferenzenBuchungMaut = SQL.isleernothing(currentRow(35))
''''''''''''
If PLOSE.SAVE() Then
End If
End If
End Select
If fi.FullName.Contains("_RGDAT_") Then
Try
plose_RechnungsDat = CDate(fi.FullName.Substring(fi.FullName.IndexOf("_RGDAT_") + 7, 10))
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "PLOSE RG DATUM, FILE: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End If
If currentRow.Length > 24 AndAlso currentRow(12) <> "839160" Then 'KDNR <> VERAG --> Die Kosten bleiben uns
Dim PLOSE As New MDM_Worker.cPLOSE
PLOSE.plose_Dateiname = fi.Name
PLOSE.plose_RechnungsNr = plose_RechnungsNr
PLOSE.plose_Lieferant = plose_Lieferant
PLOSE.plose_LieferantCode = plose_RechnungsLieferantCode
PLOSE.plose_RechnungsJahr = plose_RechnungsJahr
If plose_RechnungsDat IsNot Nothing Then PLOSE.plose_RechnungsDatum = plose_RechnungsDat
PLOSE.plose_Datensatztyp = SQL.isleernothing(currentRow(0))
PLOSE.plose_KodexMautTankstelle = SQL.isleernothing(currentRow(1))
PLOSE.plose_BeschreibungMautTankstelle = SQL.isleernothing(currentRow(2))
PLOSE.plose_KodexEinfahrt = SQL.isleernothing(currentRow(3))
PLOSE.plose_BeschreibungEinfahrt = SQL.isleernothing(currentRow(4))
PLOSE.plose_KodexAusfahrt = SQL.isleernothing(currentRow(5))
PLOSE.plose_BeschreibungAusfahrt = SQL.isleernothing(currentRow(6))
PLOSE.plose_Kartenkodex = SQL.isleernothing(currentRow(7))
PLOSE.plose_Kontonummer = SQL.isleernothing(currentRow(8))
PLOSE.plose_NummerKarteGeraet = SQL.isleernothing(currentRow(9))
PLOSE.plose_Kennzeichen = SQL.isleernothing(currentRow(10))
PLOSE.plose_InterneNrFahrzeug = SQL.isleernothing(currentRow(11))
PLOSE.plose_POLSEKundennummer = SQL.isleernothing(currentRow(12))
PLOSE.plose_Firmenname = SQL.isleernothing(currentRow(13))
PLOSE.plose_DatumTransaktion = SQL.isleernothingDateFormatstring(currentRow(14))
PLOSE.plose_Produktbeschreibung = SQL.isleernothing(currentRow(15))
PLOSE.plose_Menge = SQL.isNullNothingDbl(currentRow(16))
PLOSE.plose_Preis = SQL.isNullNothingDbl(currentRow(17))
PLOSE.Einheitsrabatt = SQL.isleernothing(currentRow(18))
PLOSE.plose_NettobetragTransaktion = SQL.isNullNothingDbl(currentRow(19))
PLOSE.plose_MWSTBetrag = SQL.isNullNothingDbl(currentRow(20))
PLOSE.plose_BruttobetragTransaktion = SQL.isNullNothingDbl(currentRow(21))
PLOSE.plose_NettobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(22))
PLOSE.plose_MWSTBetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(23))
PLOSE.plose_BruttobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(24))
PLOSE.plose_WaehrungLandDiesntleistung = SQL.isleernothing(currentRow(25))
PLOSE.plose_WaehrungAbbuchung = SQL.isleernothing(currentRow(26))
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(27))
PLOSE.plose_ArtTransaktion = SQL.isleernothing(currentRow(28))
PLOSE.plose_Fahrzeugklasse = SQL.isleernothing(currentRow(29))
PLOSE.plose_KlassenidentifikationEURO = SQL.isleernothing(currentRow(30))
PLOSE.plose_ProduktbeschreibungShort = SQL.isleernothing(currentRow(31))
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(32))
PLOSE.plose_Geraetetyp = SQL.isleernothing(currentRow(33))
PLOSE.plose_ProduktCode = SQL.isleernothing(currentRow(34))
PLOSE.plose_ReferenzenBuchungMaut = SQL.isleernothing(currentRow(35))
''''''''''''
If PLOSE.SAVE() Then
End If
End If
cnt += 1
End If