Kunden, Zollauswertung, MDM, eRechnung (aktuell noch deaktiviert!)
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
|
||||
Imports System.Globalization
|
||||
Imports System.Net
|
||||
Imports awt.ShellApi
|
||||
Imports com.sun.org.apache.xerces.internal.impl.dv.xs
|
||||
Imports com.sun.org.apache.xml.internal.serializer
|
||||
Imports java.awt.geom
|
||||
Imports System.Xml
|
||||
Imports itextsharp.text.pdf
|
||||
Imports Microsoft.Office.Interop
|
||||
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
||||
Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf
|
||||
Imports VERAG_PROG_ALLGEMEIN.Spire.Pdf.Attachments
|
||||
|
||||
Public Class cFakturierung
|
||||
|
||||
@@ -1528,16 +1527,23 @@ Public Class cFakturierung
|
||||
rpt.Document.Printer.PrinterName = PrinterName
|
||||
End If
|
||||
rpt.Document.Printer.PaperSize = rpt.Document.Printer.PrinterSettings.DefaultPageSettings.PaperSize
|
||||
'--------------------------------
|
||||
|
||||
'Immer Exportieren, da in Therefore speichern
|
||||
Dim tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getTMPPath(RG_Bezeichnung, ".pdf", , False)
|
||||
Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
|
||||
rpt.Run(False)
|
||||
p.NeverEmbedFonts = ""
|
||||
|
||||
p.Export(rpt.Document, tmpPath)
|
||||
|
||||
|
||||
'e-Rechnung ZUGFeRD aktuell noch deaktiviert!
|
||||
If False Then tmpPath = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.addAttachementToPDF(tmpPath, createZUGFeRD(RECHNUNG))
|
||||
|
||||
Path = tmpPath
|
||||
|
||||
|
||||
|
||||
'THEREFORE IMPORT:
|
||||
'-------------------------------------------------------------------------------
|
||||
Try
|
||||
@@ -1722,6 +1728,94 @@ Public Class cFakturierung
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Shared Function createZUGFeRD(RECHNUNG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang) As String
|
||||
|
||||
' ZUGFeRD XML-Dokument erzeugen
|
||||
Dim zugferdXml As New XmlDocument()
|
||||
|
||||
' 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
|
||||
|
||||
|
||||
|
||||
' 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)
|
||||
|
||||
|
||||
|
||||
Return tmpPathZugpferd
|
||||
|
||||
End Function
|
||||
|
||||
Shared Sub printSpedBuchAnhaenge(RG As VERAG_PROG_ALLGEMEIN.cRechnungsausgang, Optional printStb As Boolean = False, Optional printVbD As Boolean = False)
|
||||
Try
|
||||
Dim SPEDBCUH = New VERAG_PROG_ALLGEMEIN.cSpeditionsbuch(RG.FilialenNr, RG.AbfertigungsNr, RG.SpeditionsbuchUnterNr)
|
||||
|
||||
Reference in New Issue
Block a user