diff --git a/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb b/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb index fdf6e348..11914534 100644 --- a/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Modules.Jobs/EDMI/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -698,7 +698,7 @@ Public Class ImportZUGFeRDFiles ' Close the connection oConnection.Close() If Message.Contains("REJECTED") Then - oSQL = $"UPDATE TBEMLP_HISTORY SET COMMENT = '{Message}', CUST_REJECTED = 1,CUST_REJECTED_WHEN = GETDATE() WHERE EMAIL_MSGID = '{MessageId}'" + oSQL = $"UPDATE TBEMLP_HISTORY SET STATUS = 'REJECTED', COMMENT = '{Message}', CUST_REJECTED = 1,CUST_REJECTED_WHEN = GETDATE() WHERE EMAIL_MSGID = '{MessageId}'" _mssql.ExecuteNonQuery(oSQL) End If @@ -780,7 +780,7 @@ Public Class ImportZUGFeRDFiles oRejected = False End Try - + _logger.Info("File has already been processed...") ' If the file was already rejected, it is allowed to be processed again, ' even if the Checksum exists in the history entries (default case) ' Which means, if it was not rejected before, it will be rejected in any case! @@ -788,13 +788,10 @@ Public Class ImportZUGFeRDFiles ' This logic can be overwritten by the IgnoreRejectionStatus parameter. ' If it is set to true, the file will be rejected if the file exists in the history entries, ' regardless of the rejected parameter. - If oRejected = False Or pIgnoreRejectionStatus = True Then - Throw New MD5HashException($"There is already an identical invoice! - HistoryID [{oHistoryId}]") - - Else - _logger.Info("File has already been processed") + If oRejected = True And pIgnoreRejectionStatus = True Then _logger.Info("ZuGFeRDFile already has been processed, but formerly obviously was rejected!") - + Else + Throw New MD5HashException($"There is already an identical invoice! - HistoryID [{oHistoryId}]") End If Return oMD5CheckSum diff --git a/Modules.Jobs/My Project/AssemblyInfo.vb b/Modules.Jobs/My Project/AssemblyInfo.vb index 7b2f2d59..a6872d43 100644 --- a/Modules.Jobs/My Project/AssemblyInfo.vb +++ b/Modules.Jobs/My Project/AssemblyInfo.vb @@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices ' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern ' übernehmen, indem Sie "*" eingeben: - - + + diff --git a/Services.ZUGFeRDService/My Project/AssemblyInfo.vb b/Services.ZUGFeRDService/My Project/AssemblyInfo.vb index 1dd7dff9..a81fb414 100644 --- a/Services.ZUGFeRDService/My Project/AssemblyInfo.vb +++ b/Services.ZUGFeRDService/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Services.ZUGFeRDService/ThreadRunner.vb b/Services.ZUGFeRDService/ThreadRunner.vb index 8a969115..b4d3f49f 100644 --- a/Services.ZUGFeRDService/ThreadRunner.vb +++ b/Services.ZUGFeRDService/ThreadRunner.vb @@ -140,7 +140,7 @@ Public Class ThreadRunner Private Sub DoWork(sender As Object, e As DoWorkEventArgs) Handles _workerThread.DoWork Try Try - Dim oSQL = "SELECT [EMAIL_MSGID] FROM TBEMLP_HISTORY WHERE STATUS = 'REJECTED' and DATEDIFF(DAY,CHANGED_WHEN,GETDATE()) <= 5 order by guid desc" + Dim oSQL = "SELECT [EMAIL_MSGID] FROM TBEMLP_HISTORY WHERE (STATUS = 'REJECTED' OR CUST_REJECTED = 1) and DATEDIFF(DAY,CHANGED_WHEN,GETDATE()) <= 2 order by guid desc" Dim oDT As DataTable = _mssql.GetDatatable(oSQL) If Not IsNothing(oDT) Then For Each oROW As DataRow In oDT.Rows