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 AllowZugferd23x As Boolean = True
Public Property AllowPeppolBISBill3x As Boolean = False
End Class
End Class

View File

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