first commit
This commit is contained in:
130
examples/files/invoice.xml
Normal file
130
examples/files/invoice.xml
Normal file
@@ -0,0 +1,130 @@
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!-- English disclaimer below.-->
|
||||
<!--Nutzungsrechte
|
||||
ZUGFeRD Datenformat Version 2.3.0, 18.09.2024
|
||||
Beispiel Version 18.09.2024
|
||||
|
||||
Zweck des Forums elektronisch Rechnung Deutschland, welches am 31. März 2010 unter der Arbeitsgemeinschaft für
|
||||
wirtschaftliche Verwaltung e. V. gegründet wurde, ist u. a. die Schaffung und Spezifizierung eines offenen Datenformats
|
||||
für strukturierten elektronischen Datenaustausch auf der Grundlage offener und nicht diskriminierender, standardisierter
|
||||
Technologien („ZUGFeRD Datenformat“).
|
||||
|
||||
Das ZUGFeRD Datenformat wird nach Maßgabe des FeRD sowohl Unternehmen als auch der öffentlichen Verwaltung
|
||||
frei zugänglich gemacht. Hierfür bietet FeRD allen Unternehmen und Organisationen der öffentlichen Verwaltung eine
|
||||
Lizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD-Datenformats zu fairen, sachgerechten und nicht
|
||||
diskriminierenden Bedingungen an.
|
||||
|
||||
Die Spezifikation des FeRD zur Implementierung des ZUGFeRD Datenformats ist in ihrer jeweils geltenden Fassung
|
||||
abrufbar unter www.ferd-net.de.
|
||||
|
||||
Im Einzelnen schließt die Nutzungsgewährung ein:
|
||||
=====================================
|
||||
|
||||
FeRD räumt eine Lizenz für die Nutzung des urheberrechtlich geschützten ZUGFeRD Datenformats in der jeweils
|
||||
geltenden und akzeptierten Fassung (www.ferd-net.de) ein.
|
||||
Die Lizenz beinhaltet ein unwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung,
|
||||
Weiterbearbeitung und Verbindung mit anderen Produkten.
|
||||
Die Lizenz gilt insbesondere für die Entwicklung, die Gestaltung, die Herstellung, den Verkauf, die Nutzung oder
|
||||
anderweitige Verwendung des ZUGFeRD Datenformats für Hardware- und/oder Softwareprodukte sowie sonstige
|
||||
Anwendungen und Dienste.
|
||||
Diese Lizenz schließt nicht die wesentlichen Patente der Mitglieder von FeRD ein. Als wesentliche Patente sind Patente
|
||||
und Patentanmeldungen weltweit zu verstehen, die einen oder mehrere Patentansprüche beinhalten, bei denen es sich um
|
||||
notwendige Ansprüche handelt. Notwendige Ansprüche sind lediglich jene Ansprüche der Wesentlichen Patente, die durch
|
||||
die Implementierung des ZUGFeRD Datenformats notwendigerweise verletzt würden.
|
||||
Der Lizenznehmer ist berechtigt, seinen jeweiligen Konzerngesellschaften ein unbefristetes, weltweites, nicht übertragbares,
|
||||
unwiderrufliches Nutzungsrecht einschließlich des Rechts der Weiterentwicklung, Weiterbearbeitung und Verbindung mit
|
||||
anderen Produkten einzuräumen.
|
||||
|
||||
Die Lizenz wird kostenfrei zur Verfügung gestellt.
|
||||
|
||||
Außer im Falle vorsätzlichen Verschuldens oder grober Fahrlässigkeit haftet FeRD weder für Nutzungsausfall, entgangenen
|
||||
Gewinn, Datenverlust, Kommunikationsverlust, Einnahmeausfall, Vertragseinbußen, Geschäftsausfall oder für Kosten,
|
||||
Schäden, Verluste oder Haftpflichten im Zusammenhang mit einer Unterbrechung der Geschäftstätigkeit, noch für konkrete,
|
||||
beiläufig entstandene, mittelbare Schäden, Straf- oder Folgeschäden und zwar auch dann nicht, wenn die Möglichkeit der
|
||||
Kosten, Verluste bzw. Schäden hätte normalerweise vorhergesehen werden können.-->
|
||||
|
||||
<!--Right of use
|
||||
ZUGFeRD Data format version 2.3.0, September 18th, 2024
|
||||
|
||||
The purpose of the Forum elektronische Rechnung Deutschland (FeRD), which was founded on March 31, 2010 under the
|
||||
umbrella of Arbeitsgemeinschaft für wirtschaftliche Verwaltung e. V., is, among other things, to create and specify an
|
||||
open data format for structured electronic data exchange on the basis of open and non discriminatory, standardised
|
||||
technologies ("ZUGFeRD data format").
|
||||
|
||||
The ZUGFeRD data format is used by both companies and public administration according to the FeRD
|
||||
made freely accessible. For this purpose FeRD offers all companies and organisations of the public administration a
|
||||
License to use the copyrighted ZUGFeRD data format in a fair, appropriate and non
|
||||
discriminatory conditions.
|
||||
|
||||
The specification of the FeRD for the implementation of the ZUGFeRD data format is, in its currently valid version
|
||||
available at www.ferd-net.de.
|
||||
|
||||
In detail, the grant of use includes
|
||||
=====================================
|
||||
|
||||
FeRD grants a license for the use of the copyrighted ZUGFeRD data format in the respective
|
||||
valid and accepted version (www.ferd-net.de).
|
||||
The license includes an irrevocable right of use including the right of further development,
|
||||
Further processing and connection with other products.
|
||||
The license applies in particular to the development, design, production, sale, use or
|
||||
other use of the ZUGFeRD data format for hardware and/or software products and other
|
||||
applications and services.
|
||||
This license does not include the essential patents of the members of FeRD. The essential patents are patents
|
||||
and patent applications worldwide which contain one or more claims that are
|
||||
necessary claims. Necessary claims are only those claims of the essential patents which are
|
||||
the implementation of the ZUGFeRD data format would necessarily be violated.
|
||||
The Licensee is entitled to provide its respective group companies with an unlimited, worldwide, non-transferable,
|
||||
irrevocable right of use including the right of further development, further processing and connection with
|
||||
other products.
|
||||
|
||||
The license is provided free of charge.
|
||||
|
||||
Except in the case of intentional fault or gross negligence, FeRD is not liable for loss of use, loss of
|
||||
Profit, loss of data, loss of communication, loss of revenue, loss of contracts, loss of business or for costs
|
||||
damages, losses or liabilities in connection with an interruption of business, nor for concrete,
|
||||
incidental, indirect, punitive or consequential damages, even if the possibility of
|
||||
costs, losses or damages could normally have been foreseen.-->
|
||||
|
||||
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
|
||||
<rsm:ExchangedDocumentContext>
|
||||
<ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
<ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID>
|
||||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument>
|
||||
<ram:ID>471102</ram:ID>
|
||||
<ram:TypeCode>380</ram:TypeCode>
|
||||
<ram:IssueDateTime>
|
||||
<udt:DateTimeString format="102">20241115</udt:DateTimeString>
|
||||
</ram:IssueDateTime>
|
||||
</rsm:ExchangedDocument>
|
||||
<rsm:SupplyChainTradeTransaction>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:SellerTradeParty>
|
||||
<ram:Name>Lieferant GmbH</ram:Name>
|
||||
<ram:PostalTradeAddress>
|
||||
<ram:CountryID>DE</ram:CountryID>
|
||||
</ram:PostalTradeAddress>
|
||||
<ram:SpecifiedTaxRegistration>
|
||||
<ram:ID schemeID="FC">201/113/40209</ram:ID>
|
||||
</ram:SpecifiedTaxRegistration>
|
||||
<ram:SpecifiedTaxRegistration>
|
||||
<ram:ID schemeID="VA">DE123456789</ram:ID>
|
||||
</ram:SpecifiedTaxRegistration>
|
||||
</ram:SellerTradeParty>
|
||||
<ram:BuyerTradeParty>
|
||||
<ram:Name>Kunden AG Frankreich</ram:Name>
|
||||
</ram:BuyerTradeParty>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery/>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
<ram:TaxBasisTotalAmount>198.00</ram:TaxBasisTotalAmount>
|
||||
<ram:TaxTotalAmount currencyID="EUR">37.62</ram:TaxTotalAmount>
|
||||
<ram:GrandTotalAmount>235.62</ram:GrandTotalAmount>
|
||||
<ram:DuePayableAmount>235.62</ram:DuePayableAmount>
|
||||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
</ram:ApplicableHeaderTradeSettlement>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:CrossIndustryInvoice>
|
||||
30
examples/validateXml.ts
Normal file
30
examples/validateXml.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
// examples/validate_xml.ts
|
||||
import { ValidationError } from "../src/mod.ts";
|
||||
import { CaballoClient } from "../src/mod.ts";
|
||||
import {
|
||||
dirname,
|
||||
fromFileUrl,
|
||||
join,
|
||||
} from "https://deno.land/std@0.224.0/path/mod.ts";
|
||||
|
||||
// Get current directory
|
||||
const currentDir = dirname(fromFileUrl(import.meta.url));
|
||||
// Construct absolute path to XML file
|
||||
const xmlPath = join(currentDir, "files", "invoice.xml");
|
||||
|
||||
console.log(xmlPath);
|
||||
|
||||
const client = new CaballoClient({
|
||||
baseUrl: "https://caballo.app",
|
||||
});
|
||||
|
||||
// Now use the absolute path
|
||||
const xmlContent = await Deno.readFile(xmlPath);
|
||||
try {
|
||||
const result = await client.validateXml(xmlContent);
|
||||
console.log("Validation result:", result);
|
||||
} catch (error) {
|
||||
if (error instanceof ValidationError) {
|
||||
console.error("Validation failed:", error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user