From 2c675b6181f859d5e5e88d813a676058266d16df Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 19 Jun 2019 11:58:11 +0200 Subject: [PATCH] fix split bug in propertyvalues, remove obsolete functions --- Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb | 40 ------------------------- Jobs/EDMI/ZUGFeRD/PropertyValues.vb | 6 +--- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb index cb7aabbd..1942f890 100644 --- a/Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -333,46 +333,6 @@ Public Class ImportZUGFeRDFiles End If Next - ' check for rows that are empty in every column - ' this happens when a grouped row is not filled - ' e.g. a row in a invoice that is just a note - _logger.Debug("Done Fetching Property values.") - Dim oIndexesToRemove As New List(Of Integer) - - For oRowIndex = 0 To oRowCount - 1 - Dim oColumnIsEmpty = False - - For Each oRow In oPropertyList - Dim oValue As List(Of Object) = oRow.Value - 'Dim oValue As List(Of Object) = oRow.Value.Item(oRowIndex) - oColumnIsEmpty = oValue.Count = 0 - Next - - If oColumnIsEmpty Then - oIndexesToRemove.Add(oRowIndex) - End If - Next - - _logger.Debug("Removing {0} empty rows.", oIndexesToRemove) - - - ' order indexes to remove descending to avoid indexOutOfRange errors - If oIndexesToRemove.Count > 0 Then - oIndexesToRemove = oIndexesToRemove. - OrderByDescending(Function(oIndex) oIndex). - ToList() - End If - - ' now remove all empty rows. - For Each oIndex In oIndexesToRemove - For Each oRow In oPropertyList - oRow.Value.RemoveAt(oIndex) - Next - Next - - ' decrease row count by rows removed - oRowCount -= oIndexesToRemove.Count - ' Structure of oPropertyList ' [ # Propertyname # Row 1 # Row 2 ' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...], diff --git a/Jobs/EDMI/ZUGFeRD/PropertyValues.vb b/Jobs/EDMI/ZUGFeRD/PropertyValues.vb index f8065f3c..31c6bfc6 100644 --- a/Jobs/EDMI/ZUGFeRD/PropertyValues.vb +++ b/Jobs/EDMI/ZUGFeRD/PropertyValues.vb @@ -60,7 +60,7 @@ Public Class PropertyValues If IsArray(Obj) And Not oHasIndex Then Dim oCurrentPart As String = oPart - Dim oSplitString As String() = New String() {"." & oCurrentPart & "."} + Dim oSplitString As String() = New String() {oCurrentPart & "."} Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None) Dim oResults As New List(Of Object) @@ -72,10 +72,6 @@ Public Class PropertyValues For Each oArrayItem In Obj Dim oResult As List(Of Object) = GetPropValue(oArrayItem, oPathFragments(1)) - 'If Not IsNothing(oResult) AndAlso oResult.Count > 0 Then - ' oResults.Add(oResult.Item(0)) - 'End If - If Not IsNothing(oResult) Then oResults.Add(oResult) End If