merge vers
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
|
||||
Imports System.Globalization
|
||||
Imports System.Net
|
||||
Imports System.Runtime.Serialization
|
||||
Imports System.Xml
|
||||
Imports DocumentFormat.OpenXml.Office.CustomUI
|
||||
Imports GrapeCity.ActiveReports.ReportsCore.Tools
|
||||
Imports itextsharp.text.pdf
|
||||
Imports Microsoft.Office.Interop
|
||||
Imports VERAG_PROG_ALLGEMEIN
|
||||
Imports VERAG_PROG_ALLGEMEIN.Factur_X_1_07_2_EN16931
|
||||
Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf
|
||||
Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf.Attachments
|
||||
|
||||
@@ -1730,85 +1735,18 @@ Public Class cFakturierung
|
||||
|
||||
Shared Function createZUGFeRD(RECHNUNG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang) As String
|
||||
|
||||
|
||||
' ZUGFeRD XML-Dokument erzeugen
|
||||
Dim zugferdXml As New XmlDocument()
|
||||
Dim inv As New CrossIndustryInvoiceType
|
||||
|
||||
' Root-Element (Invoice) erstellen
|
||||
Dim root As XmlElement = zugferdXml.CreateElement("Invoice")
|
||||
' Namespaces definieren
|
||||
root.SetAttribute("xmlns", "urn:ferd:zugferd:invoice:1p0")
|
||||
root.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
|
||||
root.SetAttribute("xsi:schemaLocation", "urn:ferd:zugferd:invoice:1p0 ZugferdInvoice_1p0.xsd")
|
||||
|
||||
zugferdXml.AppendChild(root)
|
||||
|
||||
' ZUGFeRD Header
|
||||
Dim header As XmlElement = zugferdXml.CreateElement("Header")
|
||||
root.AppendChild(header)
|
||||
|
||||
' Absender und Empfänger
|
||||
Dim sender As XmlElement = zugferdXml.CreateElement("Seller")
|
||||
sender.SetAttribute("name", RECHNUNG.AbsenderName_1)
|
||||
sender.SetAttribute("address", RECHNUNG.AbsenderStraße & ", " & RECHNUNG.AbsenderOrt)
|
||||
header.AppendChild(sender)
|
||||
|
||||
Dim recipient As XmlElement = zugferdXml.CreateElement("Buyer")
|
||||
recipient.SetAttribute("name", RECHNUNG.EmpfängerName_1)
|
||||
recipient.SetAttribute("address", RECHNUNG.EmpfängerStraße & ", " & RECHNUNG.EmpfängerOrt)
|
||||
header.AppendChild(recipient)
|
||||
|
||||
' Rechnungsdaten
|
||||
Dim invoiceDetails As XmlElement = zugferdXml.CreateElement("InvoiceDetails")
|
||||
root.AppendChild(invoiceDetails)
|
||||
|
||||
' Rechnungsnummer und -datum
|
||||
Dim invoiceNumber As XmlElement = zugferdXml.CreateElement("InvoiceNumber")
|
||||
invoiceNumber.InnerText = RECHNUNG.RechnungsNr
|
||||
invoiceDetails.AppendChild(invoiceNumber)
|
||||
|
||||
Dim invoiceDate As XmlElement = zugferdXml.CreateElement("InvoiceDate")
|
||||
invoiceDate.InnerText = RECHNUNG.RechnungsDatum
|
||||
invoiceDetails.AppendChild(invoiceDate)
|
||||
|
||||
For Each pos In RECHNUNG.POSITIONEN
|
||||
inv.ExchangedDocument.ID.Value = RECHNUNG.RK_ID
|
||||
inv.ExchangedDocument.TypeCode.Value = 632
|
||||
|
||||
|
||||
|
||||
' Rechnungspositionen (Artikel)
|
||||
Dim items As XmlElement = zugferdXml.CreateElement("Items")
|
||||
invoiceDetails.AppendChild(items)
|
||||
|
||||
Dim item As XmlElement = zugferdXml.CreateElement("Item")
|
||||
items.AppendChild(item)
|
||||
|
||||
' Artikelbeschreibung und Preis
|
||||
Dim description As XmlElement = zugferdXml.CreateElement("Description")
|
||||
description.InnerText = pos.LeistungsBez
|
||||
item.AppendChild(description)
|
||||
|
||||
Dim quantity As XmlElement = zugferdXml.CreateElement("Quantity")
|
||||
quantity.InnerText = pos.Anzahl
|
||||
item.AppendChild(quantity)
|
||||
|
||||
Dim unitPrice As XmlElement = zugferdXml.CreateElement("UnitPrice")
|
||||
unitPrice.InnerText = pos.Preis
|
||||
item.AppendChild(unitPrice)
|
||||
|
||||
Next
|
||||
|
||||
' Gesamtsumme
|
||||
Dim totalAmount As XmlElement = zugferdXml.CreateElement("TotalAmount")
|
||||
totalAmount.InnerText = RECHNUNG.SteuerfreierGesamtbetrag + RECHNUNG.SteuerpflichtigerGesamtbetrag
|
||||
invoiceDetails.AppendChild(totalAmount)
|
||||
|
||||
' Zahlungstermine und -bedingungen
|
||||
Dim paymentTerms As XmlElement = zugferdXml.CreateElement("PaymentTerms")
|
||||
paymentTerms.InnerText = RECHNUNG.TextZZ
|
||||
invoiceDetails.AppendChild(paymentTerms)
|
||||
|
||||
|
||||
Dim tmpPathZugpferd = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath("ZUGFeRD_Invoice", ".xml", , False)
|
||||
zugferdXml.Save(tmpPathZugpferd)
|
||||
inv.SaveToFile(tmpPathZugpferd)
|
||||
|
||||
|
||||
|
||||
@@ -2855,7 +2793,8 @@ Public Class cFakturierung
|
||||
Else
|
||||
dt = SQL.loadDgvBySql("Select * FROM Rechnungsausgang WHERE RechnungsNr is null AND VorschauID='" & VorschauID & "' ORDER BY FilialenNr, AbfertigungsNr", "FMZOLL")
|
||||
End If
|
||||
Dim ROW As DataRow = dt.Rows(0)
|
||||
|
||||
Dim ROW As DataRow = IIf(dt.Rows.Count > 0, dt.Rows(0), Nothing)
|
||||
|
||||
Dim rpt As New rptSammelRechnungAnlagenDruck(ROW("RechnungSprache"))
|
||||
rpt.DataSource = dt
|
||||
|
||||
Reference in New Issue
Block a user