diff --git a/Interfaces/ZUGFeRDInterface/PropertyValues.vb b/Interfaces/ZUGFeRDInterface/PropertyValues.vb index c0cf30f5..f27da62d 100644 --- a/Interfaces/ZUGFeRDInterface/PropertyValues.vb +++ b/Interfaces/ZUGFeRDInterface/PropertyValues.vb @@ -15,7 +15,7 @@ Public Class PropertyValues End Sub Public Class CheckPropertyValuesResult - Public MissingProperties As New List(Of String) + Public MissingProperties As New List(Of MissingProperty) Public ValidProperties As New List(Of ValidProperty) End Class @@ -29,6 +29,12 @@ Public Class PropertyValues Public Description As String Public Value As String + Public XMLPath As String + End Class + + Public Class MissingProperty + Public Description As String + Public XMLPath As String End Class Public Function CheckPropertyValues(pDocument As Object, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult @@ -98,6 +104,8 @@ Public Class PropertyValues Dim oTableColumn As String = oColumn.Key.TableColumn Dim oIsRequired As Boolean = oColumn.Key.IsRequired Dim oPropertyDescription As String = oColumn.Key.Description + Dim oPropertyPath As String = oColumn.Key.XMLPath + Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1 ' Returns nothing if oColumn.Value contains an empty list @@ -110,7 +118,11 @@ Public Class PropertyValues If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then If oColumn.Key.IsRequired Then _logger.Warn($"{MessageId} # oPropertyValue for specification [{oTableColumn}] is empty or not found but is required. Continuing with Empty String.") - oResult.MissingProperties.Add(oPropertyDescription) + Dim oMissingProperty = New MissingProperty() With { + .Description = oPropertyDescription, + .XMLPath = oPropertyPath + } + oResult.MissingProperties.Add(oMissingProperty) Else _logger.Debug($"{MessageId} # oPropertyValue for specification [{oTableColumn}] is empty or not found. Continuing with Empty String.") End If @@ -127,7 +139,8 @@ Public Class PropertyValues .GroupCounter = oRowCounter, .TableName = oTableName, .TableColumn = oTableColumn, - .IsRequired = oIsRequired + .IsRequired = oIsRequired, + .XMLPath = oPropertyPath }) Next Next @@ -140,6 +153,7 @@ Public Class PropertyValues Dim oPropertyValueList As List(Of Object) Dim oTableColumn As String = oItem.Value.TableColumn Dim oPropertyDescription As String = oItem.Value.Description + Dim oPropertyPath As String = oItem.Value.XMLPath Dim oPropertyValue As Object = Nothing Dim oTableName = oItem.Value.TableName Dim oIsRequired = oItem.Value.IsRequired @@ -183,7 +197,12 @@ Public Class PropertyValues If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then If oItem.Value.IsRequired Then _logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oPropertyDescription) - oResult.MissingProperties.Add(oPropertyDescription) + Dim oMissingProperty = New MissingProperty With + { + .Description = oPropertyDescription, + .XMLPath = oPropertyPath + } + oResult.MissingProperties.Add(oMissingProperty) Continue For Else _logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oPropertyDescription) @@ -198,7 +217,8 @@ Public Class PropertyValues .Value = oPropertyValue, .TableName = oTableName, .TableColumn = oTableColumn, - .IsRequired = oIsRequired + .IsRequired = oIsRequired, + .XMLPath = oPropertyPath }) Next diff --git a/Interfaces/ZUGFeRDInterface/XmlItemProperty.vb b/Interfaces/ZUGFeRDInterface/XmlItemProperty.vb index 672dcce0..6cbf2465 100644 --- a/Interfaces/ZUGFeRDInterface/XmlItemProperty.vb +++ b/Interfaces/ZUGFeRDInterface/XmlItemProperty.vb @@ -11,4 +11,9 @@ ''' Document version, eg. ZUGFeRD Schema version ''' Public Specification As String + + ''' + ''' XML Pfad, für Anzeige in Ablehnungsmail + ''' + Public XMLPath As String End Class \ No newline at end of file