Modules.Jobs: XML_PATH aus Tabelle in Objekt laden, und Wert weiterreichen und in Ablehnungsmail verwenden
This commit is contained in:
parent
237cad3a7a
commit
c52c00ac04
@ -1,5 +1,6 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.IO
|
||||
Imports DigitalData.Modules.Interfaces.PropertyValues
|
||||
Imports DigitalData.Modules.Interfaces.ZUGFeRDInterface
|
||||
|
||||
Public Class Exceptions
|
||||
@ -7,9 +8,9 @@ Public Class Exceptions
|
||||
Inherits ApplicationException
|
||||
|
||||
Public ReadOnly File As FileInfo
|
||||
Public ReadOnly MissingProperties As List(Of String)
|
||||
Public ReadOnly MissingProperties As List(Of MissingProperty)
|
||||
|
||||
Public Sub New(pFile As FileInfo, pMissingProperties As List(Of String))
|
||||
Public Sub New(pFile As FileInfo, pMissingProperties As List(Of MissingProperty))
|
||||
MyBase.New($"Missing values in [{pFile.Name}]")
|
||||
|
||||
Me.File = pFile
|
||||
|
||||
@ -7,6 +7,7 @@ Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Jobs.ImportZUGFeRDFiles
|
||||
Imports System.Data.SqlClient
|
||||
Imports FirebirdSql.Data
|
||||
Imports DigitalData.Modules.Interfaces.PropertyValues
|
||||
|
||||
Namespace ZUGFeRD
|
||||
Public Class EmailFunctions
|
||||
@ -274,7 +275,7 @@ Namespace ZUGFeRD
|
||||
Return oRandomValue
|
||||
End Function
|
||||
|
||||
Public Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of String)) As String
|
||||
Public Function CreateBodyForMissingProperties(OriginalFilename As String, MissingProperties As List(Of MissingProperty)) As String
|
||||
Dim oBody = String.Format(EmailStrings.EMAIL_MISSINGPROPERTIES_1, OriginalFilename)
|
||||
|
||||
If MissingProperties.Count > 0 Then
|
||||
@ -283,7 +284,7 @@ Namespace ZUGFeRD
|
||||
oBody &= $"{vbNewLine}{vbNewLine}"
|
||||
|
||||
For Each prop In MissingProperties
|
||||
oBody &= $"- {prop}"
|
||||
oBody &= $"- {prop.Description}"
|
||||
Next
|
||||
End If
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Interfaces.Exceptions
|
||||
Imports DigitalData.Modules.Interfaces.PropertyValues
|
||||
Imports DigitalData.Modules.Jobs.Exceptions
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
@ -82,7 +83,7 @@ Public Class ImportZUGFeRDFiles
|
||||
|
||||
Public Sub Start(Arguments As Object) Implements IJob.Start
|
||||
Dim oArgs As WorkerArgs = Arguments
|
||||
Dim oPropertyExtractor = New PropertyValues(_logConfig)
|
||||
'Dim oPropertyExtractor = New PropertyValues(_logConfig)
|
||||
Dim oAttachmentExtractor = New PDFEmbeds(_logConfig)
|
||||
|
||||
_EmailOutAccountId = oArgs.EmailOutProfileId
|
||||
@ -314,7 +315,7 @@ Public Class ImportZUGFeRDFiles
|
||||
|
||||
Dim oMissingFieldList As String = ""
|
||||
For Each oMissingFieldDescription In ex.MissingProperties
|
||||
oMissingFieldList += $"<li>{oMissingFieldDescription}</li>"
|
||||
oMissingFieldList += $"<li>{oMissingFieldDescription.Description}<br/><em>{oMissingFieldDescription.XMLPath}</em></li>"
|
||||
Next
|
||||
|
||||
Dim oOrgFilename = _hash.GetOriginalFilename(ex.File.Name)
|
||||
@ -459,7 +460,6 @@ Public Class ImportZUGFeRDFiles
|
||||
Private Function ProcessFile(pMessageId As String, pEmailData As EmailData, pZugferdFiles As Integer, oFile As FileInfo, oConnections As DatabaseConnections, pArgs As WorkerArgs) As ProcessFileResult
|
||||
Dim oDocument As ZUGFeRDInterface.ZugferdResult
|
||||
Dim oResult As New ProcessFileResult()
|
||||
Dim oMissingProperties As New List(Of String)
|
||||
|
||||
' Only pdf files are allowed from here on
|
||||
If Not oFile.Name.ToUpper.EndsWith(".PDF") Then
|
||||
@ -544,7 +544,6 @@ Public Class ImportZUGFeRDFiles
|
||||
|
||||
If oCheckResult.MissingProperties.Count > 0 Then
|
||||
_logger.Warn("[{0}] missing properties found. Exiting.", oCheckResult.MissingProperties.Count)
|
||||
oMissingProperties = oCheckResult.MissingProperties
|
||||
Throw New MissingValueException(oFile, oCheckResult.MissingProperties)
|
||||
Else
|
||||
_logger.Debug("No missing properties found. Continuing.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user