Modules: Speichern des Dateityps des Belegs in den EDMI_ITEM_DATA
This commit is contained in:
parent
83c2374b90
commit
5290d442f9
@ -32,6 +32,9 @@ Public Class ZUGFeRDInterface
|
|||||||
Public Const XMLSCHEMA_PEPPOL_3017_INVOICE = "Version3017_INVOICE"
|
Public Const XMLSCHEMA_PEPPOL_3017_INVOICE = "Version3017_INVOICE"
|
||||||
Public Const XMLSCHEMA_PEPPOL_3017_CREDITNOTE = "Version3017_CREDITNOTE"
|
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 {
|
Private ReadOnly ValidFilenames As New List(Of String) From {
|
||||||
PDFEmbeds.ZUGFERD_XML_FILENAME.ToUpper,
|
PDFEmbeds.ZUGFERD_XML_FILENAME.ToUpper,
|
||||||
PDFEmbeds.FACTUR_X_XML_FILENAME_DE.ToUpper,
|
PDFEmbeds.FACTUR_X_XML_FILENAME_DE.ToUpper,
|
||||||
@ -67,6 +70,10 @@ Public Class ZUGFeRDInterface
|
|||||||
Public Property SchemaObject As Object
|
Public Property SchemaObject As Object
|
||||||
Public Property Specification As String
|
Public Property Specification As String
|
||||||
Public Property UsedXMLSchema 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)
|
Public Property ValidationErrors As New List(Of ZugferdValidationError)
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
@ -551,6 +551,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
oDocument.ReceiptFileType = ZUGFeRDInterface.RECEIPT_TYPE_XML
|
||||||
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
|
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Throw ex
|
Throw ex
|
||||||
@ -640,6 +641,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
oDocument.ReceiptFileType = ZUGFeRDInterface.RECEIPT_TYPE_PDF
|
||||||
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
|
Dim sqlResult As Boolean = StoreXMLItemsInDatabase(pMessageId, oDocument, pFile, pConnections, pArgs)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Throw ex
|
Throw ex
|
||||||
@ -679,7 +681,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' DataTable vorbereiten
|
' DataTable vorbereiten
|
||||||
Dim oDataTable As DataTable = FillDataTable(pMessageId, oCheckResult, pDocument.Specification, pDocument.UsedXMLSchema)
|
Dim oDataTable As DataTable = FillDataTable(pMessageId, oCheckResult, pDocument)
|
||||||
|
|
||||||
' ColumnList initialisieren
|
' ColumnList initialisieren
|
||||||
Dim oColumnNames As List(Of String) = New List(Of String) From {
|
Dim oColumnNames As List(Of String) = New List(Of String) From {
|
||||||
@ -702,7 +704,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
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()
|
Dim oDataTable As DataTable = New DataTable()
|
||||||
oDataTable.Columns.Add(New DataColumn("REFERENCE_GUID", GetType(String)))
|
oDataTable.Columns.Add(New DataColumn("REFERENCE_GUID", GetType(String)))
|
||||||
@ -716,26 +718,38 @@ Public Class ImportZUGFeRDFiles
|
|||||||
Dim oFirstRow As DataRow = oDataTable.NewRow()
|
Dim oFirstRow As DataRow = oDataTable.NewRow()
|
||||||
oFirstRow("REFERENCE_GUID") = pMessageId
|
oFirstRow("REFERENCE_GUID") = pMessageId
|
||||||
oFirstRow("ITEM_DESCRIPTION") = "ZUGFeRDSpezifikation"
|
oFirstRow("ITEM_DESCRIPTION") = "ZUGFeRDSpezifikation"
|
||||||
oFirstRow("ITEM_VALUE") = pSpecification
|
oFirstRow("ITEM_VALUE") = pDocument.Specification
|
||||||
oFirstRow("GROUP_COUNTER") = 0
|
oFirstRow("GROUP_COUNTER") = 0
|
||||||
oFirstRow("SPEC_NAME") = "ZUGFERD_SPECIFICATION"
|
oFirstRow("SPEC_NAME") = "ZUGFERD_SPECIFICATION"
|
||||||
oFirstRow("IS_REQUIRED") = False
|
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)
|
oDataTable.Rows.Add(oFirstRow)
|
||||||
|
|
||||||
' Zweite Zeile enthält das verwendete XML Schema
|
' Zweite Zeile enthält das verwendete XML Schema
|
||||||
Dim oSecondRow As DataRow = oDataTable.NewRow()
|
Dim oSecondRow As DataRow = oDataTable.NewRow()
|
||||||
oSecondRow("REFERENCE_GUID") = pMessageId
|
oSecondRow("REFERENCE_GUID") = pMessageId
|
||||||
oSecondRow("ITEM_DESCRIPTION") = "ZUGFeRDXMLSchema"
|
oSecondRow("ITEM_DESCRIPTION") = "ZUGFeRDXMLSchema"
|
||||||
oSecondRow("ITEM_VALUE") = pUsedXMLSchema
|
oSecondRow("ITEM_VALUE") = pDocument.UsedXMLSchema
|
||||||
oSecondRow("GROUP_COUNTER") = 0
|
oSecondRow("GROUP_COUNTER") = 0
|
||||||
oSecondRow("SPEC_NAME") = "ZUGFERD_XML_SCHEMA"
|
oSecondRow("SPEC_NAME") = "ZUGFERD_XML_SCHEMA"
|
||||||
oSecondRow("IS_REQUIRED") = False
|
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)
|
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
|
For Each oProperty In pCheckResult.ValidProperties
|
||||||
|
|
||||||
' If GroupCounter is -1, it means this is a default property that can only occur once.
|
' If GroupCounter is -1, it means this is a default property that can only occur once.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user