Belegmail Betreff; Greenpulse
This commit is contained in:
@@ -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)
|
||||
' =========================
|
||||
|
||||
Reference in New Issue
Block a user