diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index 7b993cec..3de68633 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -406,8 +406,8 @@ Public Class ImportZUGFeRDFiles End If Finally + Dim oxRechnungHandle As Boolean = False Try - Dim oxRechnungHandle As Boolean = False Dim oRegularMove As Boolean = False ' If an application error occurred, dont move files so they will be processed again later If oMoveDirectory = DIRECTORY_DONT_MOVE Then @@ -426,7 +426,7 @@ Public Class ImportZUGFeRDFiles MyTemplateValues_xInvDT = _mssql.GetDatatable(oSQL_MsgIDReplace) If Not IsNothing(MyTemplateValues_xInvDT) Then - If MyTemplateValues_xInvDT.rows.count > 0 Then + If MyTemplateValues_xInvDT.Rows.Count > 0 Then Dim oViewReceiptFileInfo As FileInfo = _xRechnungCreator.Create_PDFfromXML(oEInvoiceFileGroup.Item(0), MyTemplateValues_xInvDT) If Not IsNothing(oViewReceiptFileInfo) Then oEInvoiceFileGroup.Item(0) = oViewReceiptFileInfo @@ -463,7 +463,7 @@ Public Class ImportZUGFeRDFiles ' finally commit all changes To the Database ' ================================================================== If oIsSuccess Or oExpectedError Then - If oSQLTransaction IsNot Nothing Then + If oxRechnungHandle = False AndAlso oSQLTransaction IsNot Nothing Then ' Commit Transaction oSQLTransaction.Commit() End If