spedbuch auswert; ReadT1ATEZ,Greenpulse API

This commit is contained in:
2026-09-23 07:35:13 +02:00
parent 7bf914da5a
commit d45eb6821e
6 changed files with 1951 additions and 735 deletions

View File

@@ -4072,10 +4072,13 @@ Class cSpeditionsbuchReport
datei = exclApp.Workbooks.Open(path)
blatt = datei.Worksheets(1)
CreateDetailReport(blatt, dt, KDNR)
Dim errorTmp = ""
CreateDetailReport(blatt, dt, KDNR, errorTmp)
' CreateGeneralReport(blatt, dt, KDNR, AbfVon, AbfBis)
If errorTmp <> "" Then
MsgBox("Fehlende Datensätze des Detailberichtes (SpedBuch vorhanden): " & vbCrLf & errorTmp.Trim)
End If
datei.Save()
@@ -4181,7 +4184,7 @@ Class cSpeditionsbuchReport
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
Dim sqlText As String =
"SELECT CAST([FilialenNr] as varchar) + '/' + CAST([AbfertigungsNr] as varchar) Abfertigungsnummer, " &
"Select CAST([FilialenNr] As varchar) + '/' + CAST([AbfertigungsNr] as varchar) Abfertigungsnummer, " &
" CAST([Abfertigungsdatum] as date) Abfertigungsdatum, " &
" Absender, Empfänger, " &
" Rechnungsbetrag Betrag, " &
@@ -4237,7 +4240,7 @@ Class cSpeditionsbuchReport
Return cd
End Function
Private Sub CreateDetailReport(blatt As Object, dt As DataTable, kdnr As Integer)
Private Sub CreateDetailReport(blatt As Object, dt As DataTable, kdnr As Integer, ByRef errorTmp As String)
Dim cnt As Integer = 2
For Each r As DataRow In dt.Rows
@@ -4245,14 +4248,14 @@ Class cSpeditionsbuchReport
Dim cd As cVERAG_CustomsDeclarations = LoadCustomsDeclaration(r)
If Not cd.hasEntry Then
MsgBox("ERROR: Nicht gefunden: " &
If(r("BelegNr"), "").ToString() & " " &
errorTmp &= If(r("BelegNr"), "").ToString() & " " &
If(r("FilialenNr"), "").ToString() & "/" &
If(r("AbfertigungsNr"), "").ToString())
End If
's
WriteDetailReportRow(blatt, r, cd, cnt, kdnr)
If(r("AbfertigungsNr"), "").ToString() & vbNewLine
Else 'Durch else wird nur Zeile geschrieben, wenn auch eine Zolldeklaration gefunden wurde. Sonst wird nur eine Fehlermeldung ausgegeben.
WriteDetailReportRow(blatt, r, cd, cnt, kdnr)
End If
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & ex.StackTrace)
End Try