MS MergeCommit

This commit is contained in:
Developer01 2025-02-12 14:11:10 +01:00
commit 54ee51b0de
3 changed files with 33 additions and 12 deletions

View File

@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("Modules.Interfaces")>
<Assembly: AssemblyCopyright("Copyright © 2025")>
<Assembly: AssemblyTrademark("2.2.1.0")>
<Assembly: AssemblyTrademark("2.2.2.0")>
<Assembly: ComVisible(False)>
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.2.1.0")>
<Assembly: AssemblyFileVersion("2.2.1.0")>
<Assembly: AssemblyVersion("2.2.2.0")>
<Assembly: AssemblyFileVersion("2.2.2.0")>

View File

@ -32,6 +32,9 @@ Public Class ZUGFeRDInterface
Public Const XMLSCHEMA_PEPPOL_3017_INVOICE = "Version3017_INVOICE"
Public Const XMLSCHEMA_PEPPOL_3017_CREDITNOTE = "Version3017_CREDITNOTE"
Public Const RECEIPT_TYPE_XML = "XML"
Public Const RECEIPT_TYPE_PDF = "PDF"
Private ReadOnly ValidFilenames As New List(Of String) From {
PDFEmbeds.ZUGFERD_XML_FILENAME.ToUpper,
PDFEmbeds.FACTUR_X_XML_FILENAME_DE.ToUpper,
@ -67,6 +70,10 @@ Public Class ZUGFeRDInterface
Public Property SchemaObject As Object
Public Property Specification As String
Public Property UsedXMLSchema As String
''' <summary>
''' Dateityp des Belegs: PDF oder XML
''' </summary>
Public Property ReceiptFileType As String
Public Property ValidationErrors As New List(Of ZugferdValidationError)
End Class

View File

@ -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
@ -551,6 +551,7 @@ Public Class ImportZUGFeRDFiles
End Try
Try
oDocument.ReceiptFileType = ZUGFeRDInterface.RECEIPT_TYPE_XML
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
Catch ex As Exception
Throw ex
@ -640,6 +641,7 @@ Public Class ImportZUGFeRDFiles
End If
Try
oDocument.ReceiptFileType = ZUGFeRDInterface.RECEIPT_TYPE_PDF
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
Catch ex As Exception
Throw ex
@ -679,7 +681,7 @@ Public Class ImportZUGFeRDFiles
End If
' DataTable vorbereiten
Dim oDataTable As DataTable = FillDataTable(pMessageId, oCheckResult, pDocument.Specification, pDocument.UsedXMLSchema)
Dim oDataTable As DataTable = FillDataTable(pMessageId, oCheckResult, pDocument)
' ColumnList initialisieren
Dim oColumnNames As List(Of String) = New List(Of String) From {
@ -702,7 +704,7 @@ Public Class ImportZUGFeRDFiles
Return True
End Function
Private Function FillDataTable(pMessageId As String, pCheckResult As PropertyValues.CheckPropertyValuesResult, pSpecification As String, pUsedXMLSchema As String) As DataTable
Private Function FillDataTable(pMessageId As String, pCheckResult As PropertyValues.CheckPropertyValuesResult, pDocument As ZUGFeRDInterface.ZugferdResult) As DataTable
Dim oDataTable As DataTable = New DataTable()
oDataTable.Columns.Add(New DataColumn("REFERENCE_GUID", GetType(String)))
@ -716,26 +718,38 @@ Public Class ImportZUGFeRDFiles
Dim oFirstRow As DataRow = oDataTable.NewRow()
oFirstRow("REFERENCE_GUID") = pMessageId
oFirstRow("ITEM_DESCRIPTION") = "ZUGFeRDSpezifikation"
oFirstRow("ITEM_VALUE") = pSpecification
oFirstRow("ITEM_VALUE") = pDocument.Specification
oFirstRow("GROUP_COUNTER") = 0
oFirstRow("SPEC_NAME") = "ZUGFERD_SPECIFICATION"
oFirstRow("IS_REQUIRED") = False
_logger.Debug("Mapping Property [ZUGFERD_SPECIFICATION] with value [{0}]", pSpecification)
_logger.Debug("Mapping Property [ZUGFERD_SPECIFICATION] with value [{0}]", pDocument.Specification)
oDataTable.Rows.Add(oFirstRow)
' Zweite Zeile enthält das verwendete XML Schema
Dim oSecondRow As DataRow = oDataTable.NewRow()
oSecondRow("REFERENCE_GUID") = pMessageId
oSecondRow("ITEM_DESCRIPTION") = "ZUGFeRDXMLSchema"
oSecondRow("ITEM_VALUE") = pUsedXMLSchema
oSecondRow("ITEM_VALUE") = pDocument.UsedXMLSchema
oSecondRow("GROUP_COUNTER") = 0
oSecondRow("SPEC_NAME") = "ZUGFERD_XML_SCHEMA"
oSecondRow("IS_REQUIRED") = False
_logger.Debug("Mapping Property [ZUGFERD_XML_SCHEMA] with value [{0}]", pUsedXMLSchema)
_logger.Debug("Mapping Property [ZUGFERD_XML_SCHEMA] with value [{0}]", pDocument.UsedXMLSchema)
oDataTable.Rows.Add(oSecondRow)
' Dritte Zeile enthält das verwendete Datei-Format des Belegs (PDF/XML)
Dim oThirdRow As DataRow = oDataTable.NewRow()
oThirdRow("REFERENCE_GUID") = pMessageId
oThirdRow("ITEM_DESCRIPTION") = "ReceiptFileType"
oThirdRow("ITEM_VALUE") = pDocument.ReceiptFileType
oThirdRow("GROUP_COUNTER") = 0
oThirdRow("SPEC_NAME") = "RECEIPT_FILE_TYPE"
oThirdRow("IS_REQUIRED") = False
_logger.Debug("Mapping Property [RECEIPT_FILE_TYPE] with value [{0}]", pDocument.ReceiptFileType)
oDataTable.Rows.Add(oThirdRow)
For Each oProperty In pCheckResult.ValidProperties
' If GroupCounter is -1, it means this is a default property that can only occur once.