ZUGFeRDService: Add Options AllowZugferd10, AllowZugferd2x

This commit is contained in:
Jonathan Jenne 2022-12-23 13:49:23 +01:00
parent debd07256c
commit d4a4e842fa
2 changed files with 22 additions and 17 deletions

View File

@ -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

View File

@ -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