Belegmail Betreff; Greenpulse

This commit is contained in:
2025-11-27 09:46:54 +01:00
parent 8e9e964c02
commit 901716de41
3 changed files with 82 additions and 23 deletions

View File

@@ -117,39 +117,84 @@ Public Class cDakosyEZA_Greenpulse
End If
' --- Dokumente aus Unterlagen übernehmen ---
'' --- Dokumente aus Unterlagen übernehmen ---
'Dim DY As New cDakosy_Zollanmeldungen(eza.eza_dyaAnmID)
'If DY IsNot Nothing Then
' If DY.dy_SendungsId IsNot Nothing Then
' Dim ANH_LIST As New List(Of cAvisoAnhaenge)
' cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, DY.dy_SendungsId)
' For Each doc In ANH_LIST
' Select Case doc.anh_Art
' Case "Rechnung", "eFatura"
' Dim dateiBytes As Byte() = System.IO.File.ReadAllBytes(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(doc.anh_docId))
' Dim d As New cATEZ_Greenpulse_KafkaDecs.DocumentNode With {
' .Reference = doc.anh_Name,
' .DocType = "invoice",
' .MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
' .Blob = Convert.ToBase64String(dateiBytes)
' }
' dest.Documents.Add(d)
' End Select
' Next
' End If
'End If
Return dest
End Function
Public Shared Function BuildByMrnInvoices(eza As cDakosyEZA) As cATEZ_Greenpulse_KafkaInvoices
If eza Is Nothing Then Throw New ArgumentNullException(NameOf(eza))
' Zielobjekt NUR für Dokumente
Dim dest As New cATEZ_Greenpulse_KafkaInvoices() With {
.Documents = New List(Of cATEZ_Greenpulse_KafkaInvoices.DocumentNode)()
}
' --- Dokumente aus Unterlagen / Aviso übernehmen ---
Dim DY As New cDakosy_Zollanmeldungen(eza.eza_dyaAnmID)
If DY IsNot Nothing Then
If DY.dy_SendungsId IsNot Nothing Then
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, DY.dy_SendungsId)
If DY IsNot Nothing AndAlso DY.dy_SendungsId IsNot Nothing Then
Dim sendungsId As Integer
If Integer.TryParse(DY.dy_SendungsId.ToString(), sendungsId) AndAlso sendungsId > 0 Then
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, sendungsId)
For Each doc In ANH_LIST
Select Case doc.anh_Art
Case "Rechnung", "eFatura"
Dim dateiBytes As Byte() = System.IO.File.ReadAllBytes(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(doc.anh_docId))
Dim pfad As String = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(doc.anh_docId)
Dim dateiBytes As Byte() = System.IO.File.ReadAllBytes(pfad)
Dim d As New cATEZ_Greenpulse_KafkaInvoices.DocumentNode With {
.Reference = doc.anh_Name,
.DocType = "invoice",
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
.Blob = Convert.ToBase64String(dateiBytes)
}
Dim d As New cATEZ_Greenpulse_KafkaDecs.DocumentNode With {
.Reference = doc.anh_Name,
.DocType = "invoice",
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
.Blob = Convert.ToBase64String(dateiBytes)
}
dest.Documents.Add(d)
End Select
Next
End If
End If
Return dest
End Function
' =========================
' Populate-Helper (mit TODO)
' =========================