From 39a406bfafc21acaee41dbec2d5d1dbb8251b47e Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 26 Jun 2023 14:50:07 +0200 Subject: [PATCH] Fix incorrect error message with more than one valid zugferd invoice --- Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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