diff --git a/Services.ZUGFeRDService/Config.vb b/Services.ZUGFeRDService/Config.vb index 26f2b27e..12f30ca8 100644 --- a/Services.ZUGFeRDService/Config.vb +++ b/Services.ZUGFeRDService/Config.vb @@ -35,9 +35,10 @@ Public Property RejectionTransferTimeUnit As String = "HOUR" Public Property RejectionTransferTimeValue As Integer = 12 - Public Property AllowFacturX As Boolean = True - Public Property AllowXRechnung As Boolean = True - + Public Property AllowFacturX As Boolean = False + Public Property AllowXRechnung As Boolean = False + Public Property AllowZugferd10 As Boolean = True + Public Property AllowZugferd2x As Boolean = True End Class Public Class FirebirdConfig diff --git a/Services.ZUGFeRDService/ThreadRunner.vb b/Services.ZUGFeRDService/ThreadRunner.vb index 8897e943..7b6ee427 100644 --- a/Services.ZUGFeRDService/ThreadRunner.vb +++ b/Services.ZUGFeRDService/ThreadRunner.vb @@ -53,11 +53,13 @@ Public Class ThreadRunner .NamePortal = _config.Config.PORTAL_NAME, .EmailOutProfileId = _config.Config.MSSQLEmailOutAccountID, .AllowFacturX = _config.Config.Custom.AllowFacturX, - .AllowXRechnung = _config.Config.Custom.AllowXRechnung + .AllowXRechnung = _config.Config.Custom.AllowXRechnung, + .AllowZugferd10 = _config.Config.Custom.AllowZugferd10, + .AllowZugferd2x = _config.Config.Custom.AllowZugferd2x } oArgs = LoadFolderConfig(oArgs) - oArgs = LoadPropertyMapFor(oArgs, "DEFAULT") + oArgs = LoadPropertyMap(oArgs) ' Use MSSQL Server if available If Not IsNothing(_mssql) Then @@ -243,18 +245,19 @@ Public Class ThreadRunner Return pArgs End Function - Private Function LoadPropertyMapFor(pArgs As WorkerArgs, pSpecification As String) As WorkerArgs - Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE SPECIFICATION = '{pSpecification}' AND ACTIVE = True ORDER BY XML_PATH" - Dim oResult As DataTable = _firebird.GetDatatable(oSQL) + Private Function LoadPropertyMap(pArgs As WorkerArgs) As WorkerArgs + Dim oSQL As String = $"SELECT * FROM TBEDM_XML_ITEMS WHERE ACTIVE = True ORDER BY XML_PATH" + Dim oResult As DataTable = _firebird.GetDatatable(oSQL) - For Each row As DataRow In oResult.Rows - Dim oXmlPath = row.Item("XML_PATH") - Dim oTableName = row.Item("TABLE_NAME") - Dim oTableColumn = row.Item("TABLE_COLUMN") - Dim oDescription = row.Item("DESCRIPTION") - Dim oIsRequired = row.Item("IS_REQUIRED") - Dim oIsGrouped = row.Item("IS_GROUPED") - Dim oGroupScope = row.Item("GROUP_SCOPE") + For Each oRow As DataRow In oResult.Rows + Dim oXmlPath = 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") pArgs.PropertyMap.Add(oXmlPath, New XmlItemProperty() With { .Description = oDescription, @@ -262,7 +265,8 @@ Public Class ThreadRunner .TableColumn = oTableColumn, .IsRequired = oIsRequired, .IsGrouped = oIsGrouped, - .GroupScope = oGroupScope + .GroupScope = oGroupScope, + .Specification = oSpecification }) Next