ZUGFeRD Service: Auswertung der XML-Konfiguration geändert & ZUGFeRD 2.3.x-Anpassungen

This commit is contained in:
PitzM 2025-07-23 11:54:36 +02:00
parent 72315ec28b
commit a40fbe31f9
2 changed files with 40 additions and 29 deletions

View File

@ -71,6 +71,8 @@
Public Property AllowZugferd2x As Boolean = True Public Property AllowZugferd2x As Boolean = True
Public Property AllowZugferd23x As Boolean = True
Public Property AllowPeppolBISBill3x As Boolean = False Public Property AllowPeppolBISBill3x As Boolean = False
End Class End Class
End Class End Class

View File

@ -52,13 +52,14 @@ Public Class ThreadRunner
.AllowXRechnung = _config.Config.Custom.AllowXRechnung, .AllowXRechnung = _config.Config.Custom.AllowXRechnung,
.AllowZugferd10 = _config.Config.Custom.AllowZugferd10, .AllowZugferd10 = _config.Config.Custom.AllowZugferd10,
.AllowZugferd2x = _config.Config.Custom.AllowZugferd2x, .AllowZugferd2x = _config.Config.Custom.AllowZugferd2x,
.AllowZugferd23x = _config.Config.Custom.AllowZugferd23x,
.AllowPeppolBISBill3x = _config.Config.Custom.AllowPeppolBISBill3x, .AllowPeppolBISBill3x = _config.Config.Custom.AllowPeppolBISBill3x,
.RejectionTemplateId = _config.Config.Custom.RejectionTemplateId, .RejectionTemplateId = _config.Config.Custom.RejectionTemplateId,
.GDPictureVersion = _config.Config.Custom.GDPictureVersion .GDPictureVersion = _config.Config.Custom.GDPictureVersion
} }
oArgs = LoadFolderConfig(oArgs) oArgs = LoadFolderConfig(oArgs)
oArgs = LoadPropertyMap(oArgs) oArgs = LoadPropertyMapListFor(oArgs)
_logger.Debug("Custom Options:") _logger.Debug("Custom Options:")
_logger.Debug("ExceptionEmailAddress: [{0}]", oArgs.ExceptionEmailAddress) _logger.Debug("ExceptionEmailAddress: [{0}]", oArgs.ExceptionEmailAddress)
@ -171,36 +172,44 @@ Public Class ThreadRunner
Return pArgs Return pArgs
End Function End Function
Private Function LoadPropertyMap(pArgs As WorkerArgs) As WorkerArgs Private Function LoadPropertyMapListFor(Args As WorkerArgs) As WorkerArgs
Try
Args.PropertyMapList.Clear()
Dim oSQL As String = $"SELECT * FROM TBDD_ZUGFERD_XML_ITEMS WHERE ACTIVE = 1 ORDER BY XML_PATH" Dim oSQL As String = $"SELECT * FROM TBDD_ZUGFERD_XML_ITEMS WHERE ACTIVE = 1 ORDER BY XML_PATH"
Dim oResult As DataTable = _mssql.GetDatatable(oSQL) Dim oResult As DataTable = _mssql.GetDatatable(oSQL)
For Each oRow As DataRow In oResult.Rows For Each oRow As DataRow In oResult.Rows
Dim oXmlPath As String = oRow.Item("XML_PATH") Dim xmlPath As String = oRow.Item("XML_PATH")
Dim oTableName = oRow.Item("TABLE_NAME") Dim tableName = oRow.Item("TABLE_NAME")
Dim oTableColumn = oRow.Item("TABLE_COLUMN") Dim tableColumn = oRow.Item("TABLE_COLUMN")
Dim oDescription = oRow.Item("DESCRIPTION") Dim description = oRow.Item("DESCRIPTION")
Dim oIsRequired = oRow.Item("IS_REQUIRED") Dim isRequired = oRow.Item("IS_REQUIRED")
Dim oIsGrouped = oRow.Item("IS_GROUPED") Dim isGrouped = oRow.Item("IS_GROUPED")
Dim oGroupScope = oRow.Item("GROUP_SCOPE") Dim groupScope = oRow.Item("GROUP_SCOPE")
Dim oSpecification = oRow.Item("SPECIFICATION") Dim specification = oRow.Item("SPECIFICATION")
Dim oItemType = oRow.Item("ITEM_TYPE") Dim oItemType = oRow.Item("ITEM_TYPE")
Dim oEN16931Value = oRow.Item("EN16931_ID") Dim oEN16931_ID = oRow.Item("EN16931_ID")
pArgs.PropertyMap.Add(oXmlPath, New XmlItemProperty() With { Args.PropertyMapList.Add(New XmlItemProperty() With {
.Description = oDescription, .XMLPath = xmlPath,
.TableName = oTableName, .Description = description,
.TableColumn = oTableColumn, .TableName = tableName,
.IsRequired = oIsRequired, .TableColumn = tableColumn,
.IsGrouped = oIsGrouped, .IsRequired = isRequired,
.GroupScope = oGroupScope, .IsGrouped = isGrouped,
.Specification = oSpecification, .GroupScope = groupScope,
.XMLPath = oXmlPath.Replace(".Value", ""), .Specification = specification,
.ItemType = oItemType, .ItemType = oItemType,
.EN16931_ID = oEN16931Value .EN16931_ID = oEN16931_ID
}) })
Next Next
Return pArgs Return Args
Catch ex As Exception
_logger.Error(ex)
Return Args
End Try
End Function End Function
End Class End Class