diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index d572f28f..368ee941 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -412,7 +412,10 @@ Public Class ImportZUGFeRDFiles ' If an application error occurred, dont move files so they will be processed again later If oMoveDirectory = DIRECTORY_DONT_MOVE Then _logger.Info("Application Error occurred. Files for message Id {0} will not be moved.", oMessageId) + ElseIf oArgs.AllowXRechnung And oIsSuccess And oEInvoiceFileGroup.Item(0).Extension = ".xml" Then + _logger.Debug("Before Creating the PDF-File from XML data / Before Commit") + oxRechnungHandle = True ' Hier das neue PDF erzeugen 'but before we need to get all Data we need @@ -422,6 +425,7 @@ Public Class ImportZUGFeRDFiles If oSQLTransaction IsNot Nothing Then ' Commit Transaction oSQLTransaction.Commit() + _logger.Debug("XML commit triggered") End If MyTemplateValues_xInvDT = _mssql.GetDatatable(oSQL_MsgIDReplace) @@ -463,9 +467,13 @@ Public Class ImportZUGFeRDFiles ' finally commit all changes To the Database ' ================================================================== If oIsSuccess Or oExpectedError Then + + _logger.Debug("Before default sql commit: oxRechnungHandle [{0}]", oxRechnungHandle) + If oxRechnungHandle = False AndAlso oSQLTransaction IsNot Nothing Then ' Commit Transaction oSQLTransaction.Commit() + _logger.Debug("default commit triggered") End If End If Catch ex As Exception @@ -475,6 +483,7 @@ Public Class ImportZUGFeRDFiles Try If oSQLConnection IsNot Nothing Then + _logger.Debug("Before default sql close") oSQLConnection.Close() End If Catch ex As Exception diff --git a/Jobs/ZUGFeRD/XRechnungViewDocument.vb b/Jobs/ZUGFeRD/XRechnungViewDocument.vb index dbebb28e..da06bb87 100644 --- a/Jobs/ZUGFeRD/XRechnungViewDocument.vb +++ b/Jobs/ZUGFeRD/XRechnungViewDocument.vb @@ -1,11 +1,9 @@ Imports System.Collections.Generic Imports System.Data -Imports System.Data.SqlClient Imports System.IO Imports DigitalData.Modules.Base Imports DigitalData.Modules.Database Imports DigitalData.Modules.Logging -Imports FirebirdSql.Data Imports GdPicture14 Public Class XRechnungViewDocument @@ -27,6 +25,9 @@ Public Class XRechnungViewDocument _gdpictureLicenseKey = GDPictureLicenseKey End Sub Public Function Create_PDFfromXML(oxmlFile As FileInfo, pDTItemValues As DataTable) As FileInfo + + _logger.Debug("Create_PDFfromXML() Start") + Try Dim oXRechnungFile = oxmlFile.FullName Dim oNewFileinfo As FileInfo @@ -274,8 +275,11 @@ Public Class XRechnungViewDocument If oPDFStatus = GdPictureStatus.OK Then File.Delete(oXRechnungFile) oNewFileinfo = New FileInfo(oOutputPath) + + _logger.Debug("Create_PDFfromXML() End successfully") Return oNewFileinfo Else + _logger.Debug("Create_PDFfromXML() Ends with nothing") Return Nothing End If @@ -284,6 +288,7 @@ Public Class XRechnungViewDocument Return Nothing End Try End Function + Public Function Create_PageHeader(pFollowPage As Boolean) As Integer 'Draw content on the PDF Dim yPosition As Integer = 15 @@ -300,11 +305,13 @@ Public Class XRechnungViewDocument MyGDPicturePDF.DrawText(fontResNameItalic, 10, yPosition, XRechnungStrings.CommentSichtbeleg_EN_Row2) Return yPosition End Function - Public Function Create_PageFooter() + + Public Sub Create_PageFooter() MyGDPicturePDF.DrawLine(10, 280, 200, 280) Dim oCreatedString = $"Maschinell erstellt durch / Automatically created by Digital Data E-Rechnung Parser: {Now.ToString}" MyGDPicturePDF.DrawText(fontResName, 10, 285, oCreatedString) - End Function + End Sub + Private Function Return_InvType(pType As String) As String Dim oReturn As String = "Rechnung/invoice" If pType = "380" Then @@ -325,5 +332,4 @@ Public Class XRechnungViewDocument Return oReturn End Function - End Class