Merge branch 'mustang-master' into forked-master

This commit is contained in:
Sebastian Sieber
2024-11-05 14:44:07 +01:00
16 changed files with 1010 additions and 885 deletions

View File

@@ -3,8 +3,16 @@
2024- 2024-
- 435 use invoiceimporter as common technical basis also for zugferdimporter - 435 use invoiceimporter as common technical basis also for zugferdimporter
- also import delivery address - also import delivery address
- 527 - 527 metrics raises errors
- 517 read product GlobalID
- 380 Added test for input stream validation
- 518 corrently validate more XRechnung versions
- make document charges and allowances serializable - make document charges and allowances serializable
- 523
- 530
- 532 support validation warnings!
- 534 new signature
-
2.14.2 2.14.2

View File

@@ -214,4 +214,16 @@ public class XMLTools extends XMLWriter {
return IOUtils.toByteArray (fileinput); return IOUtils.toByteArray (fileinput);
} }
public static String trimOrNull(Node node) {
if (node != null) {
String textContent = node.getTextContent();
if (textContent != null) {
return textContent.trim();
}
}
return null;
}
} }

View File

@@ -334,7 +334,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
this.trans = trans; this.trans = trans;
this.calc = new TransactionCalculator(trans); this.calc = new TransactionCalculator(trans);
boolean hasDueDate = false; boolean hasDueDate = trans.getDueDate()!=null;
final SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy"); final SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
String exemptionReason = ""; String exemptionReason = "";
@@ -818,7 +818,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
} }
} }
if ((trans.getPaymentTerms() == null) && (getProfile() != Profiles.getByName("Minimum")) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) { if ((trans.getPaymentTerms() == null) && (getProfile() != Profiles.getByName("Minimum")) && ((paymentTermsDescription != null) || (trans.getTradeSettlement() != null) || (hasDueDate))) {
xml += "<ram:SpecifiedTradePaymentTerms>"; xml += "<ram:SpecifiedTradePaymentTerms>";
@@ -834,7 +833,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
} }
} }
if (hasDueDate && (trans.getDueDate() != null)) { if (trans.getDueDate() != null) {
xml += "<ram:DueDateDateTime>" // $NON-NLS-2$ xml += "<ram:DueDateDateTime>" // $NON-NLS-2$
+ DATE.udtFormat(trans.getDueDate()) + DATE.udtFormat(trans.getDueDate())
+ "</ram:DueDateDateTime>";// 20130704 + "</ram:DueDateDateTime>";// 20130704

View File

@@ -14,55 +14,19 @@ package org.mustangproject.ZUGFeRD;
* @author jstaerk * @author jstaerk
*/ */
import java.io.*; import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPath; import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPathFactory;
import org.apache.commons.io.IOUtils;
import org.apache.fop.util.XMLUtil;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary;
import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode;
import org.apache.pdfbox.pdmodel.common.PDNameTreeNode;
import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification;
import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile;
import org.mustangproject.*; import org.mustangproject.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.*;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.text.SimpleDateFormat;
import java.util.*;
public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter { public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
private static final Logger LOGGER = LoggerFactory.getLogger(ZUGFeRDImporter.class); private static final Logger LOGGER = LoggerFactory.getLogger(ZUGFeRDImporter.class);
@@ -753,7 +717,7 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter {
SchemedID globalId = new SchemedID() SchemedID globalId = new SchemedID()
.setScheme(node.getAttributes() .setScheme(node.getAttributes()
.getNamedItem("schemeID").getNodeValue()) .getNamedItem("schemeID").getNodeValue())
.setId(getNodeValue(node)); .setId(XMLTools.getNodeValue(node));
lineItem.getProduct().addGlobalID(globalId); lineItem.getProduct().addGlobalID(globalId);
} }
node = getNodeByName(nn.getChildNodes(), "SellerAssignedID"); node = getNodeByName(nn.getChildNodes(), "SellerAssignedID");

View File

@@ -79,24 +79,6 @@ public class ZUGFeRDInvoiceImporter {
setInputStream(pdfStream); setInputStream(pdfStream);
} }
private static String trimOrNull(Node node) {
if (node != null) {
String textContent = node.getTextContent();
if (textContent != null) {
return textContent.trim();
}
}
return null;
}
private static String convertStreamToString(java.io.InputStream is) {
try {
return IOUtils.toString(is, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
public void setPDFFilename(String pdfFilename) { public void setPDFFilename(String pdfFilename) {
try (InputStream bis = Files.newInputStream(Paths.get(pdfFilename), StandardOpenOption.READ)) { try (InputStream bis = Files.newInputStream(Paths.get(pdfFilename), StandardOpenOption.READ)) {
extractLowLevel(bis); extractLowLevel(bis);
@@ -151,7 +133,8 @@ public class ZUGFeRDInvoiceImporter {
} }
final InputStream XMP = doc.getDocumentCatalog().getMetadata().exportXMPMetadata(); final InputStream XMP = doc.getDocumentCatalog().getMetadata().exportXMPMetadata();
xmpString = convertStreamToString(XMP);
xmpString = new String(XMLTools.getBytesFromStream(XMP), StandardCharsets.UTF_8);
final PDEmbeddedFilesNameTreeNode etn = names.getEmbeddedFiles(); final PDEmbeddedFilesNameTreeNode etn = names.getEmbeddedFiles();
if (etn == null) { if (etn == null) {
@@ -330,7 +313,7 @@ public class ZUGFeRDInvoiceImporter {
BigDecimal expectedGrandTotal = null; BigDecimal expectedGrandTotal = null;
NodeList totalNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList totalNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
if (totalNodes.getLength() > 0) { if (totalNodes.getLength() > 0) {
expectedGrandTotal = new BigDecimal(trimOrNull(totalNodes.item(0))); expectedGrandTotal = new BigDecimal(XMLTools.trimOrNull(totalNodes.item(0)));
if (zpp instanceof CalculatedInvoice) { if (zpp instanceof CalculatedInvoice) {
// usually we would re-calculate the invoice to get expectedGrandTotal // usually we would re-calculate the invoice to get expectedGrandTotal
// however, for "minimal" invoices or other invoices without lines // however, for "minimal" invoices or other invoices without lines
@@ -342,7 +325,7 @@ public class ZUGFeRDInvoiceImporter {
xpr = xpath.compile("//*[local-name()=\"PrepaidAmount\"]"); xpr = xpath.compile("//*[local-name()=\"PrepaidAmount\"]");
NodeList prepaidNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList prepaidNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
if (prepaidNodes.getLength() > 0) { if (prepaidNodes.getLength() > 0) {
zpp.setTotalPrepaidAmount(new BigDecimal(trimOrNull(prepaidNodes.item(0)))); zpp.setTotalPrepaidAmount(new BigDecimal(XMLTools.trimOrNull(prepaidNodes.item(0))));
} }
Date issueDate = null; Date issueDate = null;
@@ -355,17 +338,17 @@ public class ZUGFeRDInvoiceImporter {
for (int documentChildIndex = 0; documentChildIndex < exchangedDocumentChilds.getLength(); documentChildIndex++) { for (int documentChildIndex = 0; documentChildIndex < exchangedDocumentChilds.getLength(); documentChildIndex++) {
Node item = exchangedDocumentChilds.item(documentChildIndex); Node item = exchangedDocumentChilds.item(documentChildIndex);
if ((item.getLocalName() != null) && (item.getLocalName().equals("ID"))) { if ((item.getLocalName() != null) && (item.getLocalName().equals("ID"))) {
number = trimOrNull(item); number = XMLTools.trimOrNull(item);
} }
if ((item.getLocalName() != null) && (item.getLocalName().equals("TypeCode"))) { if ((item.getLocalName() != null) && (item.getLocalName().equals("TypeCode"))) {
typeCode = trimOrNull(item); typeCode = XMLTools.trimOrNull(item);
} }
if ((item.getLocalName() != null) && (item.getLocalName().equals("IssueDateTime"))) { if ((item.getLocalName() != null) && (item.getLocalName().equals("IssueDateTime"))) {
NodeList issueDateTimeChilds = item.getChildNodes(); NodeList issueDateTimeChilds = item.getChildNodes();
for (int issueDateChildIndex = 0; issueDateChildIndex < issueDateTimeChilds.getLength(); issueDateChildIndex++) { for (int issueDateChildIndex = 0; issueDateChildIndex < issueDateTimeChilds.getLength(); issueDateChildIndex++) {
if ((issueDateTimeChilds.item(issueDateChildIndex).getLocalName() != null) if ((issueDateTimeChilds.item(issueDateChildIndex).getLocalName() != null)
&& (issueDateTimeChilds.item(issueDateChildIndex).getLocalName().equals("DateTimeString"))) { && (issueDateTimeChilds.item(issueDateChildIndex).getLocalName().equals("DateTimeString"))) {
issueDate = new SimpleDateFormat("yyyyMMdd").parse(trimOrNull(issueDateTimeChilds.item(issueDateChildIndex))); issueDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(issueDateTimeChilds.item(issueDateChildIndex)));
} }
} }
} }
@@ -375,6 +358,7 @@ public class ZUGFeRDInvoiceImporter {
if (rootNode.equals("Invoice")) { if (rootNode.equals("Invoice")) {
// UBL... // UBL...
number = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"ID\"]").trim(); number = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"ID\"]").trim();
typeCode = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"InvoiceTypeCode\"]").trim();
issueDate = new SimpleDateFormat("yyyy-MM-dd").parse(extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"IssueDate\"]").trim()); issueDate = new SimpleDateFormat("yyyy-MM-dd").parse(extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"IssueDate\"]").trim());
String dueDt = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"DueDate\"]").trim(); String dueDt = extractString("//*[local-name()=\"Invoice\"]/*[local-name()=\"DueDate\"]").trim();
if (dueDt.length() > 0) { if (dueDt.length() > 0) {
@@ -402,7 +386,7 @@ public class ZUGFeRDInvoiceImporter {
for (int occurenceChildIndex = 0; occurenceChildIndex < occurenceChilds.getLength(); occurenceChildIndex++) { for (int occurenceChildIndex = 0; occurenceChildIndex < occurenceChilds.getLength(); occurenceChildIndex++) {
if ((occurenceChilds.item(occurenceChildIndex).getLocalName() != null) if ((occurenceChilds.item(occurenceChildIndex).getLocalName() != null)
&& (occurenceChilds.item(occurenceChildIndex).getLocalName().equals("DateTimeString"))) { && (occurenceChilds.item(occurenceChildIndex).getLocalName().equals("DateTimeString"))) {
deliveryDate = new SimpleDateFormat("yyyyMMdd").parse(trimOrNull(occurenceChilds.item(occurenceChildIndex))); deliveryDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(occurenceChilds.item(occurenceChildIndex)));
} }
} }
} }
@@ -414,7 +398,7 @@ public class ZUGFeRDInvoiceImporter {
for (int despatchAdviceChildIndex = 0; despatchAdviceChildIndex < despatchAdviceChilds.getLength(); despatchAdviceChildIndex++) { for (int despatchAdviceChildIndex = 0; despatchAdviceChildIndex < despatchAdviceChilds.getLength(); despatchAdviceChildIndex++) {
if (despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName() != null if (despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName() != null
&& despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName().equals("IssuerAssignedID")) { && despatchAdviceChilds.item(despatchAdviceChildIndex).getLocalName().equals("IssuerAssignedID")) {
despatchAdviceReferencedDocument = trimOrNull(despatchAdviceChilds.item(despatchAdviceChildIndex)); despatchAdviceReferencedDocument = XMLTools.trimOrNull(despatchAdviceChilds.item(despatchAdviceChildIndex));
} }
} }
} }
@@ -427,7 +411,7 @@ public class ZUGFeRDInvoiceImporter {
String buyerOrderIssuerAssignedID = null; String buyerOrderIssuerAssignedID = null;
String sellerOrderIssuerAssignedID = null; String sellerOrderIssuerAssignedID = null;
for (int i = 0; i < headerTradeAgreementNodes.getLength(); i++) { for (int i = 0; i < headerTradeAgreementNodes.getLength(); i++) {
// trimOrNull(nodes.item(i)))) { // XMLTools.trimOrNull(nodes.item(i)))) {
Node headerTradeAgreementNode = headerTradeAgreementNodes.item(i); Node headerTradeAgreementNode = headerTradeAgreementNodes.item(i);
NodeList headerTradeAgreementChilds = headerTradeAgreementNode.getChildNodes(); NodeList headerTradeAgreementChilds = headerTradeAgreementNode.getChildNodes();
for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds.getLength(); agreementChildIndex++) { for (int agreementChildIndex = 0; agreementChildIndex < headerTradeAgreementChilds.getLength(); agreementChildIndex++) {
@@ -437,7 +421,7 @@ public class ZUGFeRDInvoiceImporter {
for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds.getLength(); buyerOrderChildIndex++) { for (int buyerOrderChildIndex = 0; buyerOrderChildIndex < buyerOrderChilds.getLength(); buyerOrderChildIndex++) {
if ((buyerOrderChilds.item(buyerOrderChildIndex).getLocalName() != null) if ((buyerOrderChilds.item(buyerOrderChildIndex).getLocalName() != null)
&& (buyerOrderChilds.item(buyerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) { && (buyerOrderChilds.item(buyerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) {
buyerOrderIssuerAssignedID = trimOrNull(buyerOrderChilds.item(buyerOrderChildIndex)); buyerOrderIssuerAssignedID = XMLTools.trimOrNull(buyerOrderChilds.item(buyerOrderChildIndex));
} }
} }
} }
@@ -447,7 +431,7 @@ public class ZUGFeRDInvoiceImporter {
for (int sellerOrderChildIndex = 0; sellerOrderChildIndex < sellerOrderChilds.getLength(); sellerOrderChildIndex++) { for (int sellerOrderChildIndex = 0; sellerOrderChildIndex < sellerOrderChilds.getLength(); sellerOrderChildIndex++) {
if ((sellerOrderChilds.item(sellerOrderChildIndex).getLocalName() != null) if ((sellerOrderChilds.item(sellerOrderChildIndex).getLocalName() != null)
&& (sellerOrderChilds.item(sellerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) { && (sellerOrderChilds.item(sellerOrderChildIndex).getLocalName().equals("IssuerAssignedID"))) {
sellerOrderIssuerAssignedID = trimOrNull(sellerOrderChilds.item(sellerOrderChildIndex)); sellerOrderIssuerAssignedID = XMLTools.trimOrNull(sellerOrderChilds.item(sellerOrderChildIndex));
} }
} }
} }
@@ -466,7 +450,7 @@ public class ZUGFeRDInvoiceImporter {
String IBAN = null, BIC = null; String IBAN = null, BIC = null;
for (int i = 0; i < headerTradeSettlementNodes.getLength(); i++) { for (int i = 0; i < headerTradeSettlementNodes.getLength(); i++) {
// trimOrNull(nodes.item(i)))) { // XMLTools.trimOrNull(nodes.item(i)))) {
Node headerTradeSettlementNode = headerTradeSettlementNodes.item(i); Node headerTradeSettlementNode = headerTradeSettlementNodes.item(i);
NodeList headerTradeSettlementChilds = headerTradeSettlementNode.getChildNodes(); NodeList headerTradeSettlementChilds = headerTradeSettlementNode.getChildNodes();
@@ -479,7 +463,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes(); NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes();
for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) { for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) {
if ((dueDateChilds.item(dueDateChildIndex).getLocalName() != null) && (dueDateChilds.item(dueDateChildIndex).getLocalName().equals("DateTimeString"))) { if ((dueDateChilds.item(dueDateChildIndex).getLocalName() != null) && (dueDateChilds.item(dueDateChildIndex).getLocalName().equals("DateTimeString"))) {
dueDate = new SimpleDateFormat("yyyyMMdd").parse(trimOrNull(dueDateChilds.item(dueDateChildIndex))); dueDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(dueDateChilds.item(dueDateChildIndex)));
} }
} }
} }
@@ -500,7 +484,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes(); NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) { for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
IBAN = trimOrNull(accountChilds.item(accountChildIndex)); IBAN = XMLTools.trimOrNull(accountChilds.item(accountChildIndex));
} }
} }
} }
@@ -508,7 +492,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes(); NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) { for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("BICID"))) {//CII if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("BICID"))) {//CII
BIC = trimOrNull(accountChilds.item(accountChildIndex)); BIC = XMLTools.trimOrNull(accountChilds.item(accountChildIndex));
} }
} }
} }
@@ -531,7 +515,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList startPeriodChilds = periodChilds.item(periodChildIndex).getChildNodes(); NodeList startPeriodChilds = periodChilds.item(periodChildIndex).getChildNodes();
for (int startPeriodIndex = 0; startPeriodIndex < startPeriodChilds.getLength(); startPeriodIndex++) { for (int startPeriodIndex = 0; startPeriodIndex < startPeriodChilds.getLength(); startPeriodIndex++) {
if ((startPeriodChilds.item(startPeriodIndex).getLocalName() != null) && (startPeriodChilds.item(startPeriodIndex).getLocalName().equals("DateTimeString"))) {//CII if ((startPeriodChilds.item(startPeriodIndex).getLocalName() != null) && (startPeriodChilds.item(startPeriodIndex).getLocalName().equals("DateTimeString"))) {//CII
deliveryPeriodStart = trimOrNull(startPeriodChilds.item(startPeriodIndex)); deliveryPeriodStart = XMLTools.trimOrNull(startPeriodChilds.item(startPeriodIndex));
} }
} }
} }
@@ -539,7 +523,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList endPeriodChilds = periodChilds.item(periodChildIndex).getChildNodes(); NodeList endPeriodChilds = periodChilds.item(periodChildIndex).getChildNodes();
for (int endPeriodIndex = 0; endPeriodIndex < endPeriodChilds.getLength(); endPeriodIndex++) { for (int endPeriodIndex = 0; endPeriodIndex < endPeriodChilds.getLength(); endPeriodIndex++) {
if ((endPeriodChilds.item(endPeriodIndex).getLocalName() != null) && (endPeriodChilds.item(endPeriodIndex).getLocalName().equals("DateTimeString"))) {//CII if ((endPeriodChilds.item(endPeriodIndex).getLocalName() != null) && (endPeriodChilds.item(endPeriodIndex).getLocalName().equals("DateTimeString"))) {//CII
deliveryPeriodEnd = trimOrNull(endPeriodChilds.item(endPeriodIndex)); deliveryPeriodEnd = XMLTools.trimOrNull(endPeriodChilds.item(endPeriodIndex));
} }
} }
} }
@@ -558,7 +542,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList paymentMeansNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList paymentMeansNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
for (int i = 0; i < paymentMeansNodes.getLength(); i++) { for (int i = 0; i < paymentMeansNodes.getLength(); i++) {
// trimOrNull(nodes.item(i)))) { // XMLTools.trimOrNull(nodes.item(i)))) {
Node paymentMeansNode = paymentMeansNodes.item(i); Node paymentMeansNode = paymentMeansNodes.item(i);
NodeList paymentMeansChilds = paymentMeansNode.getChildNodes(); NodeList paymentMeansChilds = paymentMeansNode.getChildNodes();
for (int meansChildIndex = 0; meansChildIndex < paymentMeansChilds.getLength(); meansChildIndex++) { for (int meansChildIndex = 0; meansChildIndex < paymentMeansChilds.getLength(); meansChildIndex++) {
@@ -567,7 +551,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList paymentTermChilds = paymentMeansChilds.item(meansChildIndex).getChildNodes(); NodeList paymentTermChilds = paymentMeansChilds.item(meansChildIndex).getChildNodes();
for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) { for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) {
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("ID"))) { if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
IBAN = trimOrNull(paymentTermChilds.item(paymentTermChildIndex)); IBAN = XMLTools.trimOrNull(paymentTermChilds.item(paymentTermChildIndex));
if (IBAN != null) { if (IBAN != null) {
BankDetails bd = new BankDetails(IBAN); BankDetails bd = new BankDetails(IBAN);
bankDetails.add(bd); bankDetails.add(bd);
@@ -607,7 +591,7 @@ public class ZUGFeRDInvoiceImporter {
String buyerReference = null; String buyerReference = null;
prepaidNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); prepaidNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
if (prepaidNodes.getLength() > 0) { if (prepaidNodes.getLength() > 0) {
buyerReference = trimOrNull(prepaidNodes.item(0)); buyerReference = XMLTools.trimOrNull(prepaidNodes.item(0));
} }
if (buyerReference != null) { if (buyerReference != null) {
zpp.setReferenceNumber(buyerReference); zpp.setReferenceNumber(buyerReference);
@@ -629,7 +613,7 @@ public class ZUGFeRDInvoiceImporter {
xpr = xpath.compile("//*[local-name()=\"AttachmentBinaryObject\"]|//*[local-name()=\"EmbeddedDocumentBinaryObject\"]"); xpr = xpath.compile("//*[local-name()=\"AttachmentBinaryObject\"]|//*[local-name()=\"EmbeddedDocumentBinaryObject\"]");
NodeList attachmentNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); NodeList attachmentNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
for (int i = 0; i < attachmentNodes.getLength(); i++) { for (int i = 0; i < attachmentNodes.getLength(); i++) {
FileAttachment fa = new FileAttachment(attachmentNodes.item(i).getAttributes().getNamedItem("filename").getNodeValue(), attachmentNodes.item(i).getAttributes().getNamedItem("mimeCode").getNodeValue(), "Data", Base64.getDecoder().decode(trimOrNull(attachmentNodes.item(i)))); FileAttachment fa = new FileAttachment(attachmentNodes.item(i).getAttributes().getNamedItem("filename").getNodeValue(), attachmentNodes.item(i).getAttributes().getNamedItem("mimeCode").getNodeValue(), "Data", Base64.getDecoder().decode(XMLTools.trimOrNull(attachmentNodes.item(i))));
fileAttachments.add(fa); fileAttachments.add(fa);
// filename = "Aufmass.png" mimeCode = "image/png" // filename = "Aufmass.png" mimeCode = "image/png"
//EmbeddedDocumentBinaryObject cbc:EmbeddedDocumentBinaryObject mimeCode="image/png" filename="Aufmass.png" //EmbeddedDocumentBinaryObject cbc:EmbeddedDocumentBinaryObject mimeCode="image/png" filename="Aufmass.png"
@@ -657,21 +641,21 @@ public class ZUGFeRDInvoiceImporter {
for (int indicatorChildIndex = 0; indicatorChildIndex < indicatorChilds.getLength(); indicatorChildIndex++) { for (int indicatorChildIndex = 0; indicatorChildIndex < indicatorChilds.getLength(); indicatorChildIndex++) {
if ((indicatorChilds.item(indicatorChildIndex).getLocalName() != null) if ((indicatorChilds.item(indicatorChildIndex).getLocalName() != null)
&& (indicatorChilds.item(indicatorChildIndex).getLocalName().equals("Indicator"))) { && (indicatorChilds.item(indicatorChildIndex).getLocalName().equals("Indicator"))) {
isCharge = trimOrNull(indicatorChilds.item(indicatorChildIndex)).equalsIgnoreCase("true"); isCharge = XMLTools.trimOrNull(indicatorChilds.item(indicatorChildIndex)).equalsIgnoreCase("true");
} }
} }
} else if (chargeChildName.equals("ActualAmount")) { } else if (chargeChildName.equals("ActualAmount")) {
chargeAmount = trimOrNull(chargeNodeChilds.item(chargeChildIndex)); chargeAmount = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex));
} else if (chargeChildName.equals("Reason")) { } else if (chargeChildName.equals("Reason")) {
reason = trimOrNull(chargeNodeChilds.item(chargeChildIndex)); reason = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex));
} else if (chargeChildName.equals("ReasonCode")) { } else if (chargeChildName.equals("ReasonCode")) {
reasonCode = trimOrNull(chargeNodeChilds.item(chargeChildIndex)); reasonCode = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex));
} else if (chargeChildName.equals("CategoryTradeTax")) { } else if (chargeChildName.equals("CategoryTradeTax")) {
NodeList taxChilds = chargeNodeChilds.item(chargeChildIndex).getChildNodes(); NodeList taxChilds = chargeNodeChilds.item(chargeChildIndex).getChildNodes();
for (int taxChildIndex = 0; taxChildIndex < taxChilds.getLength(); taxChildIndex++) { for (int taxChildIndex = 0; taxChildIndex < taxChilds.getLength(); taxChildIndex++) {
String taxItemName = taxChilds.item(taxChildIndex).getLocalName(); String taxItemName = taxChilds.item(taxChildIndex).getLocalName();
if ((taxItemName != null) && (taxItemName.equals("RateApplicablePercent") || taxItemName.equals("ApplicablePercent"))) { if ((taxItemName != null) && (taxItemName.equals("RateApplicablePercent") || taxItemName.equals("ApplicablePercent"))) {
taxPercent = trimOrNull(taxChilds.item(taxChildIndex)); taxPercent = XMLTools.trimOrNull(taxChilds.item(taxChildIndex));
} }
} }
} }
@@ -721,7 +705,7 @@ public class ZUGFeRDInvoiceImporter {
&& ((!expectedStringTotalGross.equals(XMLTools.nDigitFormat(expectedGrandTotal, 2))) && ((!expectedStringTotalGross.equals(XMLTools.nDigitFormat(expectedGrandTotal, 2)))
&& (!ignoreCalculationErrors))) { && (!ignoreCalculationErrors))) {
throw new ParseException( throw new ParseException(
"Could not reproduce the invoice, this could mean that it could not be read properly exp "+expectedStringTotalGross+" is "+XMLTools.nDigitFormat(expectedGrandTotal, 2), 0); "Could not reproduce the invoice, this could mean that it could not be read properly", 0);
} }
} }
return zpp; return zpp;

View File

@@ -64,7 +64,7 @@
<x:xmpmeta xmlns:x="adobe:ns:meta/"> <x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title><xsl:value-of select="xr:Invoice_number"/></dc:title> <dc:title><rdf:Alt><rdf:li xml:lang="x-default"><xsl:value-of select="xr:Invoice_number"/></rdf:li></rdf:Alt></dc:title>
<!-- <!--
<dc:creator></dc:creator> <dc:creator></dc:creator>
<dc:description></dc:description> <dc:description></dc:description>

View File

@@ -130,5 +130,60 @@ public class DeSerializationTest extends TestCase {
public void testDueDateRoundtrip() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
// [{"stringValue":"a","intValue":1,"booleanValue":true},
// {"stringValue":"bc","intValue":3,"booleanValue":false}]
Invoice fromJSON = mapper.readValue("{\n" +
" \"number\": \"RE - 228\",\n" +
" \"currency\": \"EUR\",\n" +
" \"issueDate\": \"2024-10-24\",\n" +
" \"dueDate\": \"2024-10-26\",\n" +
" \"deliveryDate\": \"2024-10-25\",\n" +
" \"sender\": {\n" +
" \"name\": \"Amazing Company\",\n" +
" \"zip\": \"10000\",\n" +
" \"street\": \"Straße der Kosmonauten 20\",\n" +
" \"location\": \"Berlin\",\n" +
" \"country\": \"DE\",\n" +
" \"taxID\": \"201/113/40209\",\n" +
" \"vatID\": \"DE123456789\",\n" +
" \"globalID\": \"4000001123452\",\n" +
" \"globalIDScheme\": \"0088\"\n" +
" },\n" +
" \"recipient\": {\n" +
" \"name\": \"Amazing Company\",\n" +
" \"zip\": \"1000\",\n" +
" \"street\": \"Straße der Kosmonauten 10\",\n" +
" \"location\": \"Berlin\",\n" +
" \"taxID\": \"201/113/40209\",\n" +
" \"vatID\": \"DE123456789\",\n" +
" \"country\": \"DE\"\n" +
" },\n" +
" \"zfitems\": [\n" +
" {\n" +
" \"price\": 99.9,\n" +
" \"quantity\": 10,\n" +
" \"product\": {\n" +
" \"unit\": \"H87\",\n" +
" \"name\": \"Amazing Archives\",\n" +
" \"description\": \"123\",\n" +
" \"vatpercent\": \"19\",\n" +
" \"taxCategoryCode\": \"3\"\n" +
" }\n" +
" }\n" +
" ]\n" +
"}\n", Invoice.class);
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
zf2p.setProfile(Profiles.getByName("XRechnung"));
zf2p.generateXML(fromJSON);
String theXML = new String(zf2p.getXML());
assertTrue(theXML.contains("<udt:DateTimeString format=\"102\">20241026</udt:DateTimeString>"));
}
} }

View File

@@ -21,6 +21,7 @@
*/ */
package org.mustangproject.ZUGFeRD; package org.mustangproject.ZUGFeRD;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.mustangproject.*; import org.mustangproject.*;
@@ -351,34 +352,79 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
} }
public void testEEISI_300_cii_Import() {
public void testImportMinimum() {
File CIIinputFile = getResourceAsFile("cii/facturFrMinimum.xml");
try {
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
CalculatedInvoice i=new CalculatedInvoice();
zii.extractInto(i);
assertEquals("671.15", i.getGrandTotal().toString());
} catch (IOException e) {
fail("IOException not expected");
} catch (XPathExpressionException e) {
throw new RuntimeException(e);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}
public void testEEISI_300_cii_Import() throws XPathExpressionException, ParseException {
boolean hasExceptions = false; boolean hasExceptions = false;
/* File input = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.cii.xml"); File inputCII = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.cii.xml");
File inputUBL = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.ubl.xml");
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(); ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter();
try { try {
zii.fromXML(new String(Files.readAllBytes(input.toPath()), StandardCharsets.UTF_8)); zii.fromXML(new String(Files.readAllBytes(inputCII.toPath()), StandardCharsets.UTF_8));
} catch (IOException e) { } catch (IOException e) {
hasExceptions = true; hasExceptions = true;
} }
Invoice invoice = null; Invoice invoiceUBL = null;
invoiceUBL = zii.extractInvoice();
try { try {
invoice = zii.extractInvoice(); zii.fromXML(new String(Files.readAllBytes(inputUBL.toPath()), StandardCharsets.UTF_8));
assertEquals("Seller contact point",invoice.getSender().getName());
} catch (IOException e) {
hasExceptions = true;
}
Invoice invoiceCII = null;
try {
invoiceCII = zii.extractInvoice();
ObjectMapper mapper = new ObjectMapper();
String ubl=mapper.writeValueAsString(invoiceUBL);
String cii=mapper.writeValueAsString(invoiceCII);
assertEquals(cii,ubl);
/* /*
<cbc:Name>Seller contact point</cbc:Name> <cbc:Name>Seller contact point</cbc:Name>
<cbc:Telephone>+41 345 654455</cbc:Telephone> <cbc:Telephone>+41 345 654455</cbc:Telephone>
<cbc:ElectronicMail>seller@contact.de);* <cbc:ElectronicMail>seller@contact.de);*/
} catch (XPathExpressionException | ParseException e) { } catch (XPathExpressionException | ParseException e) {
hasExceptions = true; hasExceptions = true;
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
} }
assertFalse(hasExceptions); assertFalse(hasExceptions);
TransactionCalculator tc = new TransactionCalculator(invoice);
TransactionCalculator tc = new TransactionCalculator(invoiceCII);
assertEquals(new BigDecimal("205.00"), tc.getGrandTotal()); assertEquals(new BigDecimal("205.00"), tc.getGrandTotal());
*/
} }

View File

@@ -0,0 +1,56 @@
<?xml version='1.0' encoding='UTF-8'?>
<rsm:CrossIndustryInvoice xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:factur-x.eu:1p0:minimum</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>FA-2017-0010</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20171113</udt:DateTimeString>
</ram:IssueDateTime>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:Name>Au bon moulin</ram:Name>
<ram:SpecifiedLegalOrganization>
<ram:ID schemeID="0002">99999999800010</ram:ID>
</ram:SpecifiedLegalOrganization>
<ram:PostalTradeAddress>
<ram:CountryID>FR</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">FR11999999998</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Ma jolie boutique</ram:Name>
<ram:SpecifiedLegalOrganization>
<ram:ID schemeID="0002">78787878400035</ram:ID>
</ram:SpecifiedLegalOrganization>
<ram:PostalTradeAddress>
<ram:CountryID>FR</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">FR19787878784</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:BuyerTradeParty>
<ram:BuyerOrderReferencedDocument>
<ram:IssuerAssignedID>PO445</ram:IssuerAssignedID>
</ram:BuyerOrderReferencedDocument>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:TaxBasisTotalAmount currencyID="EUR">624.90</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">46.25</ram:TaxTotalAmount>
<ram:GrandTotalAmount currencyID="EUR">671.15</ram:GrandTotalAmount>
<ram:DuePayableAmount currencyID="EUR">470.15</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

View File

@@ -1,415 +1,415 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"> xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext> <rsm:ExchangedDocumentContext>
<ram:BusinessProcessSpecifiedDocumentContextParameter> <ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:ID>BT-23 Business Process Type</ram:ID> <ram:ID>BT-23 Business Process Type</ram:ID>
</ram:BusinessProcessSpecifiedDocumentContextParameter> </ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:GuidelineSpecifiedDocumentContextParameter> <ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017</ram:ID> <ram:ID>urn:cen.eu:en16931:2017</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter> </ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext> </rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument> <rsm:ExchangedDocument>
<ram:ID>Test_EeISI_100</ram:ID> <ram:ID>Test_EeISI_100</ram:ID>
<ram:TypeCode>380</ram:TypeCode> <ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime> <ram:IssueDateTime>
<udt:DateTimeString format="102">20181112</udt:DateTimeString>
</ram:IssueDateTime>
<ram:IncludedNote>
<ram:Content>invoice note text</ram:Content>
<ram:SubjectCode>AAA</ram:SubjectCode>
</ram:IncludedNote>
<ram:IncludedNote>
<ram:Content>invoice note text 2</ram:Content>
<ram:SubjectCode>AAA</ram:SubjectCode>
</ram:IncludedNote>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>1a</ram:LineID>
<ram:IncludedNote>
<ram:Content>Invoice line note</ram:Content>
</ram:IncludedNote>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:GlobalID schemeID="0060">Item standar identifier
</ram:GlobalID>
<ram:SellerAssignedID>Item seller's identifier</ram:SellerAssignedID>
<ram:BuyerAssignedID>Item buyer's identifier</ram:BuyerAssignedID>
<ram:Name>Item name</ram:Name>
<ram:Description>Item description</ram:Description>
<ram:ApplicableProductCharacteristic>
<ram:Description>Color</ram:Description>
<ram:Value>Red</ram:Value>
</ram:ApplicableProductCharacteristic>
<ram:ApplicableProductCharacteristic>
<ram:Description>Size</ram:Description>
<ram:Value>L</ram:Value>
</ram:ApplicableProductCharacteristic>
<ram:DesignatedProductClassification>
<ram:ClassCode listID="ZZZ" listVersionID="version0">Item classification identifier0</ram:ClassCode>
</ram:DesignatedProductClassification>
<ram:OriginTradeCountry>
<ram:ID>IT</ram:ID>
</ram:OriginTradeCountry>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:BuyerOrderReferencedDocument>
<ram:LineID>12345</ram:LineID>
</ram:BuyerOrderReferencedDocument>
<ram:GrossPriceProductTradePrice>
<ram:ChargeAmount>11.00</ram:ChargeAmount>
<ram:BasisQuantity unitCode="EA">1.00</ram:BasisQuantity>
<ram:AppliedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>false</udt:Indicator>
</ram:ChargeIndicator>
<ram:ActualAmount>1.00</ram:ActualAmount>
</ram:AppliedTradeAllowanceCharge>
</ram:GrossPriceProductTradePrice>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>10.00</ram:ChargeAmount>
<ram:BasisQuantity unitCode="EA">1.00</ram:BasisQuantity>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="EA">10.00</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20181112</udt:DateTimeString> <udt:DateTimeString format="102">20181112</udt:DateTimeString>
</ram:StartDateTime> </ram:IssueDateTime>
<ram:EndDateTime> <ram:IncludedNote>
<udt:DateTimeString format="102">20181130</udt:DateTimeString> <ram:Content>invoice note text</ram:Content>
</ram:EndDateTime> <ram:SubjectCode>AAA</ram:SubjectCode>
</ram:BillingSpecifiedPeriod> </ram:IncludedNote>
<ram:SpecifiedTradeAllowanceCharge> <ram:IncludedNote>
<ram:ChargeIndicator> <ram:Content>invoice note text 2</ram:Content>
<udt:Indicator>false</udt:Indicator> <ram:SubjectCode>AAA</ram:SubjectCode>
</ram:ChargeIndicator> </ram:IncludedNote>
<ram:CalculationPercent>1.00</ram:CalculationPercent> </rsm:ExchangedDocument>
<ram:BasisAmount>1000.00</ram:BasisAmount> <rsm:SupplyChainTradeTransaction>
<ram:ActualAmount>10.00</ram:ActualAmount> <ram:IncludedSupplyChainTradeLineItem>
<ram:ReasonCode>95</ram:ReasonCode> <ram:AssociatedDocumentLineDocument>
<ram:Reason>Invoice line allowance reason</ram:Reason> <ram:LineID>1a</ram:LineID>
</ram:SpecifiedTradeAllowanceCharge> <ram:IncludedNote>
<ram:SpecifiedTradeAllowanceCharge> <ram:Content>Invoice line note</ram:Content>
<ram:ChargeIndicator> </ram:IncludedNote>
<udt:Indicator>true</udt:Indicator> </ram:AssociatedDocumentLineDocument>
</ram:ChargeIndicator> <ram:SpecifiedTradeProduct>
<ram:CalculationPercent>1.00</ram:CalculationPercent> <ram:GlobalID schemeID="0060">Item standar identifier
<ram:BasisAmount>1000.00</ram:BasisAmount> </ram:GlobalID>
<ram:ActualAmount>10.00</ram:ActualAmount>
<ram:ReasonCode>AAA</ram:ReasonCode> <ram:SellerAssignedID>Item seller's identifier</ram:SellerAssignedID>
<ram:Reason>Invoice line charge reason</ram:Reason> <ram:BuyerAssignedID>Item buyer's identifier</ram:BuyerAssignedID>
</ram:SpecifiedTradeAllowanceCharge> <ram:Name>Item name</ram:Name>
<ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:Description>Item description</ram:Description>
<ram:LineTotalAmount>1000.00</ram:LineTotalAmount> <ram:ApplicableProductCharacteristic>
</ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:Description>Color</ram:Description>
<ram:AdditionalReferencedDocument> <ram:Value>Red</ram:Value>
<ram:IssuerAssignedID>Line object identifier</ram:IssuerAssignedID> </ram:ApplicableProductCharacteristic>
<ram:TypeCode>130</ram:TypeCode> <ram:ApplicableProductCharacteristic>
</ram:AdditionalReferencedDocument> <ram:Description>Size</ram:Description>
<ram:ReceivableSpecifiedTradeAccountingAccount> <ram:Value>L</ram:Value>
<ram:ID>6789</ram:ID> </ram:ApplicableProductCharacteristic>
</ram:ReceivableSpecifiedTradeAccountingAccount> <ram:DesignatedProductClassification>
</ram:SpecifiedLineTradeSettlement> <ram:ClassCode listID="ZZZ" listVersionID="version0">Item classification identifier0</ram:ClassCode>
</ram:IncludedSupplyChainTradeLineItem> </ram:DesignatedProductClassification>
<ram:IncludedSupplyChainTradeLineItem> <ram:OriginTradeCountry>
<ram:AssociatedDocumentLineDocument> <ram:ID>IT</ram:ID>
<ram:LineID>1b</ram:LineID> </ram:OriginTradeCountry>
</ram:AssociatedDocumentLineDocument> </ram:SpecifiedTradeProduct>
<ram:SpecifiedTradeProduct> <ram:SpecifiedLineTradeAgreement>
<ram:Name>Item name 2</ram:Name> <ram:BuyerOrderReferencedDocument>
</ram:SpecifiedTradeProduct> <ram:LineID>12345</ram:LineID>
<ram:SpecifiedLineTradeAgreement> </ram:BuyerOrderReferencedDocument>
<ram:NetPriceProductTradePrice> <ram:GrossPriceProductTradePrice>
<ram:ChargeAmount>10.00</ram:ChargeAmount> <ram:ChargeAmount>11.00</ram:ChargeAmount>
</ram:NetPriceProductTradePrice> <ram:BasisQuantity unitCode="EA">1.00</ram:BasisQuantity>
</ram:SpecifiedLineTradeAgreement> <ram:AppliedTradeAllowanceCharge>
<ram:SpecifiedLineTradeDelivery> <ram:ChargeIndicator>
<ram:BilledQuantity unitCode="EA">10.00</ram:BilledQuantity> <udt:Indicator>false</udt:Indicator>
</ram:SpecifiedLineTradeDelivery> </ram:ChargeIndicator>
<ram:SpecifiedLineTradeSettlement> <ram:ActualAmount>1.00</ram:ActualAmount>
<ram:ApplicableTradeTax> </ram:AppliedTradeAllowanceCharge>
<ram:TypeCode>VAT</ram:TypeCode> </ram:GrossPriceProductTradePrice>
<ram:CategoryCode>E</ram:CategoryCode> <ram:NetPriceProductTradePrice>
<ram:RateApplicablePercent>0.00</ram:RateApplicablePercent> <ram:ChargeAmount>10.00</ram:ChargeAmount>
</ram:ApplicableTradeTax> <ram:BasisQuantity unitCode="EA">1.00</ram:BasisQuantity>
<ram:SpecifiedTradeSettlementLineMonetarySummation> </ram:NetPriceProductTradePrice>
<ram:LineTotalAmount>1000.00</ram:LineTotalAmount> </ram:SpecifiedLineTradeAgreement>
</ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:SpecifiedLineTradeDelivery>
</ram:SpecifiedLineTradeSettlement> <ram:BilledQuantity unitCode="EA">10.00</ram:BilledQuantity>
</ram:IncludedSupplyChainTradeLineItem> </ram:SpecifiedLineTradeDelivery>
<ram:ApplicableHeaderTradeAgreement> <ram:SpecifiedLineTradeSettlement>
<ram:BuyerReference>123</ram:BuyerReference> <ram:ApplicableTradeTax>
<ram:SellerTradeParty> <ram:TypeCode>VAT</ram:TypeCode>
<ram:GlobalID schemeID="0100">Seller identifier 1</ram:GlobalID> <ram:CategoryCode>S</ram:CategoryCode>
<ram:GlobalID schemeID="0110">Seller identifier 2</ram:GlobalID> <ram:RateApplicablePercent>5.00</ram:RateApplicablePercent>
<ram:Name>Seller name</ram:Name> </ram:ApplicableTradeTax>
<ram:Description>Seller additional legal information</ram:Description> <ram:BillingSpecifiedPeriod>
<ram:SpecifiedLegalOrganization> <ram:StartDateTime>
<!-- <ram:ID schemeID="0310">Seller legal identifier</ram:ID> --> <udt:DateTimeString format="102">20181112</udt:DateTimeString>
<ram:TradingBusinessName>Seller trading name</ram:TradingBusinessName> </ram:StartDateTime>
</ram:SpecifiedLegalOrganization> <ram:EndDateTime>
<ram:DefinedTradeContact> <udt:DateTimeString format="102">20181130</udt:DateTimeString>
<ram:PersonName>Seller contact point</ram:PersonName> </ram:EndDateTime>
<ram:TelephoneUniversalCommunication> </ram:BillingSpecifiedPeriod>
<ram:CompleteNumber>+41 345 654455</ram:CompleteNumber> <ram:SpecifiedTradeAllowanceCharge>
</ram:TelephoneUniversalCommunication> <ram:ChargeIndicator>
<ram:EmailURIUniversalCommunication> <udt:Indicator>false</udt:Indicator>
<ram:URIID>seller@contact.de</ram:URIID> </ram:ChargeIndicator>
</ram:EmailURIUniversalCommunication> <ram:CalculationPercent>1.00</ram:CalculationPercent>
</ram:DefinedTradeContact> <ram:BasisAmount>100.00</ram:BasisAmount>
<ram:PostalTradeAddress> <ram:ActualAmount>10.00</ram:ActualAmount>
<ram:PostcodeCode>12345</ram:PostcodeCode> <ram:ReasonCode>95</ram:ReasonCode>
<ram:LineOne>Seller address line 1</ram:LineOne> <ram:Reason>Invoice line allowance reason</ram:Reason>
<ram:LineTwo>Seller address line 2</ram:LineTwo> </ram:SpecifiedTradeAllowanceCharge>
<ram:LineThree>Seller address line 3</ram:LineThree> <ram:SpecifiedTradeAllowanceCharge>
<ram:CityName>Seller city</ram:CityName> <ram:ChargeIndicator>
<ram:CountryID>DE</ram:CountryID> <udt:Indicator>true</udt:Indicator>
<ram:CountrySubDivisionName>Seller country subdivision</ram:CountrySubDivisionName> </ram:ChargeIndicator>
</ram:PostalTradeAddress> <ram:CalculationPercent>1.00</ram:CalculationPercent>
<ram:URIUniversalCommunication> <ram:BasisAmount>100.00</ram:BasisAmount>
<ram:URIID schemeID="EM">Seller electronic address</ram:URIID> <ram:ActualAmount>10.00</ram:ActualAmount>
</ram:URIUniversalCommunication> <ram:ReasonCode>AAA</ram:ReasonCode>
<ram:SpecifiedTaxRegistration> <ram:Reason>Invoice line charge reason</ram:Reason>
<ram:ID schemeID="VA">DE12345677</ram:ID> </ram:SpecifiedTradeAllowanceCharge>
</ram:SpecifiedTaxRegistration> <ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:SpecifiedTaxRegistration> <ram:LineTotalAmount>100.00</ram:LineTotalAmount>
<ram:ID schemeID="FC">DE49294093</ram:ID> </ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedTaxRegistration> <ram:AdditionalReferencedDocument>
</ram:SellerTradeParty> <ram:IssuerAssignedID>Line object identifier</ram:IssuerAssignedID>
<ram:BuyerTradeParty> <ram:TypeCode>130</ram:TypeCode>
<ram:GlobalID schemeID="0190">Buyer identifier</ram:GlobalID> </ram:AdditionalReferencedDocument>
<ram:Name>Buyer name</ram:Name> <ram:ReceivableSpecifiedTradeAccountingAccount>
<ram:SpecifiedLegalOrganization> <ram:ID>6789</ram:ID>
<ram:ID schemeID="0089">Buyer legal registration identifier</ram:ID> </ram:ReceivableSpecifiedTradeAccountingAccount>
<ram:TradingBusinessName>Buyer trading name</ram:TradingBusinessName> </ram:SpecifiedLineTradeSettlement>
</ram:SpecifiedLegalOrganization> </ram:IncludedSupplyChainTradeLineItem>
<ram:DefinedTradeContact> <ram:IncludedSupplyChainTradeLineItem>
<ram:PersonName>Buyer contact point</ram:PersonName> <ram:AssociatedDocumentLineDocument>
<ram:TelephoneUniversalCommunication> <ram:LineID>1b</ram:LineID>
<ram:CompleteNumber>+353 2948584</ram:CompleteNumber> </ram:AssociatedDocumentLineDocument>
</ram:TelephoneUniversalCommunication> <ram:SpecifiedTradeProduct>
<ram:EmailURIUniversalCommunication> <ram:Name>Item name 2</ram:Name>
<ram:URIID>buyer@contact.ie</ram:URIID> </ram:SpecifiedTradeProduct>
</ram:EmailURIUniversalCommunication> <ram:SpecifiedLineTradeAgreement>
</ram:DefinedTradeContact> <ram:NetPriceProductTradePrice>
<ram:PostalTradeAddress> <ram:ChargeAmount>10.00</ram:ChargeAmount>
<ram:PostcodeCode>34562</ram:PostcodeCode> </ram:NetPriceProductTradePrice>
<ram:LineOne>Buyer address line 1</ram:LineOne> </ram:SpecifiedLineTradeAgreement>
<ram:LineTwo>Buyer address line 2</ram:LineTwo> <ram:SpecifiedLineTradeDelivery>
<ram:LineThree>Buyer address line 3</ram:LineThree> <ram:BilledQuantity unitCode="EA">10.00</ram:BilledQuantity>
<ram:CityName>Buyer city</ram:CityName> </ram:SpecifiedLineTradeDelivery>
<ram:CountryID>IE</ram:CountryID> <ram:SpecifiedLineTradeSettlement>
<ram:CountrySubDivisionName>Buyer country subdivision</ram:CountrySubDivisionName> <ram:ApplicableTradeTax>
</ram:PostalTradeAddress> <ram:TypeCode>VAT</ram:TypeCode>
<ram:URIUniversalCommunication> <ram:CategoryCode>E</ram:CategoryCode>
<ram:URIID schemeID="EM">Buyer electronic address</ram:URIID> <ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
</ram:URIUniversalCommunication> </ram:ApplicableTradeTax>
<ram:SpecifiedTaxRegistration> <ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:ID schemeID="VA">IE394838894</ram:ID> <ram:LineTotalAmount>100.00</ram:LineTotalAmount>
</ram:SpecifiedTaxRegistration> </ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:BuyerTradeParty> </ram:SpecifiedLineTradeSettlement>
<ram:SellerTaxRepresentativeTradeParty> </ram:IncludedSupplyChainTradeLineItem>
<ram:Name>Tax representative name</ram:Name> <ram:ApplicableHeaderTradeAgreement>
<ram:PostalTradeAddress> <ram:BuyerReference>123</ram:BuyerReference>
<ram:PostcodeCode>23455</ram:PostcodeCode> <ram:SellerTradeParty>
<ram:LineOne>Tax representative address line 1</ram:LineOne> <ram:GlobalID schemeID="0100">Seller identifier 1</ram:GlobalID>
<ram:LineTwo>Tax representative address line 2</ram:LineTwo> <ram:GlobalID schemeID="0110">Seller identifier 2</ram:GlobalID>
<ram:LineThree>Tax representative address line 3</ram:LineThree> <ram:Name>Seller name</ram:Name>
<ram:CityName>Tax representative city</ram:CityName> <ram:Description>Seller additional legal information</ram:Description>
<ram:CountryID>DE</ram:CountryID> <ram:SpecifiedLegalOrganization>
<ram:CountrySubDivisionName>Tax representative country subdivision</ram:CountrySubDivisionName> <!-- <ram:ID schemeID="0310">Seller legal identifier</ram:ID> -->
</ram:PostalTradeAddress> <ram:TradingBusinessName>Seller trading name</ram:TradingBusinessName>
<ram:SpecifiedTaxRegistration> </ram:SpecifiedLegalOrganization>
<ram:ID schemeID="VA">DE3949053</ram:ID> <ram:DefinedTradeContact>
</ram:SpecifiedTaxRegistration> <ram:PersonName>Seller contact point</ram:PersonName>
</ram:SellerTaxRepresentativeTradeParty> <ram:TelephoneUniversalCommunication>
<ram:SellerOrderReferencedDocument> <ram:CompleteNumber>+41 345 654455</ram:CompleteNumber>
<ram:IssuerAssignedID>def</ram:IssuerAssignedID> </ram:TelephoneUniversalCommunication>
</ram:SellerOrderReferencedDocument> <ram:EmailURIUniversalCommunication>
<ram:BuyerOrderReferencedDocument> <ram:URIID>seller@contact.de</ram:URIID>
<ram:IssuerAssignedID>abc</ram:IssuerAssignedID> </ram:EmailURIUniversalCommunication>
</ram:BuyerOrderReferencedDocument> </ram:DefinedTradeContact>
<ram:ContractReferencedDocument> <ram:PostalTradeAddress>
<ram:IssuerAssignedID>789</ram:IssuerAssignedID> <ram:PostcodeCode>12345</ram:PostcodeCode>
</ram:ContractReferencedDocument> <ram:LineOne>Seller address line 1</ram:LineOne>
<ram:AdditionalReferencedDocument> <ram:LineTwo>Seller address line 2</ram:LineTwo>
<ram:IssuerAssignedID>Supporting document ref</ram:IssuerAssignedID> <ram:LineThree>Seller address line 3</ram:LineThree>
<ram:URIID>External document location</ram:URIID> <ram:CityName>Seller city</ram:CityName>
<ram:TypeCode>916</ram:TypeCode> <ram:CountryID>DE</ram:CountryID>
<ram:Name>Supporting document descr</ram:Name> <ram:CountrySubDivisionName>Seller country subdivision</ram:CountrySubDivisionName>
<ram:AttachmentBinaryObject mimeCode="application/pdf" filename="filename0">ZGVmYXVsdA==</ram:AttachmentBinaryObject> </ram:PostalTradeAddress>
</ram:AdditionalReferencedDocument> <ram:URIUniversalCommunication>
<ram:AdditionalReferencedDocument> <ram:URIID schemeID="EM">Seller electronic address</ram:URIID>
<ram:IssuerAssignedID>rst</ram:IssuerAssignedID> </ram:URIUniversalCommunication>
<ram:TypeCode>130</ram:TypeCode> <ram:SpecifiedTaxRegistration>
<ram:ReferenceTypeCode>AAA</ram:ReferenceTypeCode> <ram:ID schemeID="VA">DE12345677</ram:ID>
</ram:AdditionalReferencedDocument> </ram:SpecifiedTaxRegistration>
<ram:SpecifiedProcuringProject> <ram:SpecifiedTaxRegistration>
<ram:ID>456</ram:ID> <ram:ID schemeID="FC">DE49294093</ram:ID>
<ram:Name>Project reference</ram:Name> </ram:SpecifiedTaxRegistration>
</ram:SpecifiedProcuringProject> </ram:SellerTradeParty>
</ram:ApplicableHeaderTradeAgreement> <ram:BuyerTradeParty>
<ram:ApplicableHeaderTradeDelivery> <ram:GlobalID schemeID="0190">Buyer identifier</ram:GlobalID>
<ram:ShipToTradeParty> <ram:Name>Buyer name</ram:Name>
<ram:GlobalID schemeID="0045">deliver location identifier</ram:GlobalID> <ram:SpecifiedLegalOrganization>
<ram:Name>Deliver to party name</ram:Name> <ram:ID schemeID="0089">Buyer legal registration identifier</ram:ID>
<ram:PostalTradeAddress> <ram:TradingBusinessName>Buyer trading name</ram:TradingBusinessName>
<ram:PostcodeCode>98765</ram:PostcodeCode> </ram:SpecifiedLegalOrganization>
<ram:LineOne>Deliver to address line 1</ram:LineOne> <ram:DefinedTradeContact>
<ram:LineTwo>Deliver to address line 2</ram:LineTwo> <ram:PersonName>Buyer contact point</ram:PersonName>
<ram:LineThree>Deliver to address line 3</ram:LineThree> <ram:TelephoneUniversalCommunication>
<ram:CityName>Deliver to city</ram:CityName> <ram:CompleteNumber>+353 2948584</ram:CompleteNumber>
<ram:CountryID>IE</ram:CountryID> </ram:TelephoneUniversalCommunication>
<ram:CountrySubDivisionName>Deliver to country subdivision</ram:CountrySubDivisionName> <ram:EmailURIUniversalCommunication>
</ram:PostalTradeAddress> <ram:URIID>buyer@contact.ie</ram:URIID>
</ram:ShipToTradeParty> </ram:EmailURIUniversalCommunication>
<ram:ActualDeliverySupplyChainEvent> </ram:DefinedTradeContact>
<ram:OccurrenceDateTime> <ram:PostalTradeAddress>
<udt:DateTimeString format="102">20181204</udt:DateTimeString> <ram:PostcodeCode>34562</ram:PostcodeCode>
</ram:OccurrenceDateTime> <ram:LineOne>Buyer address line 1</ram:LineOne>
</ram:ActualDeliverySupplyChainEvent> <ram:LineTwo>Buyer address line 2</ram:LineTwo>
<ram:DespatchAdviceReferencedDocument> <ram:LineThree>Buyer address line 3</ram:LineThree>
<ram:IssuerAssignedID>lmn</ram:IssuerAssignedID> <ram:CityName>Buyer city</ram:CityName>
</ram:DespatchAdviceReferencedDocument> <ram:CountryID>IE</ram:CountryID>
<ram:ReceivingAdviceReferencedDocument> <ram:CountrySubDivisionName>Buyer country subdivision</ram:CountrySubDivisionName>
<ram:IssuerAssignedID>ghi</ram:IssuerAssignedID> </ram:PostalTradeAddress>
</ram:ReceivingAdviceReferencedDocument> <ram:URIUniversalCommunication>
</ram:ApplicableHeaderTradeDelivery> <ram:URIID schemeID="EM">Buyer electronic address</ram:URIID>
<ram:ApplicableHeaderTradeSettlement> </ram:URIUniversalCommunication>
<ram:CreditorReferenceID>Bank assigned creditor identifier</ram:CreditorReferenceID> <ram:SpecifiedTaxRegistration>
<ram:PaymentReference>Remittance information</ram:PaymentReference> <ram:ID schemeID="VA">IE394838894</ram:ID>
<ram:TaxCurrencyCode>NOK</ram:TaxCurrencyCode> </ram:SpecifiedTaxRegistration>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> </ram:BuyerTradeParty>
<ram:PayeeTradeParty> <ram:SellerTaxRepresentativeTradeParty>
<ram:GlobalID schemeID="0098">Payee identifier</ram:GlobalID> <ram:Name>Tax representative name</ram:Name>
<ram:Name>Payee name</ram:Name> <ram:PostalTradeAddress>
<ram:SpecifiedLegalOrganization> <ram:PostcodeCode>23455</ram:PostcodeCode>
<ram:ID schemeID="0099">Payee legal registration identifier</ram:ID> <ram:LineOne>Tax representative address line 1</ram:LineOne>
</ram:SpecifiedLegalOrganization> <ram:LineTwo>Tax representative address line 2</ram:LineTwo>
</ram:PayeeTradeParty> <ram:LineThree>Tax representative address line 3</ram:LineThree>
<ram:SpecifiedTradeSettlementPaymentMeans> <ram:CityName>Tax representative city</ram:CityName>
<ram:TypeCode>4</ram:TypeCode> <ram:CountryID>DE</ram:CountryID>
<ram:Information>SEPA</ram:Information> <ram:CountrySubDivisionName>Tax representative country subdivision</ram:CountrySubDivisionName>
<ram:ApplicableTradeSettlementFinancialCard> </ram:PostalTradeAddress>
<ram:ID>1234</ram:ID> <ram:SpecifiedTaxRegistration>
<ram:CardholderName>Payment card holder name</ram:CardholderName> <ram:ID schemeID="VA">DE3949053</ram:ID>
</ram:ApplicableTradeSettlementFinancialCard> </ram:SpecifiedTaxRegistration>
<ram:PayerPartyDebtorFinancialAccount> </ram:SellerTaxRepresentativeTradeParty>
<ram:IBANID>Debited account identifier</ram:IBANID> <ram:SellerOrderReferencedDocument>
</ram:PayerPartyDebtorFinancialAccount> <ram:IssuerAssignedID>def</ram:IssuerAssignedID>
<ram:PayeePartyCreditorFinancialAccount> </ram:SellerOrderReferencedDocument>
<ram:IBANID>IT1212341234123412</ram:IBANID> <ram:BuyerOrderReferencedDocument>
<ram:AccountName>Payment account name</ram:AccountName> <ram:IssuerAssignedID>abc</ram:IssuerAssignedID>
</ram:PayeePartyCreditorFinancialAccount> </ram:BuyerOrderReferencedDocument>
<!-- <ram:BICID>BSCTCH22</ram:BICID> --> <ram:ContractReferencedDocument>
<!-- <ram:PayerSpecifiedDebtorFinancialInstitution> <ram:IssuerAssignedID>789</ram:IssuerAssignedID>
</ram:PayerSpecifiedDebtorFinancialInstitution> --> </ram:ContractReferencedDocument>
<!-- <ram:PayeePartyCreditorFinancialAccount> <ram:AdditionalReferencedDocument>
<ram:IBANID>IT1212341234123413</ram:IBANID> <ram:IssuerAssignedID>Supporting document ref</ram:IssuerAssignedID>
<ram:AccountName>Payment account name 2</ram:AccountName> <ram:URIID>External document location</ram:URIID>
</ram:PayeePartyCreditorFinancialAccount> <ram:TypeCode>916</ram:TypeCode>
<ram:PayerSpecifiedDebtorFinancialInstitution> <ram:Name>Supporting document descr</ram:Name>
<ram:BICID>BSCTCH22</ram:BICID> <ram:AttachmentBinaryObject mimeCode="application/pdf" filename="filename0">ZGVmYXVsdA==</ram:AttachmentBinaryObject>
</ram:PayerSpecifiedDebtorFinancialInstitution> --> </ram:AdditionalReferencedDocument>
</ram:SpecifiedTradeSettlementPaymentMeans> <ram:AdditionalReferencedDocument>
<ram:ApplicableTradeTax> <ram:IssuerAssignedID>rst</ram:IssuerAssignedID>
<ram:CalculatedAmount>50.00</ram:CalculatedAmount> <ram:TypeCode>130</ram:TypeCode>
<ram:TypeCode>VAT</ram:TypeCode> <ram:ReferenceTypeCode>AAA</ram:ReferenceTypeCode>
<ram:BasisAmount>1000.00</ram:BasisAmount> </ram:AdditionalReferencedDocument>
<ram:CategoryCode>S</ram:CategoryCode> <ram:SpecifiedProcuringProject>
<!-- <ram:DueDateTypeCode>29</ram:DueDateTypeCode> --> <ram:ID>456</ram:ID>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent> <ram:Name>Project reference</ram:Name>
</ram:ApplicableTradeTax> </ram:SpecifiedProcuringProject>
<ram:ApplicableTradeTax> </ram:ApplicableHeaderTradeAgreement>
<ram:CalculatedAmount>0.00</ram:CalculatedAmount> <ram:ApplicableHeaderTradeDelivery>
<ram:TypeCode>VAT</ram:TypeCode> <ram:ShipToTradeParty>
<ram:ExemptionReason>Exemtion reason text</ram:ExemptionReason> <ram:GlobalID schemeID="0045">deliver location identifier</ram:GlobalID>
<ram:BasisAmount>1000.00</ram:BasisAmount> <ram:Name>Deliver to party name</ram:Name>
<ram:CategoryCode>E</ram:CategoryCode> <ram:PostalTradeAddress>
<ram:ExemptionReasonCode>VATEX-EU-O</ram:ExemptionReasonCode> <ram:PostcodeCode>98765</ram:PostcodeCode>
<ram:DueDateTypeCode>29</ram:DueDateTypeCode> <ram:LineOne>Deliver to address line 1</ram:LineOne>
<ram:RateApplicablePercent>0.00</ram:RateApplicablePercent> <ram:LineTwo>Deliver to address line 2</ram:LineTwo>
</ram:ApplicableTradeTax> <ram:LineThree>Deliver to address line 3</ram:LineThree>
<ram:BillingSpecifiedPeriod> <ram:CityName>Deliver to city</ram:CityName>
<ram:StartDateTime> <ram:CountryID>IE</ram:CountryID>
<udt:DateTimeString format="102">20181112</udt:DateTimeString> <ram:CountrySubDivisionName>Deliver to country subdivision</ram:CountrySubDivisionName>
</ram:StartDateTime> </ram:PostalTradeAddress>
<ram:EndDateTime> </ram:ShipToTradeParty>
<udt:DateTimeString format="102">20181130</udt:DateTimeString> <ram:ActualDeliverySupplyChainEvent>
</ram:EndDateTime> <ram:OccurrenceDateTime>
</ram:BillingSpecifiedPeriod> <udt:DateTimeString format="102">20181204</udt:DateTimeString>
<ram:SpecifiedTradeAllowanceCharge> </ram:OccurrenceDateTime>
<ram:ChargeIndicator> </ram:ActualDeliverySupplyChainEvent>
<udt:Indicator>false</udt:Indicator> <ram:DespatchAdviceReferencedDocument>
</ram:ChargeIndicator> <ram:IssuerAssignedID>lmn</ram:IssuerAssignedID>
<ram:CalculationPercent>1.00</ram:CalculationPercent> </ram:DespatchAdviceReferencedDocument>
<ram:BasisAmount>1000.00</ram:BasisAmount> <ram:ReceivingAdviceReferencedDocument>
<ram:ActualAmount>10.00</ram:ActualAmount> <ram:IssuerAssignedID>ghi</ram:IssuerAssignedID>
<ram:ReasonCode>95</ram:ReasonCode> </ram:ReceivingAdviceReferencedDocument>
<ram:Reason>Doc allowance reason text</ram:Reason> </ram:ApplicableHeaderTradeDelivery>
<ram:CategoryTradeTax> <ram:ApplicableHeaderTradeSettlement>
<ram:TypeCode>VAT</ram:TypeCode> <ram:CreditorReferenceID>Bank assigned creditor identifier</ram:CreditorReferenceID>
<ram:CategoryCode>S</ram:CategoryCode> <ram:PaymentReference>Remittance information</ram:PaymentReference>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent> <ram:TaxCurrencyCode>NOK</ram:TaxCurrencyCode>
</ram:CategoryTradeTax> <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
</ram:SpecifiedTradeAllowanceCharge> <ram:PayeeTradeParty>
<ram:SpecifiedTradeAllowanceCharge> <ram:GlobalID schemeID="0098">Payee identifier</ram:GlobalID>
<ram:ChargeIndicator> <ram:Name>Payee name</ram:Name>
<udt:Indicator>true</udt:Indicator> <ram:SpecifiedLegalOrganization>
</ram:ChargeIndicator> <ram:ID schemeID="0099">Payee legal registration identifier</ram:ID>
<ram:CalculationPercent>1.00</ram:CalculationPercent> </ram:SpecifiedLegalOrganization>
<ram:BasisAmount>1000.00</ram:BasisAmount> </ram:PayeeTradeParty>
<ram:ActualAmount>10.00</ram:ActualAmount> <ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ReasonCode>AAA</ram:ReasonCode> <ram:TypeCode>4</ram:TypeCode>
<ram:Reason>Doc charge reason text</ram:Reason> <ram:Information>SEPA</ram:Information>
<ram:CategoryTradeTax> <ram:ApplicableTradeSettlementFinancialCard>
<ram:TypeCode>VAT</ram:TypeCode> <ram:ID>1234</ram:ID>
<ram:CategoryCode>S</ram:CategoryCode> <ram:CardholderName>Payment card holder name</ram:CardholderName>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent> </ram:ApplicableTradeSettlementFinancialCard>
</ram:CategoryTradeTax> <ram:PayerPartyDebtorFinancialAccount>
</ram:SpecifiedTradeAllowanceCharge> <ram:IBANID>Debited account identifier</ram:IBANID>
<ram:SpecifiedTradePaymentTerms> </ram:PayerPartyDebtorFinancialAccount>
<ram:Description>total amount</ram:Description> <ram:PayeePartyCreditorFinancialAccount>
<ram:DueDateDateTime> <ram:IBANID>IT1212341234123412</ram:IBANID>
<udt:DateTimeString format="102">20181130</udt:DateTimeString> <ram:AccountName>Payment account name</ram:AccountName>
</ram:DueDateDateTime> </ram:PayeePartyCreditorFinancialAccount>
<ram:DirectDebitMandateID>Mandate reference identifier</ram:DirectDebitMandateID> <!-- <ram:BICID>BSCTCH22</ram:BICID> -->
</ram:SpecifiedTradePaymentTerms> <!-- <ram:PayerSpecifiedDebtorFinancialInstitution>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation> </ram:PayerSpecifiedDebtorFinancialInstitution> -->
<ram:LineTotalAmount>2000.00</ram:LineTotalAmount> <!-- <ram:PayeePartyCreditorFinancialAccount>
<ram:ChargeTotalAmount>10.00</ram:ChargeTotalAmount> <ram:IBANID>IT1212341234123413</ram:IBANID>
<ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount> <ram:AccountName>Payment account name 2</ram:AccountName>
<ram:TaxBasisTotalAmount>2000.00</ram:TaxBasisTotalAmount> </ram:PayeePartyCreditorFinancialAccount>
<ram:TaxTotalAmount currencyID="EUR">50.00</ram:TaxTotalAmount> <ram:PayerSpecifiedDebtorFinancialInstitution>
<ram:TaxTotalAmount currencyID="NOK">46.00</ram:TaxTotalAmount> <ram:BICID>BSCTCH22</ram:BICID>
<ram:RoundingAmount>0.00</ram:RoundingAmount> </ram:PayerSpecifiedDebtorFinancialInstitution> -->
<ram:GrandTotalAmount>2050.00</ram:GrandTotalAmount> </ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount> <ram:ApplicableTradeTax>
<ram:DuePayableAmount>2050.00</ram:DuePayableAmount> <ram:CalculatedAmount>5.00</ram:CalculatedAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:TypeCode>VAT</ram:TypeCode>
<ram:InvoiceReferencedDocument> <ram:BasisAmount>100.00</ram:BasisAmount>
<ram:IssuerAssignedID>abc123</ram:IssuerAssignedID> <ram:CategoryCode>S</ram:CategoryCode>
<ram:FormattedIssueDateTime> <!-- <ram:DueDateTypeCode>29</ram:DueDateTypeCode> -->
<qdt:DateTimeString format="102">20181004</qdt:DateTimeString> <ram:RateApplicablePercent>5.00</ram:RateApplicablePercent>
</ram:FormattedIssueDateTime> </ram:ApplicableTradeTax>
</ram:InvoiceReferencedDocument> <ram:ApplicableTradeTax>
<ram:ReceivableSpecifiedTradeAccountingAccount> <ram:CalculatedAmount>0.00</ram:CalculatedAmount>
<ram:ID>uvz</ram:ID> <ram:TypeCode>VAT</ram:TypeCode>
</ram:ReceivableSpecifiedTradeAccountingAccount> <ram:ExemptionReason>Exemtion reason text</ram:ExemptionReason>
</ram:ApplicableHeaderTradeSettlement> <ram:BasisAmount>100.00</ram:BasisAmount>
</rsm:SupplyChainTradeTransaction> <ram:CategoryCode>E</ram:CategoryCode>
</rsm:CrossIndustryInvoice> <ram:ExemptionReasonCode>VATEX-EU-O</ram:ExemptionReasonCode>
<ram:DueDateTypeCode>29</ram:DueDateTypeCode>
<ram:RateApplicablePercent>0.00</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20181112</udt:DateTimeString>
</ram:StartDateTime>
<ram:EndDateTime>
<udt:DateTimeString format="102">20181130</udt:DateTimeString>
</ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>false</udt:Indicator>
</ram:ChargeIndicator>
<ram:CalculationPercent>1.00</ram:CalculationPercent>
<ram:BasisAmount>100.00</ram:BasisAmount>
<ram:ActualAmount>10.00</ram:ActualAmount>
<ram:ReasonCode>95</ram:ReasonCode>
<ram:Reason>Doc allowance reason text</ram:Reason>
<ram:CategoryTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent>
</ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>true</udt:Indicator>
</ram:ChargeIndicator>
<ram:CalculationPercent>1.00</ram:CalculationPercent>
<ram:BasisAmount>100.00</ram:BasisAmount>
<ram:ActualAmount>10.00</ram:ActualAmount>
<ram:ReasonCode>AAA</ram:ReasonCode>
<ram:Reason>Doc charge reason text</ram:Reason>
<ram:CategoryTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>5.00</ram:RateApplicablePercent>
</ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>total amount</ram:Description>
<ram:DueDateDateTime>
<udt:DateTimeString format="102">20181130</udt:DateTimeString>
</ram:DueDateDateTime>
<ram:DirectDebitMandateID>Mandate reference identifier</ram:DirectDebitMandateID>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>200.00</ram:LineTotalAmount>
<ram:ChargeTotalAmount>10.00</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>10.00</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>200.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">5.00</ram:TaxTotalAmount>
<ram:TaxTotalAmount currencyID="NOK">4.60</ram:TaxTotalAmount>
<ram:RoundingAmount>0.00</ram:RoundingAmount>
<ram:GrandTotalAmount>205.00</ram:GrandTotalAmount>
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
<ram:DuePayableAmount>205.00</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:InvoiceReferencedDocument>
<ram:IssuerAssignedID>abc123</ram:IssuerAssignedID>
<ram:FormattedIssueDateTime>
<qdt:DateTimeString format="102">20181004</qdt:DateTimeString>
</ram:FormattedIssueDateTime>
</ram:InvoiceReferencedDocument>
<ram:ReceivableSpecifiedTradeAccountingAccount>
<ram:ID>uvz</ram:ID>
</ram:ReceivableSpecifiedTradeAccountingAccount>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>

View File

@@ -1,404 +1,365 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDataTypes-2" xmlns:udt="urn:oasis:names:specification:ubl:schema:xsd:UnqualifiedDataTypes-2"> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID> <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
<cbc:ProfileID>BT-23 Business Process Type</cbc:ProfileID> <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
<cbc:ID>Test_EeISI_100</cbc:ID> <cbc:ID>Test_EeISI_100</cbc:ID>
<cbc:IssueDate>2018-11-12</cbc:IssueDate> <cbc:IssueDate>2018-11-12</cbc:IssueDate>
<cbc:DueDate>2018-11-30</cbc:DueDate> <cbc:DueDate>2018-11-30</cbc:DueDate>
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
<cbc:Note>##AAA##invoice note text</cbc:Note> <cbc:Note>#AAA#invoice note text</cbc:Note>
<cbc:Note>##AAA##invoice note text 2</cbc:Note> <cbc:Note>#AAA#invoice note text 2</cbc:Note>
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode> <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
<cbc:TaxCurrencyCode>NOK</cbc:TaxCurrencyCode> <cbc:TaxCurrencyCode>NOK</cbc:TaxCurrencyCode>
<cbc:AccountingCost>uvz</cbc:AccountingCost> <cbc:AccountingCost>uvz</cbc:AccountingCost>
<cbc:BuyerReference>123</cbc:BuyerReference> <cbc:BuyerReference>123</cbc:BuyerReference>
<cac:InvoicePeriod> <cac:InvoicePeriod>
<cbc:StartDate>2018-11-12</cbc:StartDate> <cbc:StartDate>2018-11-12</cbc:StartDate>
<cbc:EndDate>2018-11-30</cbc:EndDate> <cbc:EndDate>2018-11-30</cbc:EndDate>
<cbc:DescriptionCode>35</cbc:DescriptionCode> </cac:InvoicePeriod>
</cac:InvoicePeriod> <cac:OrderReference>
<cac:OrderReference> <cbc:ID>abc</cbc:ID>
<cbc:ID>abc</cbc:ID> <cbc:SalesOrderID>def</cbc:SalesOrderID>
<cbc:SalesOrderID>def</cbc:SalesOrderID> </cac:OrderReference>
</cac:OrderReference> <cac:BillingReference>
<cac:BillingReference> <cac:InvoiceDocumentReference>
<cac:InvoiceDocumentReference> <cbc:ID>abc123</cbc:ID>
<cbc:ID>abc123</cbc:ID> <cbc:IssueDate>2018-10-04</cbc:IssueDate>
<cbc:IssueDate>2018-10-04</cbc:IssueDate> </cac:InvoiceDocumentReference>
</cac:InvoiceDocumentReference> </cac:BillingReference>
</cac:BillingReference> <cac:DespatchDocumentReference>
<cac:DespatchDocumentReference> <cbc:ID>lmn</cbc:ID>
<cbc:ID>lmn</cbc:ID> </cac:DespatchDocumentReference>
</cac:DespatchDocumentReference> <cac:ReceiptDocumentReference>
<cac:ReceiptDocumentReference> <cbc:ID>ghi</cbc:ID>
<cbc:ID>ghi</cbc:ID> </cac:ReceiptDocumentReference>
</cac:ReceiptDocumentReference> <cac:ContractDocumentReference>
<cac:OriginatorDocumentReference> <cbc:ID>789</cbc:ID>
<cbc:ID>opq</cbc:ID> </cac:ContractDocumentReference>
</cac:OriginatorDocumentReference> <cac:AdditionalDocumentReference>
<cac:ContractDocumentReference> <cbc:ID>Supporting document ref</cbc:ID>
<cbc:ID>789</cbc:ID> <cbc:DocumentDescription>Supporting document descr</cbc:DocumentDescription>
</cac:ContractDocumentReference> <cac:Attachment>
<cac:AdditionalDocumentReference> <cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="filename0">ZGVmYXVsdA==</cbc:EmbeddedDocumentBinaryObject>
<cbc:ID schemeID="0090">rst</cbc:ID> <cac:ExternalReference>
<cbc:DocumentTypeCode>130</cbc:DocumentTypeCode> <cbc:URI>External document location</cbc:URI>
</cac:AdditionalDocumentReference> </cac:ExternalReference>
<cac:AdditionalDocumentReference> </cac:Attachment>
<cbc:ID>Supporting document ref</cbc:ID> </cac:AdditionalDocumentReference>
<cbc:DocumentDescription>Supporting document descr</cbc:DocumentDescription> <cac:AdditionalDocumentReference>
<cac:Attachment> <cbc:ID schemeID="AAA">rst</cbc:ID>
<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="filename0">ZGVmYXVsdA==</cbc:EmbeddedDocumentBinaryObject> <cbc:DocumentTypeCode>130</cbc:DocumentTypeCode>
<cac:ExternalReference> </cac:AdditionalDocumentReference>
<cbc:URI>External document location</cbc:URI> <cac:ProjectReference>
</cac:ExternalReference> <cbc:ID>456</cbc:ID>
</cac:Attachment> </cac:ProjectReference>
</cac:AdditionalDocumentReference> <cac:AccountingSupplierParty>
<cac:ProjectReference> <cac:Party>
<cbc:ID>456</cbc:ID> <cbc:EndpointID schemeID="EM">Seller electronic address</cbc:EndpointID>
</cac:ProjectReference> <cac:PartyIdentification>
<cac:AccountingSupplierParty> <cbc:ID schemeID="0100">Seller identifier 1</cbc:ID>
<cac:Party> </cac:PartyIdentification>
<cbc:EndpointID schemeID="SMTP">Seller electronic address</cbc:EndpointID> <cac:PartyIdentification>
<cbc:ID schemeID="0110">Seller identifier 2</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Seller trading name</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Seller address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Seller address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Seller city</cbc:CityName>
<cbc:PostalZone>12345</cbc:PostalZone>
<cbc:CountrySubentity>Seller country subdivision</cbc:CountrySubentity>
<cac:AddressLine>
<cbc:Line>Seller address line 3</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>DE12345677</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyTaxScheme>
<cbc:CompanyID>DE49294093</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>FC</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Seller name</cbc:RegistrationName>
<cbc:CompanyLegalForm>Seller additional legal information</cbc:CompanyLegalForm>
</cac:PartyLegalEntity>
<cac:Contact>
<cbc:Name>Seller contact point</cbc:Name>
<cbc:Telephone>+41 345 654455</cbc:Telephone>
<cbc:ElectronicMail>seller@contact.de</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:AccountingSupplierParty>
<cac:AccountingCustomerParty>
<cac:Party>
<cbc:EndpointID schemeID="EM">Buyer electronic address</cbc:EndpointID>
<cac:PartyIdentification>
<cbc:ID schemeID="0190">Buyer identifier</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Buyer trading name</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Buyer address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Buyer address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Buyer city</cbc:CityName>
<cbc:PostalZone>34562</cbc:PostalZone>
<cbc:CountrySubentity>Buyer country subdivision</cbc:CountrySubentity>
<cac:AddressLine>
<cbc:Line>Buyer address line 3</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>IE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>IE394838894</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Buyer name</cbc:RegistrationName>
<cbc:CompanyID schemeID="0089">Buyer legal registration identifier</cbc:CompanyID>
</cac:PartyLegalEntity>
<cac:Contact>
<cbc:Name>Buyer contact point</cbc:Name>
<cbc:Telephone>+353 2948584</cbc:Telephone>
<cbc:ElectronicMail>buyer@contact.ie</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PayeeParty>
<cac:PartyIdentification> <cac:PartyIdentification>
<cbc:ID schemeID="0100">Seller identifier 1</cbc:ID> <cbc:ID schemeID="0098">Payee identifier</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeID="0110">Seller identifier 2</cbc:ID>
</cac:PartyIdentification>
<cac:PartyIdentification>
<cbc:ID schemeID="SEPA">Bank assigned creditor identifier</cbc:ID>
</cac:PartyIdentification> </cac:PartyIdentification>
<cac:PartyName> <cac:PartyName>
<cbc:Name>Seller trading name</cbc:Name> <cbc:Name>Payee name</cbc:Name>
</cac:PartyName>
</cac:PayeeParty>
<cac:TaxRepresentativeParty>
<cac:PartyName>
<cbc:Name>Tax representative name</cbc:Name>
</cac:PartyName> </cac:PartyName>
<cac:PostalAddress> <cac:PostalAddress>
<cbc:StreetName>Seller address line 1</cbc:StreetName> <cbc:StreetName>Tax representative address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Seller address line 2</cbc:AdditionalStreetName> <cbc:AdditionalStreetName>Tax representative address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Seller city</cbc:CityName> <cbc:CityName>Tax representative city</cbc:CityName>
<cbc:PostalZone>12345</cbc:PostalZone> <cbc:PostalZone>23455</cbc:PostalZone>
<cbc:CountrySubentity>Seller country subdivision</cbc:CountrySubentity> <cbc:CountrySubentity>Tax representative country subdivision</cbc:CountrySubentity>
<cac:AddressLine> <cac:AddressLine>
<cbc:Line>Seller address line 3</cbc:Line> <cbc:Line>Tax representative address line 3</cbc:Line>
</cac:AddressLine> </cac:AddressLine>
<cac:Country> <cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode> <cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country> </cac:Country>
</cac:PostalAddress> </cac:PostalAddress>
<cac:PartyTaxScheme> <cac:PartyTaxScheme>
<cbc:CompanyID>DE12345677</cbc:CompanyID> <cbc:CompanyID>DE3949053</cbc:CompanyID>
<cac:TaxScheme> <cac:TaxScheme>
<cbc:ID>VAT</cbc:ID> <cbc:ID>VAT</cbc:ID>
</cac:TaxScheme> </cac:TaxScheme>
</cac:PartyTaxScheme> </cac:PartyTaxScheme>
<cac:PartyTaxScheme> </cac:TaxRepresentativeParty>
<cbc:CompanyID>DE49294093</cbc:CompanyID> <cac:Delivery>
<cac:TaxScheme> <cbc:ActualDeliveryDate>2018-12-04</cbc:ActualDeliveryDate>
<cbc:ID>NOVAT</cbc:ID> <cac:DeliveryLocation>
</cac:TaxScheme> <cbc:ID schemeID="0045">deliver location identifier</cbc:ID>
</cac:PartyTaxScheme> <cac:Address>
<cac:PartyLegalEntity> <cbc:StreetName>Deliver to address line 1</cbc:StreetName>
<cbc:RegistrationName>Seller name</cbc:RegistrationName> <cbc:AdditionalStreetName>Deliver to address line 2</cbc:AdditionalStreetName>
<cbc:CompanyID schemeID="0310">Seller legal identifier</cbc:CompanyID> <cbc:CityName>Deliver to city</cbc:CityName>
<cbc:CompanyLegalForm>Seller additional legal information</cbc:CompanyLegalForm> <cbc:PostalZone>98765</cbc:PostalZone>
</cac:PartyLegalEntity> <cbc:CountrySubentity>Deliver to country subdivision</cbc:CountrySubentity>
<cac:Contact> <cac:AddressLine>
<cbc:Name>Seller contact point</cbc:Name> <cbc:Line>Deliver to address line 3</cbc:Line>
<cbc:Telephone>+41 345 654455</cbc:Telephone> </cac:AddressLine>
<cbc:ElectronicMail>seller@contact.de</cbc:ElectronicMail> <cac:Country>
</cac:Contact> <cbc:IdentificationCode>IE</cbc:IdentificationCode>
</cac:Party> </cac:Country>
</cac:AccountingSupplierParty> </cac:Address>
<cac:AccountingCustomerParty> </cac:DeliveryLocation>
<cac:Party> <cac:DeliveryParty>
<cbc:EndpointID schemeID="DE:SMTP">Buyer electronic address</cbc:EndpointID> <cac:PartyName>
<cac:PartyIdentification> <cbc:Name>Deliver to party name</cbc:Name>
<cbc:ID>0190:Buyer identifier</cbc:ID> </cac:PartyName>
</cac:PartyIdentification> </cac:DeliveryParty>
<cac:PartyName> </cac:Delivery>
<cbc:Name>Buyer trading name</cbc:Name> <cac:PaymentTerms>
</cac:PartyName> <cbc:Note>total amount</cbc:Note>
<cac:PostalAddress> </cac:PaymentTerms>
<cbc:StreetName>Buyer address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Buyer address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Buyer city</cbc:CityName>
<cbc:PostalZone>34562</cbc:PostalZone>
<cbc:CountrySubentity>Buyer country subdivision</cbc:CountrySubentity>
<cac:AddressLine>
<cbc:Line>Buyer address line 3</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>IE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>IE394838894</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
<cac:PartyLegalEntity>
<cbc:RegistrationName>Buyer name</cbc:RegistrationName>
<cbc:CompanyID>Buyer legal registration identifier</cbc:CompanyID>
</cac:PartyLegalEntity>
<cac:Contact>
<cbc:Name>Buyer contact point</cbc:Name>
<cbc:Telephone>+353 2948584</cbc:Telephone>
<cbc:ElectronicMail>buyer@contact.ie</cbc:ElectronicMail>
</cac:Contact>
</cac:Party>
</cac:AccountingCustomerParty>
<cac:PayeeParty>
<cac:PartyIdentification>
<cbc:ID schemeID="0098">Payee identifier</cbc:ID>
</cac:PartyIdentification>
<cac:PartyName>
<cbc:Name>Payee name</cbc:Name>
</cac:PartyName>
<cac:PartyLegalEntity>
<cbc:CompanyID schemeID="0099">Payee legal registration identifier</cbc:CompanyID>
</cac:PartyLegalEntity>
</cac:PayeeParty>
<cac:TaxRepresentativeParty>
<cac:PartyName>
<cbc:Name>Tax representative name</cbc:Name>
</cac:PartyName>
<cac:PostalAddress>
<cbc:StreetName>Tax representative address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Tax representative address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Tax representative city</cbc:CityName>
<cbc:PostalZone>23455</cbc:PostalZone>
<cbc:CountrySubentity>Tax representative country subdivision</cbc:CountrySubentity>
<cac:AddressLine>
<cbc:Line>Tax representative address line 3</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
</cac:Country>
</cac:PostalAddress>
<cac:PartyTaxScheme>
<cbc:CompanyID>DE3949053</cbc:CompanyID>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:PartyTaxScheme>
</cac:TaxRepresentativeParty>
<cac:Delivery>
<cbc:ActualDeliveryDate>2018-12-04</cbc:ActualDeliveryDate>
<cac:DeliveryLocation>
<cbc:ID schemeID="0045">deliver location identifier</cbc:ID>
<cac:Address>
<cbc:StreetName>Deliver to address line 1</cbc:StreetName>
<cbc:AdditionalStreetName>Deliver to address line 2</cbc:AdditionalStreetName>
<cbc:CityName>Deliver to city</cbc:CityName>
<cbc:PostalZone>98765</cbc:PostalZone>
<cbc:CountrySubentity>Deliver to country subdivision</cbc:CountrySubentity>
<cac:AddressLine>
<cbc:Line>Deliver to address line 3</cbc:Line>
</cac:AddressLine>
<cac:Country>
<cbc:IdentificationCode>IE</cbc:IdentificationCode>
</cac:Country>
</cac:Address>
</cac:DeliveryLocation>
<cac:DeliveryParty>
<cac:PartyName>
<cbc:Name>Deliver to party name</cbc:Name>
</cac:PartyName>
</cac:DeliveryParty>
</cac:Delivery>
<cac:PaymentMeans>
<cbc:PaymentMeansCode name="SEPA">4</cbc:PaymentMeansCode>
<cbc:PaymentID>Remittance information</cbc:PaymentID>
<cac:CardAccount>
<cbc:PrimaryAccountNumberID>1234</cbc:PrimaryAccountNumberID>
<cbc:NetworkID>mandatory network id</cbc:NetworkID>
<cbc:HolderName>Payment card holder name</cbc:HolderName>
</cac:CardAccount>
<cac:PayeeFinancialAccount>
<cbc:ID>IT1212341234123412</cbc:ID>
<cbc:Name>Payment account name</cbc:Name>
<cac:FinancialInstitutionBranch>
<cbc:ID>BSCTCH22</cbc:ID>
</cac:FinancialInstitutionBranch>
</cac:PayeeFinancialAccount>
<cac:PayeeFinancialAccount>
<cbc:ID>IT1212341234123413</cbc:ID>
<cbc:Name>Payment account name 2</cbc:Name>
<cac:FinancialInstitutionBranch>
<cbc:ID>BSCTCH22</cbc:ID>
</cac:FinancialInstitutionBranch>
</cac:PayeeFinancialAccount>
<cac:PaymentMandate>
<cbc:ID>Mandate reference identifier</cbc:ID>
<cac:PayerFinancialAccount>
<cbc:ID>Debited account identifier</cbc:ID>
</cac:PayerFinancialAccount>
</cac:PaymentMandate>
</cac:PaymentMeans>
<cac:PaymentTerms>
<cbc:Note>total amount</cbc:Note>
</cac:PaymentTerms>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:AllowanceChargeReasonCode>55</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Doc allowance reason text</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1.0000</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">10.00</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000.00</cbc:BaseAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>5.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
<cbc:AllowanceChargeReasonCode>AAA</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Doc charge reason text</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1.0000</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">10.00</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000.00</cbc:BaseAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>5.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:AllowanceCharge>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="NOK">46.00</cbc:TaxAmount>
</cac:TaxTotal>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">50.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">1000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">50.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>5.00</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">1000.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">0.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>E</cbc:ID>
<cbc:Percent>0.00</cbc:Percent>
<cbc:TaxExemptionReasonCode>Exemption reason code</cbc:TaxExemptionReasonCode>
<cbc:TaxExemptionReason>Exemtion reason text</cbc:TaxExemptionReason>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">2000.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">2000.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">2050.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="EUR">10.00</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>
<cbc:PayableAmount currencyID="EUR">2050.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1a</cbc:ID>
<cbc:Note>Invoice line note</cbc:Note>
<cbc:InvoicedQuantity unitCode="EA">10.00000000</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">1000.00</cbc:LineExtensionAmount>
<cbc:AccountingCost>6789</cbc:AccountingCost>
<cac:InvoicePeriod>
<cbc:StartDate>2018-11-12</cbc:StartDate>
<cbc:EndDate>2018-11-30</cbc:EndDate>
</cac:InvoicePeriod>
<cac:OrderLineReference>
<cbc:LineID>12345</cbc:LineID>
</cac:OrderLineReference>
<cac:DocumentReference>
<cbc:ID schemeID="ZZZ">Line object identifier</cbc:ID>
<cbc:DocumentTypeCode>130</cbc:DocumentTypeCode>
</cac:DocumentReference>
<cac:AllowanceCharge> <cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:AllowanceChargeReasonCode>55</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Invoice line allowance reason</cbc:AllowanceChargeReason> <cbc:AllowanceChargeReason>Doc allowance reason text</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric> <cbc:MultiplierFactorNumeric>1.00</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">10</cbc:Amount> <cbc:Amount currencyID="EUR">10</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount> <cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount>
<cac:TaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>5</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:AllowanceCharge> </cac:AllowanceCharge>
<cac:AllowanceCharge> <cac:AllowanceCharge>
<cbc:ChargeIndicator>true</cbc:ChargeIndicator> <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
<cbc:AllowanceChargeReasonCode>AAA</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReasonCode>AAA</cbc:AllowanceChargeReasonCode>
<cbc:AllowanceChargeReason>Invoice line charge reason</cbc:AllowanceChargeReason> <cbc:AllowanceChargeReason>Doc charge reason text</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric> <cbc:MultiplierFactorNumeric>1.00</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">10</cbc:Amount> <cbc:Amount currencyID="EUR">10</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount> <cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount>
</cac:AllowanceCharge> <cac:TaxCategory>
<cac:Item>
<cbc:Description>Item description</cbc:Description>
<cbc:Name>Item name</cbc:Name>
<cac:BuyersItemIdentification>
<cbc:ID>Item buyer's identifier</cbc:ID>
</cac:BuyersItemIdentification>
<cac:SellersItemIdentification>
<cbc:ID>Item seller's identifier</cbc:ID>
</cac:SellersItemIdentification>
<cac:StandardItemIdentification>
<cbc:ID>Item standar identifier</cbc:ID>
</cac:StandardItemIdentification>
<cac:OriginCountry>
<cbc:IdentificationCode>IT</cbc:IdentificationCode>
</cac:OriginCountry>
<cac:CommodityClassification>
<cbc:ItemClassificationCode listID="ZZZ" listVersionID="version0">Item classification identifier0</cbc:ItemClassificationCode>
</cac:CommodityClassification>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID> <cbc:ID>S</cbc:ID>
<cbc:Percent>5.00</cbc:Percent> <cbc:Percent>5</cbc:Percent>
<cac:TaxScheme> <cac:TaxScheme>
<cbc:ID>VAT</cbc:ID> <cbc:ID>VAT</cbc:ID>
</cac:TaxScheme> </cac:TaxScheme>
</cac:ClassifiedTaxCategory> </cac:TaxCategory>
<cac:AdditionalItemProperty> </cac:AllowanceCharge>
<cbc:Name>Color</cbc:Name> <cac:TaxTotal>
<cbc:Value>Red</cbc:Value> <cbc:TaxAmount currencyID="EUR">50</cbc:TaxAmount>
</cac:AdditionalItemProperty> <cac:TaxSubtotal>
<cac:AdditionalItemProperty> <cbc:TaxableAmount currencyID="EUR">1000</cbc:TaxableAmount>
<cbc:Name>Size</cbc:Name> <cbc:TaxAmount currencyID="EUR">50</cbc:TaxAmount>
<cbc:Value>L</cbc:Value> <cac:TaxCategory>
</cac:AdditionalItemProperty> <cbc:ID>S</cbc:ID>
</cac:Item> <cbc:Percent>5</cbc:Percent>
<cac:Price> <cac:TaxScheme>
<cbc:PriceAmount currencyID="EUR">10.00</cbc:PriceAmount> <cbc:ID>VAT</cbc:ID>
<cbc:BaseQuantity unitCode="EA">1.00</cbc:BaseQuantity> </cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">1000</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">0</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:ID>E</cbc:ID>
<cbc:Percent>0</cbc:Percent>
<cbc:TaxExemptionReasonCode>VATEX-EU-O</cbc:TaxExemptionReasonCode>
<cbc:TaxExemptionReason>Exemtion reason text</cbc:TaxExemptionReason>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:TaxTotal>
<cbc:TaxAmount currencyID="NOK">46</cbc:TaxAmount>
</cac:TaxTotal>
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">200</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">200</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">205</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="EUR">10</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="EUR">10</cbc:ChargeTotalAmount>
<cbc:PrepaidAmount currencyID="EUR">0</cbc:PrepaidAmount>
<cbc:PayableAmount currencyID="EUR">205</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
<cac:InvoiceLine>
<cbc:ID>1a</cbc:ID>
<cbc:Note>Invoice line note</cbc:Note>
<cbc:InvoicedQuantity unitCode="EA">10</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">1000</cbc:LineExtensionAmount>
<cbc:AccountingCost>6789</cbc:AccountingCost>
<cac:InvoicePeriod>
<cbc:StartDate>2018-11-12</cbc:StartDate>
<cbc:EndDate>2018-11-30</cbc:EndDate>
</cac:InvoicePeriod>
<cac:OrderLineReference>
<cbc:LineID>12345</cbc:LineID>
</cac:OrderLineReference>
<cac:DocumentReference>
<cbc:ID>Line object identifier</cbc:ID>
<cbc:DocumentTypeCode>130</cbc:DocumentTypeCode>
</cac:DocumentReference>
<cac:AllowanceCharge> <cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:Amount currencyID="EUR">1</cbc:Amount> <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
<cbc:BaseAmount currencyID="EUR">11</cbc:BaseAmount> <cbc:AllowanceChargeReason>Invoice line allowance reason</cbc:AllowanceChargeReason>
<cbc:MultiplierFactorNumeric>1.00</cbc:MultiplierFactorNumeric>
<cbc:Amount currencyID="EUR">10</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount>
</cac:AllowanceCharge> </cac:AllowanceCharge>
</cac:Price> <cac:AllowanceCharge>
</cac:InvoiceLine> <cbc:ChargeIndicator>true</cbc:ChargeIndicator>
<cac:InvoiceLine> <cbc:AllowanceChargeReasonCode>AAA</cbc:AllowanceChargeReasonCode>
<cbc:ID>1b</cbc:ID> <cbc:AllowanceChargeReason>Invoice line charge reason</cbc:AllowanceChargeReason>
<cbc:InvoicedQuantity unitCode="EA">10.00000000</cbc:InvoicedQuantity> <cbc:MultiplierFactorNumeric>1.00</cbc:MultiplierFactorNumeric>
<cbc:LineExtensionAmount currencyID="EUR">1000.00</cbc:LineExtensionAmount> <cbc:Amount currencyID="EUR">10</cbc:Amount>
<cac:Item> <cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount>
<cbc:Name>Item name 2</cbc:Name> </cac:AllowanceCharge>
<cac:ClassifiedTaxCategory> <cac:Item>
<cbc:ID>E</cbc:ID> <cbc:Description>Item description</cbc:Description>
<cbc:Percent>0.00</cbc:Percent> <cbc:Name>Item name</cbc:Name>
<cac:TaxScheme> <cac:BuyersItemIdentification>
<cbc:ID>VAT</cbc:ID> <cbc:ID>Item buyer's identifier</cbc:ID>
</cac:TaxScheme> </cac:BuyersItemIdentification>
</cac:ClassifiedTaxCategory> <cac:SellersItemIdentification>
</cac:Item> <cbc:ID>Item seller's identifier</cbc:ID>
<cac:Price> </cac:SellersItemIdentification>
<cbc:PriceAmount currencyID="EUR">10.00</cbc:PriceAmount> <cac:StandardItemIdentification>
</cac:Price> <cbc:ID schemeID="0060">Item standar identifier</cbc:ID>
</cac:InvoiceLine> </cac:StandardItemIdentification>
</Invoice> <cac:OriginCountry>
<cbc:IdentificationCode>IT</cbc:IdentificationCode>
</cac:OriginCountry>
<cac:CommodityClassification>
<cbc:ItemClassificationCode listID="ZZZ" listVersionID="version0">Item classification identifier0</cbc:ItemClassificationCode>
</cac:CommodityClassification>
<cac:ClassifiedTaxCategory>
<cbc:ID>S</cbc:ID>
<cbc:Percent>5</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
<cac:AdditionalItemProperty>
<cbc:Name>Color</cbc:Name>
<cbc:Value>Red</cbc:Value>
</cac:AdditionalItemProperty>
<cac:AdditionalItemProperty>
<cbc:Name>Size</cbc:Name>
<cbc:Value>L</cbc:Value>
</cac:AdditionalItemProperty>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">10</cbc:PriceAmount>
<cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:Amount currencyID="EUR">1</cbc:Amount>
<cbc:BaseAmount currencyID="EUR">11</cbc:BaseAmount>
</cac:AllowanceCharge>
</cac:Price>
</cac:InvoiceLine>
<cac:InvoiceLine>
<cbc:ID>1b</cbc:ID>
<cbc:InvoicedQuantity unitCode="EA">10</cbc:InvoicedQuantity>
<cbc:LineExtensionAmount currencyID="EUR">1000</cbc:LineExtensionAmount>
<cac:Item>
<cbc:Name>Item name 2</cbc:Name>
<cac:ClassifiedTaxCategory>
<cbc:ID>E</cbc:ID>
<cbc:Percent>0</cbc:Percent>
<cac:TaxScheme>
<cbc:ID>VAT</cbc:ID>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">10</cbc:PriceAmount>
</cac:Price>
</cac:InvoiceLine>
</Invoice>

View File

@@ -52,7 +52,7 @@ public class PDFValidator extends Validator {
} }
private static final Logger LOGGER = LoggerFactory.getLogger(PDFValidator.class.getCanonicalName()); // log output private static final Logger LOGGER = LoggerFactory.getLogger(PDFValidator.class.getCanonicalName()); // log output
private static final PDFAFlavour[] PDF_A_3_FLAVOURS = {PDFAFlavour.PDFA_3_A, PDFAFlavour.PDFA_3_A, PDFAFlavour.PDFA_3_A}; private static final PDFAFlavour[] PDF_A_3_FLAVOURS = {PDFAFlavour.PDFA_3_A, PDFAFlavour.PDFA_3_B, PDFAFlavour.PDFA_3_U};
private String pdfFilename; private String pdfFilename;
@@ -264,6 +264,7 @@ public class PDFValidator extends Validator {
final byte[] konikSignature = "Konik".getBytes(StandardCharsets.UTF_8); final byte[] konikSignature = "Konik".getBytes(StandardCharsets.UTF_8);
final byte[] pdfMachineSignature = "pdfMachine from Broadgun Software".getBytes(StandardCharsets.UTF_8); final byte[] pdfMachineSignature = "pdfMachine from Broadgun Software".getBytes(StandardCharsets.UTF_8);
final byte[] ghostscriptSignature = "%%Invocation:".getBytes(StandardCharsets.UTF_8); final byte[] ghostscriptSignature = "%%Invocation:".getBytes(StandardCharsets.UTF_8);
final byte[] cibpdfbrewerSignature = "CIB pdf brewer".getBytes(StandardCharsets.UTF_8);
if (ByteArraySearcher.contains(fileContents, symtraxSignature)) { if (ByteArraySearcher.contains(fileContents, symtraxSignature)) {
Signature = "Symtrax"; Signature = "Symtrax";
@@ -279,6 +280,8 @@ public class PDFValidator extends Validator {
Signature = "pdfMachine"; Signature = "pdfMachine";
} else if (ByteArraySearcher.contains(fileContents, ghostscriptSignature)) { } else if (ByteArraySearcher.contains(fileContents, ghostscriptSignature)) {
Signature = "Ghostscript"; Signature = "Ghostscript";
} else if (ByteArraySearcher.contains(fileContents, cibpdfbrewerSignature)) {
Signature = "CIB pdf brewer";
} }
context.setSignature(Signature); context.setSignature(Signature);
@@ -298,8 +301,10 @@ public class PDFValidator extends Validator {
if (!processorResult.getValidationResult().isCompliant()) { if (!processorResult.getValidationResult().isCompliant()) {
context.setInvalid(); context.setInvalid();
} }
PDFAFlavour pdfaFlavourFromValidationResult = processorResult.getValidationResult().getPDFAFlavour();
if (Arrays.stream(PDF_A_3_FLAVOURS) if (Arrays.stream(PDF_A_3_FLAVOURS)
.anyMatch(pdfaFlavour -> processorResult.getValidationResult().getPDFAFlavour().equals(pdfaFlavour))) { .noneMatch(pdfaFlavourFromValidationResult::equals)) {
context.addResultItem( context.addResultItem(
new ValidationResultItem(ESeverity.error, "Not a PDF/A-3").setSection(23).setPart(EPart.pdf)); new ValidationResultItem(ESeverity.error, "Not a PDF/A-3").setSection(23).setPart(EPart.pdf));

View File

@@ -419,11 +419,16 @@ public class XMLValidator extends Validator {
* @param xml the xml to be checked * @param xml the xml to be checked
* @param xsltFilename the filename of the intermediate XSLT file * @param xsltFilename the filename of the intermediate XSLT file
* @param section the error type code, if one arises * @param section the error type code, if one arises
* @param severity how serious a error should be treated - may only be notice * @param defaultSeverity how serious a error should be treated - may only be notice
* @throws IrrecoverableValidationError if anything happened that prevents further checks * @throws IrrecoverableValidationError if anything happened that prevents further checks
*/ */
public void validateSchematron(String xml, String xsltFilename, int section, ESeverity severity) throws IrrecoverableValidationError { public void validateSchematron(String xml, String xsltFilename, int section, ESeverity defaultSeverity) throws IrrecoverableValidationError {
ISchematronResource aResSCH = null; ISchematronResource aResSCH = null;
ESeverity severity=defaultSeverity;
if (defaultSeverity!=ESeverity.notice) {
severity=ESeverity.error;
}
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename); aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
if (aResSCH != null) { if (aResSCH != null) {
@@ -465,6 +470,16 @@ public class XMLValidator extends Validator {
thisFailLocation = currentFailNode.getAttributes().getNamedItem("location").getNodeValue(); thisFailLocation = currentFailNode.getAttributes().getNamedItem("location").getNodeValue();
} }
if (currentFailNode.getAttributes().getNamedItem("flag") != null) {
// the XR issues warnings with flag=warning
if (currentFailNode.getAttributes().getNamedItem("flag").getNodeValue().equals("warning")) {
if (defaultSeverity!=ESeverity.notice) {
severity=ESeverity.warning;
}
}
}
NodeList failChilds = currentFailNode.getChildNodes(); NodeList failChilds = currentFailNode.getChildNodes();
for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) { for (int failChildIndex = 0; failChildIndex < failChilds.getLength(); failChildIndex++) {
if (failChilds.item(failChildIndex).getLocalName() != null) { if (failChilds.item(failChildIndex).getLocalName() != null) {

View File

@@ -2,6 +2,15 @@ package org.mustangproject.validator;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.xmlunit.builder.Input;
import org.xmlunit.xpath.JAXPXPathEngine;
import org.xmlunit.xpath.XPathEngine;
import static org.xmlunit.assertj.XmlAssert.assertThat; import static org.xmlunit.assertj.XmlAssert.assertThat;
@@ -132,6 +141,17 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
} }
public void testPDFA3AValidation() {
File tempFile = getResourceAsFile("zugferd_2p1_EXTENDED_PDFA-3A.pdf");
ZUGFeRDValidator zfv = new ZUGFeRDValidator();
String res = zfv.validate(tempFile.getAbsolutePath());
assertThat(res).valueByXPath("/validation/pdf/summary/@status")
.isEqualTo("valid");
}
/*** /***
* the XMLValidatorTests only cover the <xml></xml> part, this one includes the root element and * the XMLValidatorTests only cover the <xml></xml> part, this one includes the root element and
* the global <summary></summary> part as well * the global <summary></summary> part as well
@@ -205,6 +225,9 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
assertThat(res).valueByXPath("count(//error)") assertThat(res).valueByXPath("count(//error)")
.asInt() .asInt()
.isEqualTo(3); .isEqualTo(3);
assertThat(res).valueByXPath("count(//warning)")
.asInt()
.isEqualTo(1);
assertThat(res).valueByXPath("count(//notice)") assertThat(res).valueByXPath("count(//notice)")
.asInt() .asInt()

View File

@@ -115,9 +115,6 @@
<ram:CityName>[Seller city]</ram:CityName> <ram:CityName>[Seller city]</ram:CityName>
<ram:CountryID>DE</ram:CountryID> <ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress> </ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="EM">seller@email.de</ram:URIID>
</ram:URIUniversalCommunication>
<ram:SpecifiedTaxRegistration> <ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE 123456789</ram:ID> <ram:ID schemeID="VA">DE 123456789</ram:ID>
</ram:SpecifiedTaxRegistration> </ram:SpecifiedTaxRegistration>