Compare commits
2 Commits
b1eb0f7379
...
10db730040
| Author | SHA1 | Date | |
|---|---|---|---|
| 10db730040 | |||
| 901716de41 |
@@ -117,39 +117,84 @@ Public Class cDakosyEZA_Greenpulse
|
|||||||
End If
|
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)
|
Dim DY As New cDakosy_Zollanmeldungen(eza.eza_dyaAnmID)
|
||||||
|
|
||||||
If DY IsNot Nothing Then
|
If DY IsNot Nothing AndAlso DY.dy_SendungsId IsNot Nothing Then
|
||||||
If DY.dy_SendungsId IsNot Nothing Then
|
Dim sendungsId As Integer
|
||||||
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
|
If Integer.TryParse(DY.dy_SendungsId.ToString(), sendungsId) AndAlso sendungsId > 0 Then
|
||||||
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, DY.dy_SendungsId)
|
|
||||||
|
|
||||||
|
Dim ANH_LIST As New List(Of cAvisoAnhaenge)
|
||||||
|
cAvisoAnhaenge.LOAD_LIST_BySendung(ANH_LIST, sendungsId)
|
||||||
|
|
||||||
For Each doc In ANH_LIST
|
For Each doc In ANH_LIST
|
||||||
Select Case doc.anh_Art
|
Select Case doc.anh_Art
|
||||||
Case "Rechnung", "eFatura"
|
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_KafkaDecs.DocumentNode With {
|
Dim d As New cATEZ_Greenpulse_KafkaInvoices.DocumentNode With {
|
||||||
.Reference = doc.anh_Name,
|
.Reference = doc.anh_Name,
|
||||||
.DocType = "invoice",
|
.DocType = "invoice",
|
||||||
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
|
.MimeType = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.GuessMimeTypeFromNumber(doc.anh_Typ),
|
||||||
.Blob = Convert.ToBase64String(dateiBytes)
|
.Blob = Convert.ToBase64String(dateiBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
dest.Documents.Add(d)
|
dest.Documents.Add(d)
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return dest
|
Return dest
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
' =========================
|
' =========================
|
||||||
' Populate-Helper (mit TODO)
|
' Populate-Helper (mit TODO)
|
||||||
' =========================
|
' =========================
|
||||||
|
|||||||
@@ -4154,18 +4154,24 @@ Public Class usrctlProcedures
|
|||||||
MsgBox(EZA.eza_MRN)
|
MsgBox(EZA.eza_MRN)
|
||||||
MsgBox(EZA.eza_ObjectName)
|
MsgBox(EZA.eza_ObjectName)
|
||||||
' Objekt
|
' Objekt
|
||||||
Dim rec = cDakosyEZA_Greenpulse.BuildByMrn(EZA)
|
'Dim rec = cDakosyEZA_Greenpulse.BuildByMrn(EZA)
|
||||||
|
'Dim key = cATEZ_Greenpulse_KafkaDecs.GetUniqueKey_Pipe("DE", "DAKOSY", mrn)
|
||||||
' Dim rec = cATEZ_Greenpulse_KafkaDecs.BuildDemo()
|
'Dim dr = cATEZ_Greenpulse_KafkaDecs.InsertOrUpdateToKafkaSync(rec, key, 30000)
|
||||||
'' JSON (schön formatiert)
|
|
||||||
'Dim json As String = cATEZ_Greenpulse_KafkaDecsBuilder_DAKOSY.BuildJsonByMrn(mrn, pretty:=True)
|
|
||||||
'Console.WriteLine(json)
|
|
||||||
|
|
||||||
|
|
||||||
Dim key = cATEZ_Greenpulse_KafkaDecs.GetUniqueKey_Pipe("DE", "DAKOSY", mrn)
|
Dim key = cATEZ_Greenpulse_KafkaDecs.GetUniqueKey_Pipe("DE", "DAKOSY", mrn)
|
||||||
|
|
||||||
|
' Objekt
|
||||||
|
Dim rec = cDakosyEZA_Greenpulse.BuildByMrn(EZA)
|
||||||
Dim dr = cATEZ_Greenpulse_KafkaDecs.InsertOrUpdateToKafkaSync(rec, key, 30000)
|
Dim dr = cATEZ_Greenpulse_KafkaDecs.InsertOrUpdateToKafkaSync(rec, key, 30000)
|
||||||
|
|
||||||
MessageBox.Show($"OK: {dr.Status} @ {dr.TopicPartitionOffset}")
|
'Unlerlagen
|
||||||
|
Dim rec_inv = cDakosyEZA_Greenpulse.BuildByMrnInvoices(EZA)
|
||||||
|
Dim dr_inv = cATEZ_Greenpulse_KafkaInvoices.InsertOrUpdateToKafkaSync(rec_inv, key, 30000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MessageBox.Show($"OK_Dec: {dr.Status} @ {dr.TopicPartitionOffset}")
|
||||||
|
MessageBox.Show($"OK_Inv: {dr_inv.Status} @ {dr_inv.TopicPartitionOffset}")
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MessageBox.Show(ex.Message)
|
MessageBox.Show(ex.Message)
|
||||||
|
|||||||
@@ -1230,6 +1230,14 @@ Public Class frmStartOptions
|
|||||||
|
|
||||||
|
|
||||||
Dim betreff = cStandort.eMail_Zollbeleg_Betreff '"Zollbeleg"
|
Dim betreff = cStandort.eMail_Zollbeleg_Betreff '"Zollbeleg"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
'Wenn ein fixer BEtreff verwendet werden sollte:
|
||||||
|
If KD_ERW.EmailFreigabeBeleg_Betreff Then
|
||||||
|
betreff = If(KD_ERW.EmailFreigabeBeleg_BetreffText, "")
|
||||||
|
End If
|
||||||
|
|
||||||
betreff = betreff.Replace("%LKW%", AVISO.LKW_Nr)
|
betreff = betreff.Replace("%LKW%", AVISO.LKW_Nr)
|
||||||
betreff = betreff.Replace("%AbfertigungsNr%", SND.FilialenNr & "/" & SND.AbfertigungsNr)
|
betreff = betreff.Replace("%AbfertigungsNr%", SND.FilialenNr & "/" & SND.AbfertigungsNr)
|
||||||
betreff = betreff.Replace("%Standort%", "")
|
betreff = betreff.Replace("%Standort%", "")
|
||||||
|
|||||||
Reference in New Issue
Block a user