From 0ed996100d8514386fcb3dbb106f7b389f71b138 Mon Sep 17 00:00:00 2001 From: pitzm Date: Thu, 26 Jun 2025 14:47:30 +0200 Subject: [PATCH] Leere Strings (item_type = 0) nicht mehr in die DB schreiben Kommentare korrigiert --- Interfaces/ZUGFeRDInterface/PropertyValues.vb | 10 +++++----- Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Interfaces/ZUGFeRDInterface/PropertyValues.vb b/Interfaces/ZUGFeRDInterface/PropertyValues.vb index 352f3256..0040b6d3 100644 --- a/Interfaces/ZUGFeRDInterface/PropertyValues.vb +++ b/Interfaces/ZUGFeRDInterface/PropertyValues.vb @@ -181,7 +181,7 @@ Public Class PropertyValues Try 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("{2} # Unknown error occurred while fetching specification [{0}] in group [{1}]:", oTableColumn, oItem.Value.GroupScope, MessageId) _logger.Warn("ERROR-MESSAGE [{0}]", ex.Message) _logger.Error(ex) oPropertyValueList = New List(Of Object) @@ -200,20 +200,20 @@ Public Class PropertyValues ' This should hopefully show config errors If TypeOf oPropertyValue Is List(Of Object) Then - _logger.Warn("Item with specification [{0}] may be configured incorrectly", oPropertyDescription) + _logger.Warn("Item with specification [{0}] may be configured incorrectly", oTableColumn) oPropertyValue = Nothing End If End Select End If Catch ex As Exception - _logger.Warn("Unknown error occurred while processing specification [{0}]:", oPropertyDescription) + _logger.Warn("Unknown error occurred while processing specification [{0}]:", oTableColumn) _logger.Error(ex) oPropertyValue = Nothing End Try 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) + _logger.Warn("{0} # Specification [{1}] is empty, but marked as required! Skipping.", MessageId, oTableColumn) Dim oMissingProperty = New MissingProperty With { .Description = oPropertyDescription, @@ -222,7 +222,7 @@ Public Class PropertyValues oResult.MissingProperties.Add(oMissingProperty) Continue For Else - _logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oPropertyDescription) + _logger.Debug("{0} # oPropertyValue for specification [{1}] is empty or not found. Skipping.", MessageId, oTableColumn) Continue For End If diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index d52bb6bf..f495b563 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -1157,6 +1157,12 @@ Public Class ImportZUGFeRDFiles Continue For End If + ' ItemType = 0 (normale texte) dürfen nicht leer sein + If oProperty.ItemType = 0 And oProperty.Value.IsNullOrEmpty Then + _logger.Debug("No Mapping for Property [{0}] with empty value, because of ItemType = 0.", oProperty.TableColumn) + Continue For + End If + ' If GroupCounter is -1, it means this is a default property that can only occur once. ' Set the actual inserted value to 0 Dim oGroupCounterValue As Integer = oProperty.GroupCounter