4 Commits

Author SHA1 Message Date
2ec92511cb Modules.Jobs: Version 2.9.2.0 2025-05-13 14:50:02 +02:00
8e1b9d21f3 Modules.Interfaces - Version 2.2.7.0 2025-05-13 14:49:26 +02:00
7ac596b930 Merge branch 'master' of http://git.dd:3000/AppStd/Modules 2025-05-13 14:48:51 +02:00
cf9650be50 Peppol 3017 / UBL Logik 2025-05-13 14:48:09 +02:00
7 changed files with 69 additions and 12 deletions

View File

@@ -226,6 +226,7 @@
<Compile Include="GrapQLInterface\LoginData.vb" />
<Compile Include="GrapQLInterface\LogoutData.vb" />
<Compile Include="GrapQLInterface\QueryData.vb" />
<Compile Include="ZUGFeRDInterface\Enums\Item_Types.vb" />
<Compile Include="ZUGFeRDInterface\Exceptions.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">

View File

@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("Modules.Interfaces")>
<Assembly: AssemblyCopyright("Copyright © 2025")>
<Assembly: AssemblyTrademark("2.2.5.0")>
<Assembly: AssemblyTrademark("2.2.7.0")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.2.6.0")>
<Assembly: AssemblyFileVersion("2.2.6.0")>
<Assembly: AssemblyVersion("2.2.7.0")>
<Assembly: AssemblyFileVersion("2.2.7.0")>

View File

@@ -21,8 +21,8 @@ Public Class ZUGFeRDInterface
Public Const ZUGFERD_SPEC_DEFAULT = "DEFAULT"
Public Const ZUGFERD_SPEC_10 = "ZUGFERD_10"
Public Const ZUGFERD_SPEC_2x = "ZUGFERD_2x"
Public Const PEPPOL_SPEC_3x_INVOICE = "PEPPOL_BISBILL_3x_INVOICE"
Public Const PEPPOL_SPEC_3x_CREDITNOTE = "PEPPOL_BISBILL_3x_CREDITNOTE"
Public Const PEPPOL_SPEC_3x_INVOICE = "PEPPOL_BISBILL_3x"
Public Const PEPPOL_SPEC_3x_CREDITNOTE = "PEPPOL_BISBILL_3x"
Public Const XMLSCHEMA_ZUGFERD_10 = "Version1_0"
Public Const XMLSCHEMA_ZUGFERD_20 = "Version2_0"

View File

@@ -0,0 +1,7 @@
Public Enum Item_Types
StringType '0
DateType '1
MoneyType '2
FileType '3
End Enum

View File

@@ -83,17 +83,17 @@ Public Class PropertyValues
_logger.Error(ex)
oPropertyValues = New List(Of Object)
End Try
' check the first batch of values to determine the row count
If oRowCount = 0 Then '08.04.2025 MS Added as Workaround for Positions Or oGroupScope = "POSITIONS" !
oRowCount = oPropertyValues.Count
End If
' Flatten result value
oPropertyValues = GetFinalPropValue(oPropertyValues)
' Add to list
oPropertyList.Add(oProperty.Value, oPropertyValues)
' check the first batch of values to determine the row count
Next
' Structure of oPropertyList

View File

@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("Modules.Jobs")>
<Assembly: AssemblyCopyright("Copyright © 2025")>
<Assembly: AssemblyTrademark("2.8.1.0")>
<Assembly: AssemblyTrademark("2.9.2.0")>
<Assembly: ComVisible(False)>
@@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
' übernehmen, indem Sie "*" eingeben:
<Assembly: AssemblyVersion("2.9.1.0")>
<Assembly: AssemblyFileVersion("2.9.1.0")>
<Assembly: AssemblyVersion("2.9.2.0")>
<Assembly: AssemblyFileVersion("2.9.2.0")>

View File

@@ -8,6 +8,7 @@ Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Interfaces
Imports DigitalData.Modules.Interfaces.Exceptions
Imports DigitalData.Modules.Interfaces.PropertyValues
Imports DigitalData.Modules.Jobs.Exceptions
Imports DigitalData.Modules.Logging
@@ -686,12 +687,54 @@ Public Class ImportZUGFeRDFiles
_logger.Debug("No missing properties found. Continuing.")
End If
' Daten in die Datenbank speichern
If BulkInsertDataToDatabase(pMessageId, pDocument, pConnections, oCheckResult) = False Then
_logger.Error("Bulk Insert for MessageId [{0}] failed!", pMessageId)
Throw New Exception("Bulk Insert failed! Exiting.")
End If
' TODO hier BAUSTELLE
' Eingebettete Dateien speichern
'If CreateEmbeddedFilesOnDisk(pMessageId, pDocument, pConnections, oCheckResult) = False Then
' _logger.Debug("Files saving for MessageId [{0}] failed!", pMessageId)
'End If
Return True
End Function
Private Function CreateEmbeddedFilesOnDisk(pMessageId As String, pDocument As ZUGFeRDInterface.ZugferdResult, pConnections As DatabaseConnections, pCheckResult As CheckPropertyValuesResult) As Boolean
' Finde alle Eintraege in pCheckResult mit Item_Type=3
' Finde Dateinamen (Index nach ~attm) und Dateityp. Wir speichern nur PDF.
' TODO Funktion aufrufen
'SaveBase64ToDisk("", "") = False Then
Return True
End Function
Private Function SaveBase64ToDisk(pExportFilePath As String, pBase64String As String) As Boolean
Try
Dim base64BinaryDataString As String = pBase64String ' Hier Base64-String einfügen
Dim binaryDataString As Byte() = System.Convert.FromBase64String(base64BinaryDataString)
Dim oFilename As String = pExportFilePath
Dim Stream As System.IO.FileStream = New System.IO.FileStream(oFilename, System.IO.FileMode.Create)
Stream.Write(binaryDataString, 0, binaryDataString.Length)
Stream.Close()
Catch ex As Exception
_logger.Error("Could NOT save File to Disk for MessageId [{0}] !", pExportFilePath)
End Try
Return True
End Function
Private Function BulkInsertDataToDatabase(pMessageId As String, pDocument As ZUGFeRDInterface.ZugferdResult, pConnections As DatabaseConnections, pCheckResults As CheckPropertyValuesResult) As Boolean
If DeleteExistingPropertyValues(pMessageId, pConnections) = False Then
Throw New Exception("Could not cleanup data. Exiting.")
End If
' DataTable vorbereiten
Dim oDataTable As DataTable = FillDataTable(pMessageId, oCheckResult, pDocument)
Dim oDataTable As DataTable = FillDataTable(pMessageId, pCheckResults, pDocument)
' ColumnList initialisieren
Dim oColumnNames As List(Of String) = New List(Of String) From {
@@ -714,6 +757,7 @@ Public Class ImportZUGFeRDFiles
Return True
End Function
Private Function FillDataTable(pMessageId As String, pCheckResult As PropertyValues.CheckPropertyValuesResult, pDocument As ZUGFeRDInterface.ZugferdResult) As DataTable
Dim oDataTable As DataTable = New DataTable()
@@ -762,6 +806,11 @@ Public Class ImportZUGFeRDFiles
For Each oProperty In pCheckResult.ValidProperties
' ItemType = 3 => eingebettete Datei, nicht den base64 speichern
If oProperty.ItemType = 3 Then
Continue For
End If
' If GroupCounter is -1, it means this is a default property that can only occur once.
' Set the actual inserted value to 0
Dim oGroupCounterValue As Integer = oProperty.GroupCounter