MS WISAG ZUGFERD

This commit is contained in:
2020-04-20 10:01:46 +02:00
parent fde2ca6198
commit 79e1d0a7de
6 changed files with 33 additions and 23 deletions

View File

@@ -48,14 +48,14 @@ Public Class PropertyValues
ToLookup(Function(Item) Item.Value.GroupScope, ' Lookup key is group scope
Function(Item) Item)
_logger.Debug("Found {0} properties grouped in {1} group(s)", PropertyMap.Count - oDefaultProperties.Count, oGroupedProperties.Count)
_logger.Debug($"Found [{PropertyMap.Count - oDefaultProperties.Count}] properties grouped in [{oGroupedProperties.Count}] group(s)")
' Iterate through groups to get group scope and group items
For Each oGroup In oGroupedProperties
Dim oGroupScope As String = oGroup.Key
Dim oPropertyList As New Dictionary(Of XmlItemProperty, List(Of Object))
Dim oRowCount = 0
_logger.Debug("Fetching Property values for group {0}.", oGroupScope)
_logger.Debug($"Fetching Property values for group [{oGroupScope}].")
' get properties as a nested object, see `oPropertyList`
For Each oProperty As KeyValuePair(Of String, XmlItemProperty) In oGroup
@@ -94,24 +94,26 @@ Public Class PropertyValues
Dim oTableName As String = oColumn.Key.TableName
Dim oPropertyDescription As String = oColumn.Key.Description
Dim oRowCounter = oRowIndex + oGlobalGroupCounter + 1
If IsNothing(oRowCounter) Then
End If
' Returns nothing if oColumn.Value contains an empty list
Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex)
_logger.Debug("Processing property {0}.", oPropertyDescription)
_logger.Debug("Processing property [{0}].", oPropertyDescription)
If IsNothing(oPropertyValue) OrElse String.IsNullOrEmpty(oPropertyValue) Then
If oColumn.Key.IsRequired Then
_logger.Warn("Property [{0}] is empty or not found but is required. Continuing with Empty String.", oPropertyDescription)
_logger.Warn($"Property [{oPropertyDescription}] is empty or not found but is required. Continuing with Empty String.")
oResult.MissingProperties.Add(oPropertyDescription)
Else
_logger.Debug("Property [{0}] is empty or not found. Continuing with Empty String.", oPropertyDescription)
_logger.Debug($"Property [{oPropertyDescription}] is empty or not found. Continuing with Empty String.")
End If
oPropertyValue = String.Empty
End If
_logger.Debug("Property {0} has value '{1}'", oPropertyDescription, oPropertyValue)
_logger.Debug("Property [{0}] has value '{1}'", oPropertyDescription, oPropertyValue)
oResult.ValidProperties.Add(New ValidProperty() With {
.MessageId = MessageId,