From 99b2a5a53b97816f709332939670063a913e93f0 Mon Sep 17 00:00:00 2001 From: SchreiberM Date: Fri, 7 Jun 2024 09:19:20 +0200 Subject: [PATCH] MS Interfaces 2.0 Logging InvoiceSeller --- Interfaces/My Project/AssemblyInfo.vb | 4 ++-- Interfaces/ZUGFeRDInterface/PropertyValues.vb | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Interfaces/My Project/AssemblyInfo.vb b/Interfaces/My Project/AssemblyInfo.vb index 990cc1b6..58b2bece 100644 --- a/Interfaces/My Project/AssemblyInfo.vb +++ b/Interfaces/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Interfaces/ZUGFeRDInterface/PropertyValues.vb b/Interfaces/ZUGFeRDInterface/PropertyValues.vb index 3180d8ea..dd2013c6 100644 --- a/Interfaces/ZUGFeRDInterface/PropertyValues.vb +++ b/Interfaces/ZUGFeRDInterface/PropertyValues.vb @@ -31,7 +31,7 @@ Public Class PropertyValues Public Value As String End Class - Public Function CheckPropertyValues(Document As Object, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult + Public Function CheckPropertyValues(pDocument As Object, PropertyMap As Dictionary(Of String, XmlItemProperty), MessageId As String) As CheckPropertyValuesResult Dim oGlobalGroupCounter = 0 Dim oMissingProperties As New List(Of String) Dim oResult As New CheckPropertyValuesResult() @@ -65,7 +65,7 @@ Public Class PropertyValues Dim oPropertyValues As List(Of Object) _logger.Debug($"Fetching value for itemSpecification [{oProperty.Value.TableColumn}].") Try - oPropertyValues = GetPropValue(Document, oProperty.Key) + oPropertyValues = GetPropValue(pDocument, oProperty.Key) Catch ex As Exception _logger.Warn($"{MessageId} - Unknown error occurred while fetching property/TColumn [{0}] in group [{1}]:", oProperty.Value.TableColumn, oGroupScope) _logger.Error(ex) @@ -104,9 +104,7 @@ Public Class PropertyValues Dim oPropertyValue = oColumn.Value.ElementAtOrDefault(oRowIndex) _logger.Debug("Processing itemSpecification *TableColumn* [{0}].", oTableColumn) - If oTableColumn = "INVOICE_SELLER_EMAIL" Then - Console.WriteLine("INVOICE_SELLER_EMAIL") - End If + 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.") @@ -144,10 +142,14 @@ Public Class PropertyValues Dim oTableName = oItem.Value.TableName Dim oIsRequired = oItem.Value.IsRequired Dim oDescription = oItem.Value.Description + If oTableColumn = "INVOICE_SELLER_EMAIL" Then + Console.WriteLine("INVOICE_SELLER_EMAIL") + End If Try - oPropertyValueList = GetPropValue(Document, oItem.Key) + oPropertyValueList = GetPropValue(pDocument, oItem.Key) Catch ex As Exception _logger.Warn("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oPropertyDescription, oItem.Value.GroupScope, MessageId) + _logger.Warn("ERROR-MESSAGE [{0}]", ex.Message) _logger.Error(ex) oPropertyValueList = New List(Of Object) End Try