6 Commits

Author SHA1 Message Date
Jonathan Jenne
3825f7e065 Jobs: Version 1.7.4 2021-07-20 14:04:56 +02:00
Jonathan Jenne
5655ccd445 Jobs/ZUGFeRD: Include original subject in rejection emails, show original filename in FileSizeLimitReachedException 2021-07-20 14:04:45 +02:00
Jonathan Jenne
dd6a215a11 Jobs: Version 1.7.3 2021-07-20 13:37:18 +02:00
Jonathan Jenne
d5fb5723ce Jobs/ZUGFeRD: fix email strings 2021-07-20 13:37:02 +02:00
Jonathan Jenne
623309cd44 ZUGFeRDService: Improve logging of custom options 2021-07-20 13:21:25 +02:00
Jonathan Jenne
b323445821 Jobs: Change Email Text for Filesize Exceeded 2021-07-20 13:21:04 +02:00
6 changed files with 30 additions and 9 deletions

View File

@@ -77,7 +77,10 @@ Public Class EmailFunctions
Dim oCreatedWho = "ZUGFeRD Service"
Dim oMaskedBodyText = BodyText.Replace("'", "''")
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, oMaskedBodyText)
Dim oSubjectBodyText = String.Format(EmailStrings.EMAIL_SUBJECT_TEXT, pEmailData.Subject).Replace("'", "''")
Dim oCompleteBodyText = oMaskedBodyText & oSubjectBodyText
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT, oCompleteBodyText)
Dim oEmailAddress = pEmailData.From
Dim oAttachment = pEmailData.Attachment

View File

@@ -4,6 +4,7 @@
das WISAG-Portal zur Verarbeitung der Eingangsrechnungen im ZUGFeRD-Format konnte die von Ihnen gesandte Rechnung
leider nicht verarbeiten! <br><br> Grund: {0}<p>Bitte prüfen Sie die Datei und nehmen Sie bei Bedarf mit uns Kontakt auf.<p>
Vielen Dank für Ihr Verständnis.<br>Mit freundlichen Grüßen<br>Ihre IT-Abteilung</body></html>"
Public Const EMAIL_SUBJECT_TEXT = "<p>Der Betreff der Original-Email war: <em>{0}</em></p>"
Public Const EMAIL_SUBJECT_REJECTED = "WISAG ZUGFeRD Portal: Beleg abgelehnt"
Public Const EMAIL_SUBJECT_EXCEPTION = "WISAG ZUGFeRD Portal: Unbehandelte Ausnahme"
@@ -23,12 +24,17 @@
Public Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine ZUGFeRD-Dokumente.</p>"
Public Const EMAIL_FILE_SIZE_REACHED = "<p>Ihre Email enthielt Dateien, die die erlaubte Größe von {0}MB überschreiten.</p>"
Public Const EMAIL_FILE_SIZE_REACHED = "
<p>Die von Ihnen gesendete Rechnung oder einer der Rechnungs-Anhänge überschreiten die erlaubte Größe von <strong>{0} MB</strong>.</p>
<p>Die folgende Datei hat die erlaubte Größe überschritten:<ul>
<li>{1}</li>
</ul></p>
"
Public Const EMAIL_INVALID_DOCUMENT = """
Public Const EMAIL_INVALID_DOCUMENT = "
<p>Ihre Email enthielt ein ZUGFeRD Dokument, welches aber inkorrekt formatiert wurde.</p>
<p>Mögliche Gründe für ein inkorrektes Format:<ul>
<li>Betrags-Werte weisen ungültiges Format auf (25,01 anstatt 25.01)</li>
</ul></p>
"""
"
End Class

View File

@@ -407,9 +407,14 @@ Public Class ImportZUGFeRDFiles
Create_HistoryEntry(oMessageId, oMD5CheckSum, "REJECTED - File size limit reached", oFBTransaction)
Dim oBody = String.Format(EmailStrings.EMAIL_FILE_SIZE_REACHED, oArgs.MaxAttachmentSizeInMegaBytes)
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
Dim oKey = FileSizeLimitReachedException.KEY_FILENAME
Dim oFileExceedingThreshold As String = IIf(ex.Data.Contains(oKey), ex.Data.Item(oKey), "")
Dim oFileWithoutMessageId = oFileExceedingThreshold.Replace(oMessageId, "")
Dim oBody = String.Format(EmailStrings.EMAIL_FILE_SIZE_REACHED, oArgs.MaxAttachmentSizeInMegaBytes, oFileExceedingThreshold)
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "FileSizeLimitReachedException", _EmailOutAccountId)
AddRejectedState(oMessageId, "FileSizeLimitReachedException", "Erlaubte Dateigröße überschritten", "", oSQLTransaction)
@@ -767,6 +772,7 @@ Public Class ImportZUGFeRDFiles
''' <returns></returns>
Private Function Check_FileSize(pFileInfo As FileInfo, pMaxFileSizeInMegaBytes As Integer) As Boolean
_logger.Info("Checking Filesize of {0}", pFileInfo.Name)
_logger.Debug("Filesize threshold is {0} MB.", pMaxFileSizeInMegaBytes)
If pMaxFileSizeInMegaBytes <= 0 Then
_logger.Debug("Filesize is not configured. Skipping check.")
@@ -775,8 +781,6 @@ Public Class ImportZUGFeRDFiles
Dim oMaxSize = pMaxFileSizeInMegaBytes * 1024 * 1024
_logger.Debug("Filesize threshold is {0} bytes.", oMaxSize)
If oMaxSize > 0 And pFileInfo.Length > oMaxSize Then
_logger.Debug("Filesize is bigger than threshold. Rejecting.")
Return False

View File

@@ -24,8 +24,11 @@ Public Class Exceptions
Public Class FileSizeLimitReachedException
Inherits ApplicationException
Public Const KEY_FILENAME = "FILENAME"
Public Sub New(pFilePath As String, pFileSizeLimitInMegaBytes As Integer)
MyBase.New($"At least one file exceeded the filesize limit of {pFileSizeLimitInMegaBytes}MB: {pFilePath}")
Data.Add(KEY_FILENAME, pFilePath)
End Sub
End Class

View File

@@ -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:
<Assembly: AssemblyVersion("1.7.2.0")>
<Assembly: AssemblyFileVersion("1.7.2.0")>
<Assembly: AssemblyVersion("1.7.4.0")>
<Assembly: AssemblyFileVersion("1.7.4.0")>

View File

@@ -63,6 +63,11 @@ Public Class ThreadRunner
oArgs.InsertIntoSQLServer = True
End If
_logger.Debug("Custom Options:")
_logger.Debug("ExceptionEmailAddress: {0}", oArgs.ExceptionEmailAddress)
_logger.Debug("IgnoreRejectionStatus: {0}", oArgs.IgnoreRejectionStatus)
_logger.Debug("MaxAttachmentSizeInMegaBytes: {0}", oArgs.MaxAttachmentSizeInMegaBytes)
_jobArguments = oArgs
_logger.Debug("Checking SuccessDirectory {0}", oArgs.SuccessDirectory)