diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index d68b4348..515e5da8 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -279,6 +279,14 @@ Public Class ImportZUGFeRDFiles End Select End Try + ' Check if there are more than one ZUGFeRD files + If oZUGFeRDCount = 1 Then + Throw New TooMuchFerdsException() + End If + + ' Since extraction went well, increase the amount of ZUGFeRD files + oZUGFeRDCount += 1 + ' Extract all attachments with the extensions specified in `AllowedExtensions`. ' If you need to extract and use embedded xml files, you need to filter out the zugferd-invoice.xml yourself. ' Right now the zugferd-invoice.xml is filtered out because `AllowedExtensions` does not contain `xml`. @@ -292,14 +300,6 @@ Public Class ImportZUGFeRDFiles ' Check the Checksum and rejection status oMD5CheckSum = GenerateAndCheck_MD5Sum(oFile.FullName, oArgs.IgnoreRejectionStatus) - ' Check if there are more than one ZUGFeRD files - If oZUGFeRDCount = 1 Then - Throw New TooMuchFerdsException() - End If - - ' Since extraction went well, increase the amount of ZUGFeRD files - oZUGFeRDCount += 1 - ' Check the document against the configured property map and return: ' - a List of valid properties ' - a List of missing properties