Compare commits
6 Commits
662c3f3ed4
...
3825f7e065
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3825f7e065 | ||
|
|
5655ccd445 | ||
|
|
dd6a215a11 | ||
|
|
d5fb5723ce | ||
|
|
623309cd44 | ||
|
|
b323445821 |
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user