This commit is contained in:
Developer01 2025-02-18 11:00:58 +01:00
commit bf8a2971ec
2 changed files with 20 additions and 5 deletions

View File

@ -412,7 +412,10 @@ Public Class ImportZUGFeRDFiles
' If an application error occurred, dont move files so they will be processed again later ' If an application error occurred, dont move files so they will be processed again later
If oMoveDirectory = DIRECTORY_DONT_MOVE Then If oMoveDirectory = DIRECTORY_DONT_MOVE Then
_logger.Info("Application Error occurred. Files for message Id {0} will not be moved.", oMessageId) _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 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 oxRechnungHandle = True
' Hier das neue PDF erzeugen ' Hier das neue PDF erzeugen
'but before we need to get all Data we need 'but before we need to get all Data we need
@ -422,6 +425,7 @@ Public Class ImportZUGFeRDFiles
If oSQLTransaction IsNot Nothing Then If oSQLTransaction IsNot Nothing Then
' Commit Transaction ' Commit Transaction
oSQLTransaction.Commit() oSQLTransaction.Commit()
_logger.Debug("XML commit triggered")
End If End If
MyTemplateValues_xInvDT = _mssql.GetDatatable(oSQL_MsgIDReplace) MyTemplateValues_xInvDT = _mssql.GetDatatable(oSQL_MsgIDReplace)
@ -463,9 +467,13 @@ Public Class ImportZUGFeRDFiles
' finally commit all changes To the Database ' finally commit all changes To the Database
' ================================================================== ' ==================================================================
If oIsSuccess Or oExpectedError Then If oIsSuccess Or oExpectedError Then
_logger.Debug("Before default sql commit: oxRechnungHandle [{0}]", oxRechnungHandle)
If oxRechnungHandle = False AndAlso oSQLTransaction IsNot Nothing Then If oxRechnungHandle = False AndAlso oSQLTransaction IsNot Nothing Then
' Commit Transaction ' Commit Transaction
oSQLTransaction.Commit() oSQLTransaction.Commit()
_logger.Debug("default commit triggered")
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
@ -475,6 +483,7 @@ Public Class ImportZUGFeRDFiles
Try Try
If oSQLConnection IsNot Nothing Then If oSQLConnection IsNot Nothing Then
_logger.Debug("Before default sql close")
oSQLConnection.Close() oSQLConnection.Close()
End If End If
Catch ex As Exception Catch ex As Exception

View File

@ -1,11 +1,9 @@
Imports System.Collections.Generic Imports System.Collections.Generic
Imports System.Data Imports System.Data
Imports System.Data.SqlClient
Imports System.IO Imports System.IO
Imports DigitalData.Modules.Base Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports FirebirdSql.Data
Imports GdPicture14 Imports GdPicture14
Public Class XRechnungViewDocument Public Class XRechnungViewDocument
@ -27,6 +25,9 @@ Public Class XRechnungViewDocument
_gdpictureLicenseKey = GDPictureLicenseKey _gdpictureLicenseKey = GDPictureLicenseKey
End Sub End Sub
Public Function Create_PDFfromXML(oxmlFile As FileInfo, pDTItemValues As DataTable) As FileInfo Public Function Create_PDFfromXML(oxmlFile As FileInfo, pDTItemValues As DataTable) As FileInfo
_logger.Debug("Create_PDFfromXML() Start")
Try Try
Dim oXRechnungFile = oxmlFile.FullName Dim oXRechnungFile = oxmlFile.FullName
Dim oNewFileinfo As FileInfo Dim oNewFileinfo As FileInfo
@ -274,8 +275,11 @@ Public Class XRechnungViewDocument
If oPDFStatus = GdPictureStatus.OK Then If oPDFStatus = GdPictureStatus.OK Then
File.Delete(oXRechnungFile) File.Delete(oXRechnungFile)
oNewFileinfo = New FileInfo(oOutputPath) oNewFileinfo = New FileInfo(oOutputPath)
_logger.Debug("Create_PDFfromXML() End successfully")
Return oNewFileinfo Return oNewFileinfo
Else Else
_logger.Debug("Create_PDFfromXML() Ends with nothing")
Return Nothing Return Nothing
End If End If
@ -284,6 +288,7 @@ Public Class XRechnungViewDocument
Return Nothing Return Nothing
End Try End Try
End Function End Function
Public Function Create_PageHeader(pFollowPage As Boolean) As Integer Public Function Create_PageHeader(pFollowPage As Boolean) As Integer
'Draw content on the PDF 'Draw content on the PDF
Dim yPosition As Integer = 15 Dim yPosition As Integer = 15
@ -300,11 +305,13 @@ Public Class XRechnungViewDocument
MyGDPicturePDF.DrawText(fontResNameItalic, 10, yPosition, XRechnungStrings.CommentSichtbeleg_EN_Row2) MyGDPicturePDF.DrawText(fontResNameItalic, 10, yPosition, XRechnungStrings.CommentSichtbeleg_EN_Row2)
Return yPosition Return yPosition
End Function End Function
Public Function Create_PageFooter()
Public Sub Create_PageFooter()
MyGDPicturePDF.DrawLine(10, 280, 200, 280) MyGDPicturePDF.DrawLine(10, 280, 200, 280)
Dim oCreatedString = $"Maschinell erstellt durch / Automatically created by Digital Data E-Rechnung Parser: {Now.ToString}" Dim oCreatedString = $"Maschinell erstellt durch / Automatically created by Digital Data E-Rechnung Parser: {Now.ToString}"
MyGDPicturePDF.DrawText(fontResName, 10, 285, oCreatedString) MyGDPicturePDF.DrawText(fontResName, 10, 285, oCreatedString)
End Function End Sub
Private Function Return_InvType(pType As String) As String Private Function Return_InvType(pType As String) As String
Dim oReturn As String = "Rechnung/invoice" Dim oReturn As String = "Rechnung/invoice"
If pType = "380" Then If pType = "380" Then
@ -325,5 +332,4 @@ Public Class XRechnungViewDocument
Return oReturn Return oReturn
End Function End Function
End Class End Class