diff --git a/Interfaces/ZUGFeRDInterface.vb b/Interfaces/ZUGFeRDInterface.vb index aee468ec..fdde7ca6 100644 --- a/Interfaces/ZUGFeRDInterface.vb +++ b/Interfaces/ZUGFeRDInterface.vb @@ -19,6 +19,7 @@ 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 ZUGFERD_SPEC_2_3x = "ZUGFERD_2_3x" Public Const UBL_SPEC_21 = "UBL_21" @@ -60,6 +61,7 @@ Public Class ZUGFeRDInterface Public Property AllowXRechnung_Filename As Boolean = True Public Property AllowZugferd_1_0_Schema As Boolean = True Public Property AllowZugferd_2_x_Schema As Boolean = True + Public Property AllowZugferd_2_3_x_Schema As Boolean = True Public Property AllowPeppol_3_x_Schema As Boolean = False End Class @@ -130,19 +132,19 @@ Public Class ZUGFeRDInterface AllowedFilenames = oAllowedFilenames End Sub - Public Function FilterPropertyMap(pPropertyMap As Dictionary(Of String, XmlItemProperty), pSpecification As String) As Dictionary(Of String, XmlItemProperty) + Public Function FilterPropertyMap(pPropertyMapList As List(Of XmlItemProperty), pSpecification As String) As Dictionary(Of String, XmlItemProperty) _logger.Debug("Filtering Property map for Specification [{0}]", pSpecification) If pSpecification = ZUGFERD_SPEC_10 Then _logger.Debug("Special Case [{0}], including [{1}]", ZUGFERD_SPEC_10, ZUGFERD_SPEC_DEFAULT) - Return pPropertyMap. - Where(Function(kv) kv.Value.Specification = pSpecification Or kv.Value.Specification = ZUGFERD_SPEC_DEFAULT). - ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value) + Return pPropertyMapList. + Where(Function(kv) kv.Specification = pSpecification Or kv.Specification = ZUGFERD_SPEC_DEFAULT). + ToDictionary(Function(kv) kv.XMLPath, Function(kv) kv) Else _logger.Debug("Using Specification [{0}]", pSpecification) - Return pPropertyMap. - Where(Function(kv) kv.Value.Specification = pSpecification). - ToDictionary(Function(kv) kv.Key, Function(kv) kv.Value) + Return pPropertyMapList. + Where(Function(kv) kv.Specification = pSpecification). + ToDictionary(Function(kv) kv.XMLPath, Function(kv) kv) End If End Function @@ -358,6 +360,7 @@ Public Class ZUGFeRDInterface }) End If + '' Reihenfolge 2.0 muss unverändert bleiben. Älteste Version immer zuerst! If _Options.AllowZugferd_2_x_Schema Then oAllowedTypes.AddRange(New List(Of AllowedType) From { New AllowedType With { @@ -374,16 +377,22 @@ Public Class ZUGFeRDInterface .SchemaType = GetType(Version2_2_FacturX.CrossIndustryInvoiceType), .Specification = ZUGFERD_SPEC_2x, .XMLSchema = XMLSCHEMA_ZUGFERD_22 + } + }) + End If + + '' Reihenfolge ab 2.3 geändert. Neuste Version immer zuerst + If _Options.AllowZugferd_2_3_x_Schema Then + oAllowedTypes.AddRange(New List(Of AllowedType) From { + New AllowedType With { + .SchemaType = GetType(Version2_3_3_FacturX.CrossIndustryInvoiceType), + .Specification = ZUGFERD_SPEC_2_3x, + .XMLSchema = XMLSCHEMA_ZUGFERD_233 }, New AllowedType With { .SchemaType = GetType(Version2_3_FacturX.CrossIndustryInvoiceType), - .Specification = ZUGFERD_SPEC_2x, + .Specification = ZUGFERD_SPEC_2_3x, .XMLSchema = XMLSCHEMA_ZUGFERD_23 - }, - New AllowedType With { - .SchemaType = GetType(Version2_3_3_FacturX.CrossIndustryInvoiceType), - .Specification = ZUGFERD_SPEC_2x, - .XMLSchema = XMLSCHEMA_ZUGFERD_233 } }) End If diff --git a/Interfaces/ZUGFeRDInterface/PropertyValues.vb b/Interfaces/ZUGFeRDInterface/PropertyValues.vb index 3229c0ad..b3045863 100644 --- a/Interfaces/ZUGFeRDInterface/PropertyValues.vb +++ b/Interfaces/ZUGFeRDInterface/PropertyValues.vb @@ -220,7 +220,7 @@ Public Class PropertyValues If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then If oItem.Value.IsRequired Then - _logger.Warn("Specification [{1}] is empty, but marked as required! Skipping.", oTableColumn) + _logger.Warn("Specification [{0}] is empty, but marked as required! Skipping.", oTableColumn) Dim oMissingProperty = New MissingProperty With { .Description = oPropertyDescription, @@ -229,7 +229,7 @@ Public Class PropertyValues oResult.MissingProperties.Add(oMissingProperty) Continue For Else - _logger.Debug("oPropertyValue for specification [{1}] is empty or not found. Skipping.", oTableColumn) + _logger.Debug("oPropertyValue for specification [{0}] is empty or not found. Skipping.", oTableColumn) Continue For End If @@ -333,7 +333,7 @@ Public Class PropertyValues s = Convert.ToString(Obj) - If IsDate(s) Then + If IsDate(s) = True Then ' Hier wird das DEFAULT-Format auf yyyyMMdd gesetzt Dim dtfi As DateTimeFormatInfo = CultureInfo.CreateSpecificCulture(CultureInfo.InvariantCulture.Name).DateTimeFormat dtfi.DateSeparator = "" @@ -354,7 +354,7 @@ Public Class PropertyValues Dim oResult As String - If IsNumeric(Obj) Then + If IsNumeric(Obj) = True Then Dim decValue As Decimal = CDec(Obj) ' Es wird immer ein . als Dezimaltrenner verwendet, falls nötig oResult = decValue.ToString(CultureInfo.InvariantCulture) @@ -370,7 +370,6 @@ Public Class PropertyValues End If End If End If - Next Return New List(Of Object) From {Obj} diff --git a/Interfaces/ZUGFeRDInterface/Version2.3_3_FacturX/CrossIndustryInvoiceType.vb b/Interfaces/ZUGFeRDInterface/Version2.3_3_FacturX/CrossIndustryInvoiceType.vb index d921daee..9be13b98 100644 --- a/Interfaces/ZUGFeRDInterface/Version2.3_3_FacturX/CrossIndustryInvoiceType.vb +++ b/Interfaces/ZUGFeRDInterface/Version2.3_3_FacturX/CrossIndustryInvoiceType.vb @@ -566,18 +566,31 @@ Namespace ZUGFeRD.Version2_3_3_FacturX System.ComponentModel.DesignerCategoryAttribute("code"), _ System.Xml.Serialization.XmlTypeAttribute([Namespace]:="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100")> _ Partial Public Class DateTimeType - - Private itemField As Object - + + 'Private itemField As Object + + '''' + ' _ + 'Public Property Item() As Object + ' Get + ' Return Me.itemField + ' End Get + ' Set + ' Me.itemField = value + ' End Set + 'End Property + + Private itemField As DateTimeTypeDateTimeString + ''' - _ - Public Property Item() As Object + + Public Property DateTimeString() As DateTimeTypeDateTimeString Get Return Me.itemField End Get Set - Me.itemField = value + Me.itemField = Value End Set End Property End Class diff --git a/Interfaces/ZUGFeRDInterface/Version2.3_FacturX/CrossIndustryInvoiceType.vb b/Interfaces/ZUGFeRDInterface/Version2.3_FacturX/CrossIndustryInvoiceType.vb index 315ab2bc..7ca02690 100644 --- a/Interfaces/ZUGFeRDInterface/Version2.3_FacturX/CrossIndustryInvoiceType.vb +++ b/Interfaces/ZUGFeRDInterface/Version2.3_FacturX/CrossIndustryInvoiceType.vb @@ -558,7 +558,7 @@ Namespace ZUGFeRD.Version2_3_FacturX End Set End Property End Class - + ''' _ Partial Public Class DateTimeType - - Private itemField As Object - + + 'Private itemField As Object + + '''' + ' _ + 'Public Property Item() As Object + ' Get + ' Return Me.itemField + ' End Get + ' Set + ' Me.itemField = value + ' End Set + 'End Property + + Private itemField As DateTimeTypeDateTimeString + ''' - _ - Public Property Item() As Object + + Public Property DateTimeString() As DateTimeTypeDateTimeString Get Return Me.itemField End Get Set - Me.itemField = value + Me.itemField = Value End Set End Property End Class diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index cfb3a6cb..cf617ac3 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -699,7 +699,7 @@ Public Class ImportZUGFeRDFiles ' - a List of valid properties ' - a List of missing properties - Dim oPropertyMap = _zugferd.FilterPropertyMap(pArgs.PropertyMap, pDocument.Specification) + Dim oPropertyMap As Dictionary(Of String, XmlItemProperty) = _zugferd.FilterPropertyMap(pArgs.PropertyMapList, pDocument.Specification) Dim oCheckResult = _zugferd.PropertyValues.CheckPropertyValues(pDocument.SchemaObject, oPropertyMap, pMessageId) _logger.Info("Properties checked: [{0}] missing properties / [{1}] valid properties found.", oCheckResult.MissingProperties.Count, oCheckResult.ValidProperties.Count) diff --git a/Jobs/ZUGFeRD/WorkerArgs.vb b/Jobs/ZUGFeRD/WorkerArgs.vb index b1bb878b..bb5b85ee 100644 --- a/Jobs/ZUGFeRD/WorkerArgs.vb +++ b/Jobs/ZUGFeRD/WorkerArgs.vb @@ -12,7 +12,7 @@ Public Class WorkerArgs Public NonZugferdDirectory As String = Nothing ' Property Parameter - Public PropertyMap As New Dictionary(Of String, XmlItemProperty) + Public PropertyMapList As New List(Of XmlItemProperty) ' Email Parameter Public EmailOutProfileId As Integer = 0 @@ -31,6 +31,7 @@ Public Class WorkerArgs Public AllowXRechnung As Boolean = True Public AllowZugferd10 As Boolean = True Public AllowZugferd2x As Boolean = True + Public AllowZugferd23x As Boolean = True Public AllowPeppolBISBill3x As Boolean = False End Class \ No newline at end of file