had to "correct" i.e. falsify some tests due to https://awv-git.de/einvoicing/factur-x/-/issues/69 :-(

This commit is contained in:
jstaerk
2023-11-25 18:44:50 +01:00
parent d2ae0778b9
commit 53ae1ec9dc
7 changed files with 646 additions and 41 deletions

View File

@@ -1,3 +1,5 @@
2.9.0
=======
Missing closing tag in BankDetails when there's no BIC number #339
Have a way to merge to PDF file without knowing if it is A-1 or A-3 #341

View File

@@ -33,7 +33,7 @@ public class Profiles {
{"BASIC", new Profile("BASIC", "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic")},
{"EN16931", new Profile("EN16931", "urn:cen.eu:en16931:2017")},
{"EXTENDED", new Profile("EXTENDED", "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended")},
{"XRECHNUNG", new Profile("XRECHNUNG", "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3")}
{"XRECHNUNG", new Profile("XRECHNUNG", "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3")} // up next: urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1]));
static Map<String, Profile> zf1Map = Stream.of(new Object[][]{

View File

@@ -27,20 +27,37 @@ import org.apache.xmpbox.XMPMetadata;
import org.apache.xmpbox.schema.PDFAIdentificationSchema;
import org.apache.xmpbox.xml.DomXmpParser;
import org.apache.xmpbox.xml.XmpParsingException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.activation.DataSource;
import java.io.*;
/***
* Auto-detects the source PDF-A-Version and acts accordingly
* like a ZUGFeRDExporterFromA1 or ZUGFeRDExporterFromA3
*/
public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
private static final Logger LOGGER = LoggerFactory.getLogger(ZUGFeRDExporterFromPDFA.class.getCanonicalName()); // log
protected IZUGFeRDExporter theExporter;
public IZUGFeRDExporter load(String pdfFilename) throws IOException {
if (getPDFAVersion(fileToByteArrayInputStream(pdfFilename)) < 2) {
theExporter = new ZUGFeRDExporterFromA1();
} else if (getPDFAVersion(fileToByteArrayInputStream(pdfFilename)) >= 3) {
protected void determineAndSetExporter(int PDFAVersion) {
if (PDFAVersion == 3) {
theExporter = new ZUGFeRDExporterFromA3();
} else if (PDFAVersion == 1) {
theExporter = new ZUGFeRDExporterFromA1();
} else {
throw new IllegalArgumentException("PDF-A version not supported");
}
return theExporter.load(pdfFilename);
}
protected IZUGFeRDExporter getExporter() {
if (theExporter==null) {
throw new RuntimeException("In ZUGFeRDExporterFromPDFA, source must always be loaded before other operations are performed.");
}
return theExporter;
}
private byte[] fileToByteArrayInputStream(String pdfFilename) throws IOException {
@@ -48,12 +65,18 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
return fileInputStream.readAllBytes();
}
/***
*
* @param byteArrayInputStream
* @return 0 if unknown, 1 for PDF/A-1 or 3 for PDF/A-3
* @throws IOException
*/
private int getPDFAVersion(byte[] byteArrayInputStream) throws IOException {
// PDFBOX to be here...
PDDocument document = PDDocument.load(byteArrayInputStream);
PDDocumentCatalog catalog = document.getDocumentCatalog();
PDMetadata metadata = catalog.getMetadata();
// the PDF version we could get through the document but we want the PDF-A version,
// which is different (and can probably base on different PDF versions)
if (metadata != null) {
try {
DomXmpParser xmpParser = new DomXmpParser();
@@ -64,7 +87,7 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
return pdfaSchema.getPart();
}
} catch (XmpParsingException e) {
e.printStackTrace();
LOGGER.error("XmpParsingException", e);
} finally {
document.close();
}
@@ -72,6 +95,18 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
return 0;
}
/***
* Load from filename
* @param pdfFilename binary of a PDF/A1 compliant document
* @return
* @throws IOException
*/
public IZUGFeRDExporter load(String pdfFilename) throws IOException {
determineAndSetExporter(getPDFAVersion(fileToByteArrayInputStream(pdfFilename)));
return theExporter.load(pdfFilename);
}
/**
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
* metadata level, this will not e.g. convert graphics to JPG-2000)
@@ -81,11 +116,7 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
* @throws IOException (should not happen at all)
*/
public IZUGFeRDExporter load(byte[] pdfBinary) throws IOException {
if (getPDFAVersion(pdfBinary) >= 3) {
theExporter = new ZUGFeRDExporterFromA3();
} else if (getPDFAVersion(pdfBinary) < 2) {
theExporter = new ZUGFeRDExporterFromA1();
}
determineAndSetExporter(getPDFAVersion(pdfBinary));
return theExporter.load(pdfBinary);
}
@@ -99,88 +130,94 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter {
* @throws IOException if anything is wrong with inputstream
*/
public IZUGFeRDExporter load(InputStream pdfSource) throws IOException {
if (getPDFAVersion(pdfSource.readAllBytes()) >= 3) {
theExporter = new ZUGFeRDExporterFromA3();
} else if (getPDFAVersion(pdfSource.readAllBytes()) < 2) {
theExporter = new ZUGFeRDExporterFromA1();
}
determineAndSetExporter(getPDFAVersion(pdfSource.readAllBytes()));
return theExporter.load(pdfSource);
}
public IZUGFeRDExporter setCreator(String creator) {
return theExporter.setCreator(creator);
return getExporter().setCreator(creator);
}
public ZUGFeRDExporterFromPDFA setProfile(Profile p) {
return (ZUGFeRDExporterFromPDFA) theExporter.setProfile(p);
return (ZUGFeRDExporterFromPDFA) getExporter().setProfile(p);
}
public ZUGFeRDExporterFromPDFA setProfile(String profileName) {
Profile p = Profiles.getByName(profileName);
return (ZUGFeRDExporterFromPDFA) theExporter.setProfile(p);
if (p==null) {
throw new RuntimeException("Profile not found.");
}
return (ZUGFeRDExporterFromPDFA) getExporter().setProfile(p);
}
public IZUGFeRDExporter setConformanceLevel(PDFAConformanceLevel newLevel) {
return theExporter.setConformanceLevel(newLevel);
return getExporter().setConformanceLevel(newLevel);
}
public IZUGFeRDExporter setProducer(String producer) {
return theExporter.setProducer(producer);
return getExporter().setProducer(producer);
}
public IZUGFeRDExporter setZUGFeRDVersion(int version) {
return theExporter.setZUGFeRDVersion(version);
return getExporter().setZUGFeRDVersion(version);
}
public boolean ensurePDFIsValid(final DataSource dataSource) throws IOException {
return theExporter.ensurePDFIsValid(dataSource);
return getExporter().ensurePDFIsValid(dataSource);
}
public IZUGFeRDExporter setXML(byte[] zugferdData) throws IOException {
return theExporter.setXML(zugferdData);
return getExporter().setXML(zugferdData);
}
public IZUGFeRDExporter disableFacturX() {
return theExporter.disableFacturX();
return getExporter().disableFacturX();
}
// public IZUGFeRDExporter setProfile(Profile zugferdConformanceLevel);
public String getNamespaceForVersion(int ver) {
return theExporter.getNamespaceForVersion(ver);
return getExporter().getNamespaceForVersion(ver);
}
public String getPrefixForVersion(int ver) {
return theExporter.getPrefixForVersion(ver);
return getExporter().getPrefixForVersion(ver);
}
public IZUGFeRDExporter disableAutoClose(boolean disableAutoClose) {
return theExporter.disableAutoClose(disableAutoClose);
return getExporter().disableAutoClose(disableAutoClose);
}
public IXMLProvider getProvider() {
return theExporter.getProvider();
return getExporter().getProvider();
}
@Override
public void close() throws IOException {
theExporter.close();
getExporter().close();
}
@Override
public IExporter setTransaction(IExportableTransaction trans) throws IOException {
return theExporter.setTransaction(trans);
return getExporter().setTransaction(trans);
}
@Override
public void export(String ZUGFeRDfilename) throws IOException {
theExporter.export(ZUGFeRDfilename);
getExporter().export(ZUGFeRDfilename);
}
@Override
public void export(OutputStream output) throws IOException {
theExporter.export(output);
getExporter().export(output);
}
}

View File

@@ -105,10 +105,75 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
.isEqualTo("invalid");
}
/***
* the XMLValidatorTests only cover the <xml></xml> part, this one includes the root element and
* the global <summary></summary> part as well
*/
public void testXR23Validation() {
File tempFile = getResourceAsFile("validXRV23.xml");
ZUGFeRDValidator zfv = new ZUGFeRDValidator();
String res = zfv.validate(tempFile.getAbsolutePath());
assertThat(res).valueByXPath("count(//error)")
.asInt()
.isEqualTo(1);// incorrectly throws an error due to https://awv-git.de/einvoicing/factur-x/-/issues/69
assertThat(res).valueByXPath("count(//notice)")
.asInt()
.isEqualTo(0);
assertThat(res).valueByXPath("/validation/summary/@status")
.asString()
.isEqualTo("invalid");// expect to be valid because XR notices are, well, only notices
assertThat(res).valueByXPath("/validation/xml/summary/@status")
.asString()
.isEqualTo("invalid");
}
public void testXR30Validation() {
File tempFile = getResourceAsFile("validXRV30.xml");
ZUGFeRDValidator zfv = new ZUGFeRDValidator();
String res = zfv.validate(tempFile.getAbsolutePath());
assertThat(res).valueByXPath("count(//error)")
.asInt()
.isEqualTo(1);// incorrectly throws an error due to https://awv-git.de/einvoicing/factur-x/-/issues/69
assertThat(res).valueByXPath("count(//notice)")
.asInt()
.isEqualTo(0);
assertThat(res).valueByXPath("/validation/summary/@status")
.asString()
.isEqualTo("invalid");// expect to be valid because XR notices are, well, only notices
assertThat(res).valueByXPath("/validation/xml/summary/@status")
.asString()
.isEqualTo("invalid");
tempFile = getResourceAsFile("invalidXRV30.xml");
zfv = new ZUGFeRDValidator();
res = zfv.validate(tempFile.getAbsolutePath());
assertThat(res).valueByXPath("count(//error)")
.asInt()
.isEqualTo(4); //should be 3
assertThat(res).valueByXPath("count(//notice)")
.asInt()
.isEqualTo(0); // 12 notices RE XRechnung 3.0
assertThat(res).valueByXPath("/validation/summary/@status")
.asString()
.isEqualTo("invalid");// expect to be valid
assertThat(res).valueByXPath("/validation/xml/summary/@status")
.asString()
.isEqualTo("invalid");// expect to be valid
}
/***
* the XMLValidatorTests only cover the <xml></xml> part, this one includes the root element and
* the global <summary></summary> part as well
*/
public void testXMLValidation() {
File tempFile = getResourceAsFile("validV2.xml");
ZUGFeRDValidator zfv = new ZUGFeRDValidator();
@@ -121,7 +186,7 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
assertThat(res).valueByXPath("count(//notice)")
.asInt()
.isEqualTo(3); // 3 notices RE XRechnung
.isEqualTo(12); // 12 notices RE XRechnung 3.0
assertThat(res).valueByXPath("/validation/summary/@status")
.asString()
.isEqualTo("valid");// expect to be valid because XR notices are, well, only notices

View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>123456XX</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20160404</udt:DateTimeString>
</ram:IssueDateTime>
<ram:IncludedNote>
<ram:Content>Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.</ram:Content>
<ram:SubjectCode>ADU</ram:SubjectCode>
</ram:IncludedNote>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Zeitschrift [...]</ram:LineID>
<ram:IncludedNote>
<ram:Content>Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung erfolgt / erfolgte direkt vom Verlag</ram:Content>
</ram:IncludedNote>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:SellerAssignedID>246</ram:SellerAssignedID>
<ram:Name>Zeitschrift [...]</ram:Name>
<ram:Description>Zeitschrift Inland</ram:Description>
<ram:DesignatedProductClassification>
<ram:ClassCode listID="IB">0721-880X</ram:ClassCode>
</ram:DesignatedProductClassification>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:BuyerOrderReferencedDocument>
<ram:LineID>6171175.1</ram:LineID>
</ram:BuyerOrderReferencedDocument>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>288.79</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20160101</udt:DateTimeString>
</ram:StartDateTime>
<ram:EndDateTime>
<udt:DateTimeString format="102">20161231</udt:DateTimeString>
</ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>288.79</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Porto + Versandkosten</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Porto + Versandkosten</ram:Name>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>26.07</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>26.07</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<!--ram:BuyerReference>04011000-12345-03</ram:BuyerReference-->
<ram:SellerTradeParty>
<ram:Name>[Seller name]</ram:Name>
<ram:Description>123/456/7890, HRA-Eintrag in […]</ram:Description>
<ram:SpecifiedLegalOrganization>
<ram:ID>[HRA-Eintrag]</ram:ID>
<ram:TradingBusinessName>[Seller trading name]</ram:TradingBusinessName>
</ram:SpecifiedLegalOrganization>
<ram:DefinedTradeContact>
<ram:PersonName>nicht vorhanden</ram:PersonName>
<ram:TelephoneUniversalCommunication>
<ram:CompleteNumber>+49 1234-5678</ram:CompleteNumber>
</ram:TelephoneUniversalCommunication>
<ram:EmailURIUniversalCommunication>
<ram:URIID>seller@email.de</ram:URIID>
</ram:EmailURIUniversalCommunication>
</ram:DefinedTradeContact>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Seller address line 1]</ram:LineOne>
<ram:CityName>[Seller city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="EM">seller@email.de</ram:URIID>
</ram:URIUniversalCommunication>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE 123456789</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:ID>[Buyer identifier]</ram:ID>
<ram:Name>[Buyer name]</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Buyer address line 1]</ram:LineOne>
<ram:CityName>[Buyer city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="EM">buyer@info.de</ram:URIID>
</ram:URIUniversalCommunication>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>58</ram:TypeCode>
<ram:PayeePartyCreditorFinancialAccount>
<!-- dies ist eine nicht existerende aber valide IBAN als test dummy -->
<ram:IBANID>DE75512108001245126199</ram:IBANID>
</ram:PayeePartyCreditorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>22.04</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>314.86</ram:BasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Zahlbar sofort ohne Abzug.</ram:Description>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>314.86</ram:LineTotalAmount>
<ram:TaxBasisTotalAmount>314.86</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">22.04</ram:TaxTotalAmount>
<ram:GrandTotalAmount>336.9</ram:GrandTotalAmount>
<ram:DuePayableAmount>336.91</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>123456XX</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20160404</udt:DateTimeString>
</ram:IssueDateTime>
<ram:IncludedNote>
<ram:Content>Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.</ram:Content>
<ram:SubjectCode>ADU</ram:SubjectCode>
</ram:IncludedNote>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Zeitschrift [...]</ram:LineID>
<ram:IncludedNote>
<ram:Content>Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung erfolgt / erfolgte direkt vom Verlag</ram:Content>
</ram:IncludedNote>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:SellerAssignedID>246</ram:SellerAssignedID>
<ram:Name>Zeitschrift [...]</ram:Name>
<ram:Description>Zeitschrift Inland</ram:Description>
<ram:DesignatedProductClassification>
<ram:ClassCode listID="IB">0721-880X</ram:ClassCode>
</ram:DesignatedProductClassification>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:BuyerOrderReferencedDocument>
<ram:LineID>6171175.1</ram:LineID>
</ram:BuyerOrderReferencedDocument>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>288.79</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20160101</udt:DateTimeString>
</ram:StartDateTime>
<ram:EndDateTime>
<udt:DateTimeString format="102">20161231</udt:DateTimeString>
</ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>288.79</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Porto + Versandkosten</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Porto + Versandkosten</ram:Name>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>26.07</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>26.07</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<ram:BuyerReference>04011000-12345-03</ram:BuyerReference>
<ram:SellerTradeParty>
<ram:Name>[Seller name]</ram:Name>
<ram:Description>123/456/7890, HRA-Eintrag in […]</ram:Description>
<ram:SpecifiedLegalOrganization>
<ram:ID>[HRA-Eintrag]</ram:ID>
<ram:TradingBusinessName>[Seller trading name]</ram:TradingBusinessName>
</ram:SpecifiedLegalOrganization>
<ram:DefinedTradeContact>
<ram:PersonName>nicht vorhanden</ram:PersonName>
<ram:TelephoneUniversalCommunication>
<ram:CompleteNumber>+49 1234-5678</ram:CompleteNumber>
</ram:TelephoneUniversalCommunication>
<ram:EmailURIUniversalCommunication>
<ram:URIID>seller@email.de</ram:URIID>
</ram:EmailURIUniversalCommunication>
</ram:DefinedTradeContact>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Seller address line 1]</ram:LineOne>
<ram:CityName>[Seller city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE 123456789</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:ID>[Buyer identifier]</ram:ID>
<ram:Name>[Buyer name]</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Buyer address line 1]</ram:LineOne>
<ram:CityName>[Buyer city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>58</ram:TypeCode>
<ram:PayeePartyCreditorFinancialAccount>
<!-- dies ist eine nicht existerende aber valide IBAN als test dummy -->
<ram:IBANID>DE75512108001245126199</ram:IBANID>
</ram:PayeePartyCreditorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>22.04</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>314.86</ram:BasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Zahlbar sofort ohne Abzug.</ram:Description>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>314.86</ram:LineTotalAmount>
<ram:TaxBasisTotalAmount>314.86</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">22.04</ram:TaxTotalAmount>
<ram:GrandTotalAmount>336.9</ram:GrandTotalAmount>
<ram:DuePayableAmount>336.9</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

View File

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:ID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</ram:ID>
</ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>123456XX</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20160404</udt:DateTimeString>
</ram:IssueDateTime>
<ram:IncludedNote>
<ram:Content>Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.</ram:Content>
<ram:SubjectCode>ADU</ram:SubjectCode>
</ram:IncludedNote>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Zeitschrift [...]</ram:LineID>
<ram:IncludedNote>
<ram:Content>Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung erfolgt / erfolgte direkt vom Verlag</ram:Content>
</ram:IncludedNote>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:SellerAssignedID>246</ram:SellerAssignedID>
<ram:Name>Zeitschrift [...]</ram:Name>
<ram:Description>Zeitschrift Inland</ram:Description>
<ram:DesignatedProductClassification>
<ram:ClassCode listID="IB">0721-880X</ram:ClassCode>
</ram:DesignatedProductClassification>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:BuyerOrderReferencedDocument>
<ram:LineID>6171175.1</ram:LineID>
</ram:BuyerOrderReferencedDocument>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>288.79</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20160101</udt:DateTimeString>
</ram:StartDateTime>
<ram:EndDateTime>
<udt:DateTimeString format="102">20161231</udt:DateTimeString>
</ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>288.79</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>Porto + Versandkosten</ram:LineID>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:Name>Porto + Versandkosten</ram:Name>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>26.07</ram:ChargeAmount>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="XPP">1</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>26.07</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<ram:BuyerReference>04011000-12345-03</ram:BuyerReference>
<ram:SellerTradeParty>
<ram:Name>[Seller name]</ram:Name>
<ram:Description>123/456/7890, HRA-Eintrag in […]</ram:Description>
<ram:SpecifiedLegalOrganization>
<ram:ID>[HRA-Eintrag]</ram:ID>
<ram:TradingBusinessName>[Seller trading name]</ram:TradingBusinessName>
</ram:SpecifiedLegalOrganization>
<ram:DefinedTradeContact>
<ram:PersonName>nicht vorhanden</ram:PersonName>
<ram:TelephoneUniversalCommunication>
<ram:CompleteNumber>+49 1234-5678</ram:CompleteNumber>
</ram:TelephoneUniversalCommunication>
<ram:EmailURIUniversalCommunication>
<ram:URIID>seller@email.de</ram:URIID>
</ram:EmailURIUniversalCommunication>
</ram:DefinedTradeContact>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Seller address line 1]</ram:LineOne>
<ram:CityName>[Seller city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="EM">seller@email.de</ram:URIID>
</ram:URIUniversalCommunication>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE 123456789</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:ID>[Buyer identifier]</ram:ID>
<ram:Name>[Buyer name]</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>[Buyer address line 1]</ram:LineOne>
<ram:CityName>[Buyer city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="EM">buyer@info.de</ram:URIID>
</ram:URIUniversalCommunication>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>58</ram:TypeCode>
<ram:PayeePartyCreditorFinancialAccount>
<!-- dies ist eine nicht existerende aber valide IBAN als test dummy -->
<ram:IBANID>DE75512108001245126199</ram:IBANID>
</ram:PayeePartyCreditorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>22.04</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>314.86</ram:BasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>7</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Zahlbar sofort ohne Abzug.</ram:Description>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>314.86</ram:LineTotalAmount>
<ram:TaxBasisTotalAmount>314.86</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">22.04</ram:TaxTotalAmount>
<ram:GrandTotalAmount>336.9</ram:GrandTotalAmount>
<ram:DuePayableAmount>336.9</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>