Merge pull request #79 from HardyLoppmann/master
Syntax sugar, simplify test and use editorconfig
This commit is contained in:
19
.editorconfig
Normal file
19
.editorconfig
Normal file
@@ -0,0 +1,19 @@
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
|
||||
# Tab indentation (no size specified)
|
||||
[*.java]
|
||||
indent_style = tab
|
||||
|
||||
# 2 all x** Files
|
||||
[*.xsd,*.xsl,*.xml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:Standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"><!--
|
||||
Migrated by Mustangproject XSLT
|
||||
--><rsm:ExchangedDocumentContext>
|
||||
-->
|
||||
<rsm:ExchangedDocumentContext>
|
||||
<ram:TestIndicator>
|
||||
<udt:Indicator>false</udt:Indicator>
|
||||
</ram:TestIndicator>
|
||||
@@ -12,7 +13,7 @@ Migrated by Mustangproject XSLT
|
||||
<ram:ID>urn:ferd:CrossIndustryDocument:invoice:1p0:extended</ram:ID>
|
||||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<rsm:ExchangedDocument xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:ID>RE-20170509/505</ram:ID>
|
||||
<ram:Name>RECHNUNG</ram:Name>
|
||||
<ram:TypeCode>380</ram:TypeCode>
|
||||
@@ -20,16 +21,16 @@ Migrated by Mustangproject XSLT
|
||||
<udt:DateTimeString format="102">20170509</udt:DateTimeString>
|
||||
</ram:IssueDateTime>
|
||||
</rsm:ExchangedDocument>
|
||||
<rsm:SupplyChainTradeTransaction xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<rsm:SupplyChainTradeTransaction xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>1</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">160.0000</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
|
||||
@@ -39,10 +40,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="HUR">1.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -52,16 +53,16 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">160.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>2</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Luftballon: Bunt, ca. 500ml</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">0.7900</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="C62">1.0000</ram:BasisQuantity>
|
||||
@@ -71,10 +72,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="C62">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="C62">400.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -84,16 +85,16 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">316.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>3</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Heiße Luft pro Liter</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">0.1000</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
|
||||
@@ -103,10 +104,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="LTR">200.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -116,8 +117,8 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">20.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:SellerTradeParty>
|
||||
<ram:Name>Bei Spiel GmbH</ram:Name>
|
||||
<ram:PostalTradeAddress>
|
||||
@@ -146,14 +147,14 @@ Migrated by Mustangproject XSLT
|
||||
</ram:SpecifiedTaxRegistration>
|
||||
</ram:BuyerTradeParty>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ActualDeliverySupplyChainEvent>
|
||||
<ram:OccurrenceDateTime>
|
||||
<udt:DateTimeString format="102">20170507</udt:DateTimeString>
|
||||
</ram:OccurrenceDateTime>
|
||||
</ram:ActualDeliverySupplyChainEvent>
|
||||
</ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:PaymentReference>RE-20170509/505</ram:PaymentReference>
|
||||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
@@ -199,6 +200,6 @@ Migrated by Mustangproject XSLT
|
||||
<ram:DuePayableAmount currencyID="EUR">571.04</ram:DuePayableAmount>
|
||||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
</ram:ApplicableHeaderTradeSettlement>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:CrossIndustryInvoice>
|
||||
|
||||
|
||||
@@ -17,15 +17,15 @@ import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1Factory;
|
||||
public class MustangWriter implements IZUGFeRDExportableTransaction {
|
||||
|
||||
public static void main(String[] args) {
|
||||
MustangWriter m1=new MustangWriter();
|
||||
MustangWriter m1 = new MustangWriter();
|
||||
m1.apply();
|
||||
}
|
||||
|
||||
private void apply() {
|
||||
try {
|
||||
System.out.println("Reading Blanko-PDF");
|
||||
ZUGFeRDExporter ze=
|
||||
new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator(System.getProperty("user.name")).load("./MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
ZUGFeRDExporter ze =
|
||||
new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator(System.getProperty("user.name")).load("./MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
System.out.println("Generating and attaching ZUGFeRD-Data");
|
||||
ze.PDFattachZugferdFile(this);
|
||||
System.out.println("Writing ZUGFeRD-PDF");
|
||||
@@ -36,6 +36,7 @@ public class MustangWriter implements IZUGFeRDExportableTransaction {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrency() {
|
||||
// TODO Auto-generated method stub
|
||||
@@ -44,18 +45,18 @@ public class MustangWriter implements IZUGFeRDExportableTransaction {
|
||||
|
||||
@Override
|
||||
public Date getDeliveryDate() {
|
||||
return new GregorianCalendar(2017,Calendar.NOVEMBER,17).getTime();
|
||||
return new GregorianCalendar(2017, Calendar.NOVEMBER, 17).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDueDate() {
|
||||
|
||||
return new GregorianCalendar(2017,Calendar.DECEMBER,9).getTime();
|
||||
return new GregorianCalendar(2017, Calendar.DECEMBER, 9).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getIssueDate() {
|
||||
return new GregorianCalendar(2017,Calendar.NOVEMBER,18).getTime();
|
||||
return new GregorianCalendar(2017, Calendar.NOVEMBER, 18).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -90,10 +91,10 @@ public class MustangWriter implements IZUGFeRDExportableTransaction {
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return "Bei Spiel GmbH\n"+
|
||||
"Ecke 12\n"+
|
||||
"12345 Stadthausen\n"+
|
||||
"Geschäftsführer: Max Mustermann";
|
||||
return "Bei Spiel GmbH\n" +
|
||||
"Ecke 12\n" +
|
||||
"12345 Stadthausen\n" +
|
||||
"Geschäftsführer: Max Mustermann";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,15 +161,15 @@ public class MustangWriter implements IZUGFeRDExportableTransaction {
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableItem[] getZFItems() {
|
||||
Item[] allItems=new Item[3];
|
||||
Product designProduct=new Product("", "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung", "HUR", new BigDecimal("7.000000"));
|
||||
Product balloonProduct=new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
||||
Product airProduct=new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||
Item[] allItems = new Item[3];
|
||||
Product designProduct = new Product("", "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung", "HUR", new BigDecimal("7.000000"));
|
||||
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||
|
||||
allItems[0]=new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
allItems[1]=new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||
allItems[2]=new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||
return allItems;
|
||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||
return allItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actions>
|
||||
<action>
|
||||
<actionName>CUSTOM-Generate mvn-repo</actionName>
|
||||
<displayName>Generate mvn-repo</displayName>
|
||||
<goals>
|
||||
<goal>site:deploy</goal>
|
||||
</goals>
|
||||
</action>
|
||||
<action>
|
||||
<actionName>CUSTOM-mvn-repo</actionName>
|
||||
<displayName>mvn-repo</displayName>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
</action>
|
||||
<action>
|
||||
<actionName>CUSTOM-deploy</actionName>
|
||||
<displayName>deploy</displayName>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</action>
|
||||
</actions>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<actions>
|
||||
<action>
|
||||
<actionName>CUSTOM-Generate mvn-repo</actionName>
|
||||
<displayName>Generate mvn-repo</displayName>
|
||||
<goals>
|
||||
<goal>site:deploy</goal>
|
||||
</goals>
|
||||
</action>
|
||||
<action>
|
||||
<actionName>CUSTOM-mvn-repo</actionName>
|
||||
<displayName>mvn-repo</displayName>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
</action>
|
||||
<action>
|
||||
<actionName>CUSTOM-deploy</actionName>
|
||||
<displayName>deploy</displayName>
|
||||
<goals>
|
||||
<goal>deploy</goal>
|
||||
</goals>
|
||||
</action>
|
||||
</actions>
|
||||
|
||||
56
pom.xml
56
pom.xml
@@ -1,12 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mustangproject.ZUGFeRD</groupId>
|
||||
<artifactId>mustang</artifactId>
|
||||
<version>1.6.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Mustang</name>
|
||||
<description>The Mustang project is a java library to read and write ZUGFeRD meta data inside your invoice PDFs</description>
|
||||
<description>The Mustang project is a java library to read and write ZUGFeRD meta data inside your invoice PDFs
|
||||
</description>
|
||||
<url>http://www.mustangproject.org/</url>
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/ZUGFeRD/mustangproject.git</connection>
|
||||
@@ -86,6 +88,12 @@
|
||||
<version>5.0.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xmlunit</groupId>
|
||||
<artifactId>xmlunit-core</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- For Toecount -->
|
||||
<dependency>
|
||||
<groupId>com.sanityinc</groupId>
|
||||
@@ -133,21 +141,22 @@
|
||||
|
||||
|
||||
<!-- /toecount -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<configuration>
|
||||
|
||||
<excludePackageNames>org.mustangproject.ZUGFeRD.model.*</excludePackageNames>
|
||||
|
||||
</configuration>
|
||||
</plugin>
|
||||
<excludePackageNames>org.mustangproject.ZUGFeRD.model.*</excludePackageNames>
|
||||
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<configuration>
|
||||
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>
|
||||
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo
|
||||
</altDeploymentRepository>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@@ -189,22 +198,23 @@
|
||||
<version>2.4.3</version>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>org.mustangproject.toecount.Toecount</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<filters>
|
||||
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
<filter>
|
||||
|
||||
<filter>
|
||||
<artifact>*:*</artifact>
|
||||
<excludes>
|
||||
<exclude>META-INF/*.SF</exclude>
|
||||
<exclude>META-INF/*.DSA</exclude>
|
||||
<exclude>META-INF/*.RSA</exclude>
|
||||
</excludes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>log4j:log4j</artifact>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
|
||||
@@ -19,5 +19,5 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public final class Version {
|
||||
public static final String VERSION = "${project.version}";
|
||||
public static final String VERSION = "${project.version}";
|
||||
}
|
||||
|
||||
@@ -28,12 +28,12 @@ public class CustomXMLProvider implements IXMLProvider {
|
||||
}
|
||||
|
||||
public void setXML(byte[] newData) {
|
||||
String zf=new String(newData);
|
||||
String zf = new String(newData);
|
||||
if (!zf.contains("<rsm:CrossIndustry")) {
|
||||
throw new RuntimeException("ZUGFeRD XML does not contain <rsm:CrossIndustry and can thus not be valid");
|
||||
}
|
||||
|
||||
zugferdData=newData;
|
||||
zugferdData = newData;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,29 +23,34 @@ import java.io.InputStream;
|
||||
|
||||
public interface IExporterFactory {
|
||||
public ZUGFeRDExporter load(String pdfFilename) throws IOException;
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
* metadata level, this will not e.g. convert graphics to JPG-2000)
|
||||
*
|
||||
* @param pdfBinary
|
||||
* binary of a PDF/A1 compliant document
|
||||
* @param pdfBinary binary of a PDF/A1 compliant document
|
||||
*/
|
||||
public ZUGFeRDExporter load(byte[] pdfBinary) throws IOException;
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
* metadata level, this will not e.g. convert graphics to JPG-2000)
|
||||
*
|
||||
* @param pdfSource
|
||||
* source to read a PDF/A1 compliant document from
|
||||
* @param pdfSource source to read a PDF/A1 compliant document from
|
||||
* @throws IOException
|
||||
*/
|
||||
public ZUGFeRDExporter load(InputStream pdfSource) throws IOException;
|
||||
|
||||
public IExporterFactory setCreator(String creator);
|
||||
|
||||
public IExporterFactory setConformanceLevel(PDFAConformanceLevel newLevel);
|
||||
public IExporterFactory setProducer(String producer) ;
|
||||
|
||||
public IExporterFactory setProducer(String producer);
|
||||
|
||||
public IExporterFactory setZUGFeRDVersion(int version);
|
||||
|
||||
public IExporterFactory ignorePDFAErrors();
|
||||
|
||||
public IExporterFactory setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zugferdConformanceLevel);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package org.mustangproject.ZUGFeRD;
|
||||
public interface IXMLProvider {
|
||||
|
||||
public byte[] getXML();
|
||||
|
||||
public void setTest();
|
||||
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans);
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
/*
|
||||
* Copyright 2015 AlexanderSchmidt.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author AlexanderSchmidt
|
||||
*/
|
||||
public interface IZUGFeRDAllowanceCharge {
|
||||
BigDecimal getTotalAmount();
|
||||
|
||||
String getReason();
|
||||
|
||||
BigDecimal getTaxPercent();
|
||||
|
||||
}
|
||||
/*
|
||||
* Copyright 2015 AlexanderSchmidt.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author AlexanderSchmidt
|
||||
*/
|
||||
public interface IZUGFeRDAllowanceCharge {
|
||||
BigDecimal getTotalAmount();
|
||||
|
||||
String getReason();
|
||||
|
||||
BigDecimal getTaxPercent();
|
||||
|
||||
}
|
||||
|
||||
@@ -17,50 +17,58 @@
|
||||
*
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
/**
|
||||
* Mustangproject's ZUGFeRD implementation
|
||||
* Neccessary interface for ZUGFeRD exporter
|
||||
* Licensed under the APLv2
|
||||
* @date 2014-05-10
|
||||
* @version 1.2.0
|
||||
*
|
||||
* @author jstaerk
|
||||
* */
|
||||
* @version 1.2.0
|
||||
* @date 2014-05-10
|
||||
*/
|
||||
|
||||
|
||||
public interface IZUGFeRDExportableContact {
|
||||
|
||||
/**
|
||||
* First and last name of the recipient
|
||||
*
|
||||
* @return First and last name of the recipient
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Postal code of the recipient
|
||||
*
|
||||
* @return Postal code of the recipient
|
||||
*/
|
||||
String getZIP();
|
||||
|
||||
/**
|
||||
* VAT ID (Umsatzsteueridentifikationsnummer) of the contact
|
||||
*
|
||||
* @return VAT ID (Umsatzsteueridentifikationsnummer) of the contact
|
||||
*/
|
||||
String getVATID();
|
||||
|
||||
/**
|
||||
* two-letter country code of the contact
|
||||
*
|
||||
* @return two-letter iso country code of the contact
|
||||
*/
|
||||
String getCountry();
|
||||
|
||||
/***
|
||||
/**
|
||||
* Returns the city of the contact
|
||||
*
|
||||
* @return Returns the city of the recipient
|
||||
*/
|
||||
String getLocation();
|
||||
|
||||
/***
|
||||
/**
|
||||
* Returns the street address (street+number) of the contact
|
||||
*
|
||||
* @return street address (street+number) of the contact
|
||||
*/
|
||||
String getStreet();
|
||||
|
||||
@@ -31,22 +31,25 @@ import java.math.BigDecimal;
|
||||
public interface IZUGFeRDExportableItem {
|
||||
|
||||
IZUGFeRDExportableProduct getProduct();
|
||||
IZUGFeRDAllowanceCharge[] getItemAllowances();
|
||||
IZUGFeRDAllowanceCharge[] getItemCharges();
|
||||
|
||||
IZUGFeRDAllowanceCharge[] getItemAllowances();
|
||||
|
||||
IZUGFeRDAllowanceCharge[] getItemCharges();
|
||||
|
||||
|
||||
/**
|
||||
* The price of one item excl. taxes
|
||||
*
|
||||
* @return The price of one item excl. taxes
|
||||
*/
|
||||
BigDecimal getPrice();
|
||||
|
||||
/***
|
||||
/**
|
||||
* how many
|
||||
*
|
||||
* @return the quantity of the item
|
||||
*/
|
||||
BigDecimal getQuantity();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,61 +17,67 @@
|
||||
*
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Mustangproject's ZUGFeRD implementation
|
||||
* Necessary interface for ZUGFeRD exporter
|
||||
* Licensed under the APLv2
|
||||
* @date 2014-05-10
|
||||
* @version 1.2.0
|
||||
*
|
||||
* @author jstaerk
|
||||
* */
|
||||
* @version 1.2.0
|
||||
* @date 2014-05-10
|
||||
*/
|
||||
|
||||
public interface IZUGFeRDExportableProduct {
|
||||
|
||||
/**
|
||||
* Unit code of the product
|
||||
* Most common ones are
|
||||
C62 one (piece)
|
||||
DAY day
|
||||
HAR hectare
|
||||
HUR hour
|
||||
KGM kilogram
|
||||
KTM kilometre
|
||||
KWH kilowatt hour
|
||||
LS lump sum
|
||||
LTR litre
|
||||
MIN minute
|
||||
MMK square millimetre
|
||||
MMT millimetre
|
||||
MTK square metre
|
||||
MTQ cubic metre
|
||||
MTR metre
|
||||
NAR number of articles
|
||||
NPR number of pairs
|
||||
P1 percent
|
||||
SET set
|
||||
TNE tonne (metric ton)
|
||||
WEE week
|
||||
|
||||
* C62 one (piece)
|
||||
* DAY day
|
||||
* HAR hectare
|
||||
* HUR hour
|
||||
* KGM kilogram
|
||||
* KTM kilometre
|
||||
* KWH kilowatt hour
|
||||
* LS lump sum
|
||||
* LTR litre
|
||||
* MIN minute
|
||||
* MMK square millimetre
|
||||
* MMT millimetre
|
||||
* MTK square metre
|
||||
* MTQ cubic metre
|
||||
* MTR metre
|
||||
* NAR number of articles
|
||||
* NPR number of pairs
|
||||
* P1 percent
|
||||
* SET set
|
||||
* TNE tonne (metric ton)
|
||||
* WEE week
|
||||
*
|
||||
* @return a UN/ECE rec 20 unit code see https://www.unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex2e.pdf
|
||||
*/
|
||||
String getUnit();
|
||||
|
||||
/**
|
||||
* Short name of the product
|
||||
*
|
||||
* @return Short name of the product
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* long description of the product
|
||||
*
|
||||
* @return long description of the product
|
||||
*/
|
||||
String getDescription();
|
||||
|
||||
/**
|
||||
* VAT percent of the product (e.g. 19, or 5.1 if you like)
|
||||
*
|
||||
* @return VAT percent of the product
|
||||
*/
|
||||
BigDecimal getVATPercent();
|
||||
|
||||
@@ -27,19 +27,20 @@ package org.mustangproject.ZUGFeRD;
|
||||
* */
|
||||
|
||||
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface IZUGFeRDExportableTransaction {
|
||||
|
||||
/**
|
||||
* Number, typically invoice number of the invoice
|
||||
*
|
||||
* @return invoice number
|
||||
*/
|
||||
String getNumber();
|
||||
|
||||
/**
|
||||
* the date when the invoice was created
|
||||
*
|
||||
* @return when the invoice was created
|
||||
*/
|
||||
Date getIssueDate();
|
||||
@@ -48,138 +49,160 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* this should be the full sender institution name, details, manager and tax registration.
|
||||
* It is one of the few functions which may return null.
|
||||
* e.g.
|
||||
* <p/>
|
||||
* Lieferant GmbH
|
||||
* Lieferantenstraße 20
|
||||
* 80333 München
|
||||
* Deutschland
|
||||
* Geschäftsführer: Hans Muster
|
||||
* Handelsregisternummer: H A 123
|
||||
*
|
||||
Lieferant GmbH
|
||||
Lieferantenstraße 20
|
||||
80333 München
|
||||
Deutschland
|
||||
Geschäftsführer: Hans Muster
|
||||
Handelsregisternummer: H A 123
|
||||
* @return null or full sender institution name, details, manager and tax registration
|
||||
*/
|
||||
String getOwnOrganisationFullPlaintextInfo();
|
||||
|
||||
/**
|
||||
* when the invoice is to be paid
|
||||
*
|
||||
* @return when the invoice is to be paid
|
||||
*/
|
||||
Date getDueDate();
|
||||
|
||||
IZUGFeRDAllowanceCharge[] getZFAllowances();
|
||||
IZUGFeRDAllowanceCharge[] getZFCharges();
|
||||
IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges();
|
||||
IZUGFeRDAllowanceCharge[] getZFAllowances();
|
||||
|
||||
IZUGFeRDAllowanceCharge[] getZFCharges();
|
||||
|
||||
IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges();
|
||||
|
||||
IZUGFeRDExportableItem[] getZFItems();
|
||||
|
||||
/***
|
||||
/**
|
||||
* the recipient
|
||||
*
|
||||
* @return the recipient of the invoice
|
||||
*/
|
||||
IZUGFeRDExportableContact getRecipient();
|
||||
|
||||
/***
|
||||
/**
|
||||
* BIC of the sender
|
||||
*
|
||||
* @return the BIC code of the recipient sender's bank
|
||||
*/
|
||||
String getOwnBIC();
|
||||
|
||||
/***
|
||||
* BLZ of the sender
|
||||
* @return the BLZ code of the recipient sender's bank
|
||||
*/
|
||||
String getOwnBLZ();
|
||||
/**
|
||||
* BLZ of the sender
|
||||
*
|
||||
* @return the BLZ code of the recipient sender's bank
|
||||
*/
|
||||
String getOwnBLZ();
|
||||
|
||||
/***
|
||||
/**
|
||||
* Bank name of the sender
|
||||
*
|
||||
* @return the name of the sender's bank
|
||||
*/
|
||||
String getOwnBankName();
|
||||
|
||||
/**
|
||||
* IBAN of the sender
|
||||
* @return the IBAN of the invoice sender's bank account
|
||||
*
|
||||
* @return the IBAN of the invoice sender's bank account
|
||||
*/
|
||||
String getOwnIBAN();
|
||||
|
||||
/**
|
||||
* IBAN of the sender
|
||||
* @return the Account Number of the invoice sender's bank account
|
||||
*/
|
||||
String getOwnKto();
|
||||
/**
|
||||
* IBAN of the sender
|
||||
*
|
||||
* @return the Account Number of the invoice sender's bank account
|
||||
*/
|
||||
String getOwnKto();
|
||||
|
||||
/**
|
||||
/**
|
||||
* Tax ID (not VAT ID) of the sender
|
||||
* @return Tax ID (not VAT ID) of the sender
|
||||
*
|
||||
* @return Tax ID (not VAT ID) of the sender
|
||||
*/
|
||||
String getOwnTaxID();
|
||||
|
||||
/**
|
||||
* VAT ID (Umsatzsteueridentifikationsnummer) of the sender
|
||||
*
|
||||
* @return VAT ID (Umsatzsteueridentifikationsnummer) of the sender
|
||||
*/
|
||||
String getOwnVATID();
|
||||
|
||||
/**
|
||||
* own name
|
||||
*
|
||||
* @return the sender's organisation name
|
||||
*/
|
||||
String getOwnOrganisationName();
|
||||
|
||||
/**
|
||||
* own street address
|
||||
*
|
||||
* @return sender street address
|
||||
*/
|
||||
String getOwnStreet();
|
||||
|
||||
/**
|
||||
* own street postal code
|
||||
*
|
||||
* @return sender postal code
|
||||
*/
|
||||
String getOwnZIP();
|
||||
|
||||
/**
|
||||
* own city
|
||||
*
|
||||
* @return the invoice sender's city
|
||||
*/
|
||||
String getOwnLocation();
|
||||
|
||||
/**
|
||||
* own two digit country code
|
||||
*
|
||||
* @return the invoice senders two character country iso code
|
||||
*/
|
||||
String getOwnCountry();
|
||||
|
||||
/**
|
||||
* get delivery date
|
||||
*
|
||||
* @return the day the goods have been delivered
|
||||
*/
|
||||
Date getDeliveryDate();
|
||||
|
||||
/**
|
||||
/**
|
||||
* get main invoice currency used on the invoice
|
||||
*
|
||||
* @return three character currency of this invoice
|
||||
*/
|
||||
String getCurrency();
|
||||
String getCurrency();
|
||||
|
||||
/**
|
||||
/**
|
||||
* get payment information text. e.g. Bank transfer
|
||||
*
|
||||
* @return payment information text
|
||||
*/
|
||||
String getOwnPaymentInfoText();
|
||||
String getOwnPaymentInfoText();
|
||||
|
||||
/**
|
||||
/**
|
||||
* get payment term descriptional text
|
||||
* e.g. Bis zum 22.10.2015 ohne Abzug
|
||||
* e.g. Bis zum 22.10.2015 ohne Abzug
|
||||
*
|
||||
* @return get payment terms
|
||||
*/
|
||||
String getPaymentTermDescription();
|
||||
String getPaymentTermDescription();
|
||||
|
||||
/**
|
||||
* get reference document number
|
||||
* typically used for Invoice Corrections
|
||||
* Will be added as IncludedNote in comfort profile
|
||||
* @return the ID of the document this document refers to
|
||||
*/
|
||||
String getReferenceNumber();
|
||||
/**
|
||||
* get reference document number
|
||||
* typically used for Invoice Corrections
|
||||
* Will be added as IncludedNote in comfort profile
|
||||
*
|
||||
* @return the ID of the document this document refers to
|
||||
*/
|
||||
String getReferenceNumber();
|
||||
|
||||
}
|
||||
|
||||
@@ -19,24 +19,24 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public enum PDFAConformanceLevel {
|
||||
ACCESSIBLE("A"), BASIC("B"), UNICODE("U");
|
||||
ACCESSIBLE("A"), BASIC("B"), UNICODE("U");
|
||||
|
||||
private final String letter;
|
||||
private final String letter;
|
||||
|
||||
PDFAConformanceLevel(String letter) {
|
||||
this.letter = letter;
|
||||
}
|
||||
PDFAConformanceLevel(String letter) {
|
||||
this.letter = letter;
|
||||
}
|
||||
|
||||
public String getLetter() {
|
||||
return letter;
|
||||
}
|
||||
public String getLetter() {
|
||||
return letter;
|
||||
}
|
||||
|
||||
public static PDFAConformanceLevel findByLetter(String letter) {
|
||||
for (PDFAConformanceLevel candidate : values()) {
|
||||
if (candidate.letter.equals(letter)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("PDF conformance level <" + letter + "> is unknown.");
|
||||
}
|
||||
public static PDFAConformanceLevel findByLetter(String letter) {
|
||||
for (PDFAConformanceLevel candidate : values()) {
|
||||
if (candidate.letter.equals(letter)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("PDF conformance level <" + letter + "> is unknown.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,46 +19,48 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Mustangproject's ZUGFeRD implementation
|
||||
* ZUGFeRD exporter helper class
|
||||
* Licensed under the APLv2
|
||||
* @date 2015-10-29
|
||||
* @version 1.2.0
|
||||
*
|
||||
* @author jstaerk
|
||||
* */
|
||||
* @version 1.2.0
|
||||
* @date 2015-10-29
|
||||
*/
|
||||
public class VATAmount {
|
||||
|
||||
public VATAmount(BigDecimal basis, BigDecimal calculated) {
|
||||
super();
|
||||
this.basis = basis;
|
||||
this.calculated = calculated;
|
||||
}
|
||||
public VATAmount(BigDecimal basis, BigDecimal calculated) {
|
||||
super();
|
||||
this.basis = basis;
|
||||
this.calculated = calculated;
|
||||
}
|
||||
|
||||
BigDecimal basis, calculated;
|
||||
BigDecimal basis, calculated;
|
||||
|
||||
public BigDecimal getBasis() {
|
||||
return basis;
|
||||
}
|
||||
public BigDecimal getBasis() {
|
||||
return basis;
|
||||
}
|
||||
|
||||
public void setBasis(BigDecimal basis) {
|
||||
this.basis = basis;
|
||||
}
|
||||
public void setBasis(BigDecimal basis) {
|
||||
this.basis = basis;
|
||||
}
|
||||
|
||||
public BigDecimal getCalculated() {
|
||||
return calculated;
|
||||
}
|
||||
public BigDecimal getCalculated() {
|
||||
return calculated;
|
||||
}
|
||||
|
||||
public void setCalculated(BigDecimal calculated) {
|
||||
this.calculated = calculated;
|
||||
}
|
||||
public void setCalculated(BigDecimal calculated) {
|
||||
this.calculated = calculated;
|
||||
}
|
||||
|
||||
public VATAmount add(VATAmount v) {
|
||||
return new VATAmount(basis.add(v.getBasis()), calculated.add(v.getCalculated()));
|
||||
}
|
||||
public VATAmount add(VATAmount v) {
|
||||
return new VATAmount(basis.add(v.getBasis()), calculated.add(v.getCalculated()));
|
||||
}
|
||||
|
||||
public VATAmount subtract(VATAmount v) {
|
||||
return new VATAmount(basis.subtract(v.getBasis()), calculated.subtract(v.getCalculated()));
|
||||
}
|
||||
public VATAmount subtract(VATAmount v) {
|
||||
return new VATAmount(basis.subtract(v.getBasis()), calculated.subtract(v.getCalculated()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,18 +26,11 @@ package org.mustangproject.ZUGFeRD;
|
||||
* @version 1.2.0
|
||||
* @author jstaerk
|
||||
* */
|
||||
|
||||
import org.apache.xmpbox.XMPMetadata;
|
||||
import org.apache.xmpbox.XmpConstants;
|
||||
import org.apache.xmpbox.schema.PDFAExtensionSchema;
|
||||
import org.apache.xmpbox.type.ArrayProperty;
|
||||
import org.apache.xmpbox.type.Attribute;
|
||||
import org.apache.xmpbox.type.Cardinality;
|
||||
import org.apache.xmpbox.type.ChoiceType;
|
||||
import org.apache.xmpbox.type.DefinedStructuredType;
|
||||
import org.apache.xmpbox.type.PDFAPropertyType;
|
||||
import org.apache.xmpbox.type.PDFASchemaType;
|
||||
import org.apache.xmpbox.type.StructuredType;
|
||||
import org.apache.xmpbox.type.TextType;
|
||||
import org.apache.xmpbox.type.*;
|
||||
|
||||
/**
|
||||
* Additionally to adding a RDF namespace with a indication which file
|
||||
@@ -62,13 +55,13 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
||||
|
||||
|
||||
protected void setZUGFeRDVersion(int ver) {
|
||||
namespace=ZUGFeRDExporter.getNamespaceForVersion(ver);
|
||||
prefix=ZUGFeRDExporter.getPrefixForVersion(ver);
|
||||
namespace = ZUGFeRDExporter.getNamespaceForVersion(ver);
|
||||
prefix = ZUGFeRDExporter.getPrefixForVersion(ver);
|
||||
}
|
||||
|
||||
|
||||
private DefinedStructuredType addProperty(ArrayProperty parent, String name, String type, String category,
|
||||
String description) {
|
||||
String description) {
|
||||
XMPMetadata metadata = getMetadata();
|
||||
|
||||
DefinedStructuredType li = new DefinedStructuredType(metadata, getNamespace(), getPrefix(),
|
||||
@@ -140,4 +133,4 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
||||
"The selected ZUGFeRD profile completeness");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,28 +25,29 @@ package org.mustangproject.ZUGFeRD;
|
||||
* @version 1.2.0s
|
||||
* @author jstaerk
|
||||
* */
|
||||
|
||||
import org.apache.xmpbox.XMPMetadata;
|
||||
import org.apache.xmpbox.schema.XMPSchema;
|
||||
|
||||
public class XMPSchemaZugferd extends XMPSchema {
|
||||
|
||||
/**
|
||||
* This is what needs to be added to the RDF metadata - basically the name of the embedded Zugferd file
|
||||
*/
|
||||
public XMPSchemaZugferd(XMPMetadata metadata, ZUGFeRDConformanceLevel conformanceLevel, String URN, String prefix, String filename) {
|
||||
super(metadata, URN, prefix, "ZUGFeRD Schema");
|
||||
/**
|
||||
* This is what needs to be added to the RDF metadata - basically the name of the embedded Zugferd file
|
||||
*/
|
||||
public XMPSchemaZugferd(XMPMetadata metadata, ZUGFeRDConformanceLevel conformanceLevel, String URN, String prefix, String filename) {
|
||||
super(metadata, URN, prefix, "ZUGFeRD Schema");
|
||||
|
||||
setAboutAsSimple("");
|
||||
setAboutAsSimple("");
|
||||
|
||||
String conformanceLevelValue=conformanceLevel.name();
|
||||
if (conformanceLevelValue.equals("BASICWL")) {
|
||||
conformanceLevelValue="BASIC WL";
|
||||
} else if (conformanceLevelValue.equals("EN16931")) {
|
||||
conformanceLevelValue="EN 16931";
|
||||
}
|
||||
setTextPropertyValue("ConformanceLevel", conformanceLevelValue);
|
||||
setTextPropertyValue("DocumentType", "INVOICE");
|
||||
setTextPropertyValue("DocumentFileName", filename);
|
||||
setTextPropertyValue("Version", "1.0");
|
||||
}
|
||||
String conformanceLevelValue = conformanceLevel.name();
|
||||
if (conformanceLevelValue.equals("BASICWL")) {
|
||||
conformanceLevelValue = "BASIC WL";
|
||||
} else if (conformanceLevelValue.equals("EN16931")) {
|
||||
conformanceLevelValue = "EN 16931";
|
||||
}
|
||||
setTextPropertyValue("ConformanceLevel", conformanceLevelValue);
|
||||
setTextPropertyValue("DocumentType", "INVOICE");
|
||||
setTextPropertyValue("DocumentFileName", filename);
|
||||
setTextPropertyValue("Version", "1.0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,14 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import org.mustangproject.ZUGFeRD.model.CrossIndustryDocumentType;
|
||||
import org.mustangproject.ZUGFeRD.model.ZFNamespacePrefixMapper;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import org.mustangproject.ZUGFeRD.model.CrossIndustryDocumentType;
|
||||
import org.mustangproject.ZUGFeRD.model.ZFNamespacePrefixMapper;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
public class ZUGFeRD1PullProvider implements IXMLProvider {
|
||||
|
||||
@@ -35,14 +36,13 @@ public class ZUGFeRD1PullProvider implements IXMLProvider {
|
||||
private boolean isTest;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* enables the flag to indicate a test invoice in the XML structure
|
||||
*
|
||||
*/
|
||||
public void setTest() {
|
||||
isTest = true;
|
||||
}
|
||||
|
||||
public ZUGFeRD1PullProvider() {
|
||||
// TODO Auto-generated constructor stub
|
||||
try {
|
||||
@@ -50,16 +50,16 @@ public class ZUGFeRD1PullProvider implements IXMLProvider {
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
|
||||
marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8");
|
||||
marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new ZFNamespacePrefixMapper());
|
||||
} catch (JAXBException e) {
|
||||
throw new ZUGFeRDExportException("Could not initialize JAXB", e);
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
throw new ZUGFeRDExportException("Could not initialize JAXB", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private String createZugferdXMLForTransaction(IZUGFeRDExportableTransaction trans) {
|
||||
|
||||
JAXBElement<CrossIndustryDocumentType> jaxElement =
|
||||
new ZUGFeRDTransactionModelConverter(trans).withTest(isTest).convertToModel();
|
||||
new ZUGFeRDTransactionModelConverter(trans).withTest(isTest).convertToModel();
|
||||
|
||||
try {
|
||||
return marshalJaxToXMLString(jaxElement);
|
||||
@@ -83,23 +83,22 @@ public class ZUGFeRD1PullProvider implements IXMLProvider {
|
||||
|
||||
@Override
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans) {
|
||||
// create a dummy file stream, this would probably normally be a
|
||||
// FileInputStream
|
||||
// create a dummy file stream, this would probably normally be a
|
||||
// FileInputStream
|
||||
|
||||
byte[] zugferdRaw = createZugferdXMLForTransaction(trans).getBytes(); //$NON-NLS-1$
|
||||
byte[] zugferdRaw = createZugferdXMLForTransaction(trans).getBytes(); //$NON-NLS-1$
|
||||
|
||||
if ((zugferdRaw[0] == (byte) 0xEF)
|
||||
&& (zugferdRaw[1] == (byte) 0xBB)
|
||||
&& (zugferdRaw[2] == (byte) 0xBF)) {
|
||||
// I don't like BOMs, lets remove it
|
||||
zugferdData = new byte[zugferdRaw.length - 3];
|
||||
System.arraycopy(zugferdRaw, 3, zugferdData, 0,
|
||||
zugferdRaw.length - 3);
|
||||
} else {
|
||||
zugferdData = zugferdRaw;
|
||||
}
|
||||
if ((zugferdRaw[0] == (byte) 0xEF)
|
||||
&& (zugferdRaw[1] == (byte) 0xBB)
|
||||
&& (zugferdRaw[2] == (byte) 0xBF)) {
|
||||
// I don't like BOMs, lets remove it
|
||||
zugferdData = new byte[zugferdRaw.length - 3];
|
||||
System.arraycopy(zugferdRaw, 3, zugferdData, 0,
|
||||
zugferdRaw.length - 3);
|
||||
} else {
|
||||
zugferdData = zugferdRaw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,18 +29,18 @@ import java.util.HashMap;
|
||||
public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
|
||||
private class LineCalc {
|
||||
private IZUGFeRDExportableItem currentItem=null;
|
||||
private IZUGFeRDExportableItem currentItem = null;
|
||||
private BigDecimal totalGross;
|
||||
private BigDecimal itemTotalNetAmount;
|
||||
private BigDecimal itemTotalVATAmount;
|
||||
|
||||
public LineCalc(IZUGFeRDExportableItem currentItem) {
|
||||
this.currentItem=currentItem;
|
||||
BigDecimal multiplicator=currentItem.getProduct().getVATPercent().divide(new BigDecimal(100)).add(new BigDecimal(1));
|
||||
this.currentItem = currentItem;
|
||||
BigDecimal multiplicator = currentItem.getProduct().getVATPercent().divide(new BigDecimal(100)).add(new BigDecimal(1));
|
||||
// priceGross=currentItem.getPrice().multiply(multiplicator);
|
||||
totalGross=currentItem.getPrice().multiply(multiplicator).multiply(currentItem.getQuantity());
|
||||
itemTotalNetAmount=currentItem.getQuantity().multiply(currentItem.getPrice()).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
itemTotalVATAmount=totalGross.subtract(itemTotalNetAmount);
|
||||
totalGross = currentItem.getPrice().multiply(multiplicator).multiply(currentItem.getQuantity());
|
||||
itemTotalNetAmount = currentItem.getQuantity().multiply(currentItem.getPrice()).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
itemTotalVATAmount = totalGross.subtract(itemTotalNetAmount);
|
||||
}
|
||||
|
||||
public BigDecimal getItemTotalNetAmount() {
|
||||
@@ -54,7 +54,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// MAIN CLASS
|
||||
|
||||
protected byte[] zugferdData;
|
||||
@@ -63,7 +62,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
|
||||
/**
|
||||
* enables the flag to indicate a test invoice in the XML structure
|
||||
*
|
||||
*/
|
||||
public void setTest() {
|
||||
isTest = true;
|
||||
@@ -96,13 +94,13 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
*
|
||||
* results 0.00 -1,10 -1,10 -1,01 20000123,34 20000123,34 12,00
|
||||
*/
|
||||
value=value.setScale( scale, BigDecimal.ROUND_HALF_UP ); // first, round so that e.g. 1.189999999999999946709294817992486059665679931640625 becomes 1.19
|
||||
value = value.setScale(scale, BigDecimal.ROUND_HALF_UP); // first, round so that e.g. 1.189999999999999946709294817992486059665679931640625 becomes 1.19
|
||||
char[] repeat = new char[scale];
|
||||
Arrays.fill(repeat, '0');
|
||||
|
||||
DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols();
|
||||
otherSymbols.setDecimalSeparator('.');
|
||||
DecimalFormat dec = new DecimalFormat("0."+new String(repeat), otherSymbols);
|
||||
DecimalFormat dec = new DecimalFormat("0." + new String(repeat), otherSymbols);
|
||||
return dec.format(value);
|
||||
|
||||
}
|
||||
@@ -118,6 +116,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
private String priceFormat(BigDecimal value) {
|
||||
return nDigitFormat(value, 4);
|
||||
}
|
||||
|
||||
private String quantityFormat(BigDecimal value) {
|
||||
return nDigitFormat(value, 4);
|
||||
}
|
||||
@@ -129,11 +128,11 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
|
||||
private BigDecimal getTotalGross() {
|
||||
|
||||
BigDecimal res=getTotal();
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap=getVATPercentAmountMap();
|
||||
BigDecimal res = getTotal();
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap = getVATPercentAmountMap();
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
res=res.add(amount.getCalculated());
|
||||
res = res.add(amount.getCalculated());
|
||||
}
|
||||
|
||||
|
||||
@@ -141,10 +140,10 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
}
|
||||
|
||||
private BigDecimal getTotal() {
|
||||
BigDecimal res=new BigDecimal(0);
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
LineCalc lc=new LineCalc(currentItem);
|
||||
res=res.add(lc.getItemTotalNetAmount());
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
res = res.add(lc.getItemTotalNetAmount());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -154,18 +153,18 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
* empty for no taxes, or e.g. 19=>190 and 7=>14 if 1000 Eur were applicable
|
||||
* to 19% VAT (=>190 EUR VAT) and 200 EUR were applicable to 7% (=>14 EUR VAT)
|
||||
* 190 Eur
|
||||
* @return which taxes have been used with which amounts in this invoice
|
||||
*
|
||||
*/
|
||||
* @return which taxes have been used with which amounts in this invoice
|
||||
*/
|
||||
private HashMap<BigDecimal, VATAmount> getVATPercentAmountMap() {
|
||||
HashMap<BigDecimal, VATAmount> hm=new HashMap<BigDecimal, VATAmount> ();
|
||||
HashMap<BigDecimal, VATAmount> hm = new HashMap<BigDecimal, VATAmount>();
|
||||
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
BigDecimal percent=currentItem.getProduct().getVATPercent();
|
||||
LineCalc lc=new LineCalc(currentItem);
|
||||
VATAmount itemVATAmount=new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount() ) ;
|
||||
VATAmount current=hm.get(percent);
|
||||
if (current==null) {
|
||||
BigDecimal percent = currentItem.getProduct().getVATPercent();
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
VATAmount itemVATAmount = new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount());
|
||||
VATAmount current = hm.get(percent);
|
||||
if (current == null) {
|
||||
hm.put(percent, itemVATAmount);
|
||||
} else {
|
||||
hm.put(percent, current.add(itemVATAmount));
|
||||
@@ -180,17 +179,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
@Override
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans) {
|
||||
|
||||
this.trans=trans;
|
||||
this.trans = trans;
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
|
||||
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
|
||||
String testBooleanStr="false";
|
||||
String testBooleanStr = "false";
|
||||
if (isTest) {
|
||||
testBooleanStr="true";
|
||||
testBooleanStr = "true";
|
||||
|
||||
}
|
||||
String senderReg="";
|
||||
if (trans.getOwnOrganisationFullPlaintextInfo()!=null) {
|
||||
senderReg=""
|
||||
String senderReg = "";
|
||||
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
||||
senderReg = ""
|
||||
+ "<ram:IncludedCINote>\n"
|
||||
+ " <ram:Content>\n"
|
||||
+ trans.getOwnOrganisationFullPlaintextInfo()
|
||||
@@ -201,25 +200,24 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
}
|
||||
|
||||
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
|
||||
|
||||
String xml= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
|
||||
|
||||
+ "<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\""
|
||||
+ "<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\""
|
||||
// + " xsi:schemaLocation=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100 ../Schema/ZUGFeRD1p0.xsd\""
|
||||
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\""
|
||||
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n" //$NON-NLS-1$
|
||||
+ " <rsm:ExchangedDocumentContext>\n" //$NON-NLS-1$
|
||||
+ " xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\""
|
||||
+ " xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n" //$NON-NLS-1$
|
||||
+ " <rsm:ExchangedDocumentContext>\n" //$NON-NLS-1$
|
||||
// + " <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n" //$NON-NLS-1$
|
||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID>urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931</ram:ID>\n" //$NON-NLS-1$
|
||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
|
||||
+ " </rsm:ExchangedDocumentContext>\n" //$NON-NLS-1$
|
||||
+ " <rsm:ExchangedDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID>"+trans.getNumber()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID>urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931</ram:ID>\n" //$NON-NLS-1$
|
||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
|
||||
+ " </rsm:ExchangedDocumentContext>\n" //$NON-NLS-1$
|
||||
+ " <rsm:ExchangedDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID>" + trans.getNumber() + "</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// + " <ram:Name>RECHNUNG</ram:Name>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>380</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:IssueDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getIssueDate())+"</udt:DateTimeString></ram:IssueDateTime>\n" //date format was 20130605 //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ senderReg
|
||||
+ " <ram:TypeCode>380</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:IssueDateTime><udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(trans.getIssueDate()) + "</udt:DateTimeString></ram:IssueDateTime>\n" //date format was 20130605 //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ senderReg
|
||||
// + " <IncludedNote>\n"
|
||||
// + " <Content>\n"
|
||||
// + "Rechnung gemäß Bestellung Nr. 2013-471331 vom 01.03.2013.\n"
|
||||
@@ -232,145 +230,142 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
// + " </Content>\n"
|
||||
// + " <SubjectCode>AAK</SubjectCode>\n"
|
||||
// + " </IncludedNote>\n"
|
||||
+ " </rsm:ExchangedDocument>\n" //$NON-NLS-1$
|
||||
+ " <rsm:SupplyChainTradeTransaction>\n"; //$NON-NLS-1$
|
||||
int lineID=0;
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
lineID++;
|
||||
+ " </rsm:ExchangedDocument>\n" //$NON-NLS-1$
|
||||
+ " <rsm:SupplyChainTradeTransaction>\n"; //$NON-NLS-1$
|
||||
int lineID = 0;
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
lineID++;
|
||||
|
||||
LineCalc lc=new LineCalc(currentItem);
|
||||
xml=xml+ " <ram:IncludedSupplyChainTradeLineItem>\n"+ //$NON-NLS-1$
|
||||
" <ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineID>"+lineID+"</ram:LineID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" + //$NON-NLS-1$
|
||||
" <ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineID>" + lineID + "</ram:LineID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:AssociatedDocumentLineDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
|
||||
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
|
||||
// + " <SellerAssignedID>KR3M</SellerAssignedID>\n"
|
||||
// + " <BuyerAssignedID>55T01</BuyerAssignedID>\n"
|
||||
+ " <ram:Name>"+currentItem.getProduct().getName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:Description>"+currentItem.getProduct().getDescription()+"</ram:Description>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
|
||||
+ " <ram:Name>" + currentItem.getProduct().getName() + "</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:Description>" + currentItem.getProduct().getDescription() + "</ram:Description>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
|
||||
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:ChargeAmount>"+priceFormat(currentItem.getPrice())+"</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ //currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1.0000</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:ChargeAmount>" + priceFormat(currentItem.getPrice()) + "</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ //currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\"" + currentItem.getProduct().getUnit() + "\">1.0000</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// + " <AppliedTradeAllowanceCharge>\n"
|
||||
// + " <ChargeIndicator>false</ChargeIndicator>\n"
|
||||
// + " <ActualAmount currencyID=\"EUR\">0.6667</ActualAmount>\n"
|
||||
// + " <Reason>Rabatt</Reason>\n"
|
||||
// + " </AppliedTradeAllowanceCharge>\n"
|
||||
+ " </ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:ChargeAmount>"+priceFormat(currentItem.getPrice())+"</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">1.0000</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " </ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:ChargeAmount>" + priceFormat(currentItem.getPrice()) + "</ram:ChargeAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\"" + currentItem.getProduct().getUnit() + "\">1.0000</ram:BasisQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
|
||||
+ " <ram:SpecifiedLineTradeDelivery>\n" //$NON-NLS-1$
|
||||
+ " <ram:BilledQuantity unitCode=\""+currentItem.getProduct().getUnit()+"\">"+quantityFormat(currentItem.getQuantity())+"</ram:BilledQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ " </ram:SpecifiedLineTradeDelivery>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:CategoryCode>S</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:RateApplicablePercent>"+vatFormat(currentItem.getProduct().getVATPercent())+"</ram:RateApplicablePercent>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>"+currencyFormat(lc.getItemTotalNetAmount())+"</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedLineTradeDelivery>\n" //$NON-NLS-1$
|
||||
+ " <ram:BilledQuantity unitCode=\"" + currentItem.getProduct().getUnit() + "\">" + quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>\n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ " </ram:SpecifiedLineTradeDelivery>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:CategoryCode>S</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount()) + "</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
xml=xml+ " <ram:ApplicableHeaderTradeAgreement>\n" //$NON-NLS-1$
|
||||
xml = xml + " <ram:ApplicableHeaderTradeAgreement>\n" //$NON-NLS-1$
|
||||
// + " <BuyerReference>AB-312</BuyerReference>\n"
|
||||
+ " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||
+ " <ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||
// + " <GlobalID schemeID=\"0088\">4000001123452</GlobalID>\n"
|
||||
+ " <ram:Name>"+trans.getOwnOrganisationName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:PostalTradeAddress>\n"
|
||||
+ " <ram:PostcodeCode>"+trans.getOwnZIP()+"</ram:PostcodeCode>\n"
|
||||
+ " <ram:LineOne>"+trans.getOwnStreet()+"</ram:LineOne>\n"
|
||||
+ " <ram:CityName>"+trans.getOwnLocation()+"</ram:CityName>\n"
|
||||
+ " <ram:CountryID>"+trans.getOwnCountry()+"</ram:CountryID>\n"
|
||||
+ " </ram:PostalTradeAddress>\n"
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"FC\">"+trans.getOwnTaxID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"VA\">"+trans.getOwnVATID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " </ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||
+ " <ram:BuyerTradeParty>\n" //$NON-NLS-1$
|
||||
+ " <ram:Name>" + trans.getOwnOrganisationName() + "</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:PostalTradeAddress>\n"
|
||||
+ " <ram:PostcodeCode>" + trans.getOwnZIP() + "</ram:PostcodeCode>\n"
|
||||
+ " <ram:LineOne>" + trans.getOwnStreet() + "</ram:LineOne>\n"
|
||||
+ " <ram:CityName>" + trans.getOwnLocation() + "</ram:CityName>\n"
|
||||
+ " <ram:CountryID>" + trans.getOwnCountry() + "</ram:CountryID>\n"
|
||||
+ " </ram:PostalTradeAddress>\n"
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"FC\">" + trans.getOwnTaxID() + "</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"VA\">" + trans.getOwnVATID() + "</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " </ram:SellerTradeParty>\n" //$NON-NLS-1$
|
||||
+ " <ram:BuyerTradeParty>\n" //$NON-NLS-1$
|
||||
// + " <ID>GE2020211</ID>\n"
|
||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
||||
+ " <ram:Name>"+trans.getRecipient().getName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:Name>" + trans.getRecipient().getName() + "</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// + " <DefinedTradeContact>\n"
|
||||
// + " <PersonName>xxx</PersonName>\n"
|
||||
// + " </DefinedTradeContact>\n"
|
||||
+ " <ram:PostalTradeAddress>\n" //$NON-NLS-1$
|
||||
+ " <ram:PostcodeCode>"+trans.getRecipient().getZIP()+"</ram:PostcodeCode>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:LineOne>"+trans.getRecipient().getStreet()+"</ram:LineOne>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:CityName>"+trans.getRecipient().getLocation()+"</ram:CityName>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:CountryID>"+trans.getRecipient().getCountry()+"</ram:CountryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:PostalTradeAddress>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"VA\">"+trans.getRecipient().getVATID()+"</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " </ram:BuyerTradeParty>\n" //$NON-NLS-1$
|
||||
+ " <ram:PostalTradeAddress>\n" //$NON-NLS-1$
|
||||
+ " <ram:PostcodeCode>" + trans.getRecipient().getZIP() + "</ram:PostcodeCode>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:LineOne>" + trans.getRecipient().getStreet() + "</ram:LineOne>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:CityName>" + trans.getRecipient().getLocation() + "</ram:CityName>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:CountryID>" + trans.getRecipient().getCountry() + "</ram:CountryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:PostalTradeAddress>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"VA\">" + trans.getRecipient().getVATID() + "</ram:ID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " </ram:BuyerTradeParty>\n" //$NON-NLS-1$
|
||||
// + " <BuyerOrderReferencedDocument>\n"
|
||||
// + " <IssueDateTime format=\"102\">20130301</IssueDateTime>\n"
|
||||
// + " <ID>2013-471331</ID>\n"
|
||||
// + " </BuyerOrderReferencedDocument>\n"
|
||||
+ " </ram:ApplicableHeaderTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableHeaderTradeDelivery>\n"
|
||||
+ " <ram:ActualDeliverySupplyChainEvent>\n"
|
||||
+ " <ram:OccurrenceDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getDeliveryDate())+"</udt:DateTimeString></ram:OccurrenceDateTime>\n"
|
||||
+ " </ram:ActualDeliverySupplyChainEvent>\n"
|
||||
+ " </ram:ApplicableHeaderTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableHeaderTradeDelivery>\n"
|
||||
+ " <ram:ActualDeliverySupplyChainEvent>\n"
|
||||
+ " <ram:OccurrenceDateTime><udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(trans.getDeliveryDate()) + "</udt:DateTimeString></ram:OccurrenceDateTime>\n"
|
||||
+ " </ram:ActualDeliverySupplyChainEvent>\n"
|
||||
/*
|
||||
+ " <DeliveryNoteReferencedDocument>\n"
|
||||
+ " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n"
|
||||
+ " <ID>2013-51112</ID>\n"
|
||||
+ " </DeliveryNoteReferencedDocument>\n" */
|
||||
+ " </ram:ApplicableHeaderTradeDelivery>\n"
|
||||
+ " <ram:ApplicableHeaderTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " <ram:PaymentReference>"+trans.getNumber()+"</ram:PaymentReference>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementPaymentMeans>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>42</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:Information>Überweisung</ram:Information>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:IBANID>"+trans.getOwnIBAN()+"</ram:IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:ProprietaryID>"+trans.getOwnKto()+"</ram:ProprietaryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " <ram:BICID>"+trans.getOwnBIC()+"</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:GermanBankleitzahlID>"+ trans.getOwnBLZ()+"</ram:GermanBankleitzahlID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:ApplicableHeaderTradeDelivery>\n"
|
||||
+ " <ram:ApplicableHeaderTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " <ram:PaymentReference>" + trans.getNumber() + "</ram:PaymentReference>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementPaymentMeans>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>42</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:Information>Überweisung</ram:Information>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:IBANID>" + trans.getOwnIBAN() + "</ram:IBANID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:ProprietaryID>" + trans.getOwnKto() + "</ram:ProprietaryID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " <ram:BICID>" + trans.getOwnBIC() + "</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:GermanBankleitzahlID>" + trans.getOwnBLZ() + "</ram:GermanBankleitzahlID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
|
||||
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
|
||||
|
||||
|
||||
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap=getVATPercentAmountMap();
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
if (amount != null) {
|
||||
xml += " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:CalculatedAmount>"+currencyFormat(amount.getCalculated())+"</ram:CalculatedAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:BasisAmount>"+currencyFormat(amount.getBasis())+"</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>S</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:RateApplicablePercent>"+vatFormat(currentTaxPercent)+"</ram:RateApplicablePercent>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableTradeTax>\n"; //$NON-NLS-1$
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap = getVATPercentAmountMap();
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
if (amount != null) {
|
||||
xml += " <ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:CalculatedAmount>" + currencyFormat(amount.getCalculated()) + "</ram:CalculatedAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>S</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableTradeTax>\n"; //$NON-NLS-1$
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
/* xml+= "
|
||||
+ " <SpecifiedTradeAllowanceCharge>\n"
|
||||
+ " <ChargeIndicator>false</ChargeIndicator>\n"
|
||||
@@ -404,23 +399,23 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
+ " </AppliedTradeTax>\n"
|
||||
+ " </SpecifiedLogisticsServiceCharge>\n"*/
|
||||
|
||||
xml=xml+ " <ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
|
||||
+ " <ram:Description>Zahlbar ohne Abzug bis "+germanDateFormat.format(trans.getDueDate())+"</ram:Description>\n"
|
||||
+ " <ram:DueDateDateTime><udt:DateTimeString format=\"102\">"+zugferdDateFormat.format(trans.getDueDate())+"</udt:DateTimeString></ram:DueDateDateTime>\n"//20130704 //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>"+currencyFormat(getTotal())+"</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ currencyID=\"EUR\"
|
||||
+ " <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>\n" //$NON-NLS-1$ currencyID=\"EUR\"
|
||||
+ " <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>\n" //$NON-NLS-1$ // currencyID=\"EUR\"
|
||||
xml = xml + " <ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
|
||||
+ " <ram:Description>Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate()) + "</ram:Description>\n"
|
||||
+ " <ram:DueDateDateTime><udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(trans.getDueDate()) + "</udt:DateTimeString></ram:DueDateDateTime>\n"//20130704 //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " </ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(getTotal()) + "</ram:LineTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ currencyID=\"EUR\"
|
||||
+ " <ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>\n" //$NON-NLS-1$ currencyID=\"EUR\"
|
||||
+ " <ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>\n" //$NON-NLS-1$ // currencyID=\"EUR\"
|
||||
// + " <ChargeTotalAmount currencyID=\"EUR\">5.80</ChargeTotalAmount>\n"
|
||||
// + " <AllowanceTotalAmount currencyID=\"EUR\">14.73</AllowanceTotalAmount>\n"
|
||||
+ " <ram:TaxBasisTotalAmount>"+currencyFormat(getTotal())+"</ram:TaxBasisTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " <ram:TaxTotalAmount currencyID=\"EUR\">"+currencyFormat(getTotalGross().subtract(getTotal()))+"</ram:TaxTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:GrandTotalAmount>"+currencyFormat(getTotalGross())+"</ram:GrandTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " <ram:TaxBasisTotalAmount>" + currencyFormat(getTotal()) + "</ram:TaxBasisTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " <ram:TaxTotalAmount currencyID=\"EUR\">" + currencyFormat(getTotalGross().subtract(getTotal())) + "</ram:TaxTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:GrandTotalAmount>" + currencyFormat(getTotalGross()) + "</ram:GrandTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
// + " <TotalPrepaidAmount currencyID=\"EUR\">0.00</TotalPrepaidAmount>\n"
|
||||
+ " <ram:DuePayableAmount>"+currencyFormat(getTotalGross())+"</ram:DuePayableAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableHeaderTradeSettlement>\n"; //$NON-NLS-1$
|
||||
+ " <ram:DuePayableAmount>" + currencyFormat(getTotalGross()) + "</ram:DuePayableAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableHeaderTradeSettlement>\n"; //$NON-NLS-1$
|
||||
// + " <IncludedSupplyChainTradeLineItem>\n"
|
||||
// + " <AssociatedDocumentLineDocument>\n"
|
||||
// + " <IncludedNote>\n"
|
||||
@@ -430,26 +425,24 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
// + " </IncludedSupplyChainTradeLineItem>\n";
|
||||
|
||||
|
||||
xml = xml + " </rsm:SupplyChainTradeTransaction>\n" //$NON-NLS-1$
|
||||
+ "</rsm:CrossIndustryInvoice>"; //$NON-NLS-1$
|
||||
|
||||
byte[] zugferdRaw;
|
||||
try {
|
||||
zugferdRaw = xml.getBytes("UTF-8");
|
||||
|
||||
xml=xml + " </rsm:SupplyChainTradeTransaction>\n" //$NON-NLS-1$
|
||||
+ "</rsm:CrossIndustryInvoice>"; //$NON-NLS-1$
|
||||
|
||||
byte[] zugferdRaw;
|
||||
try {
|
||||
zugferdRaw = xml.getBytes("UTF-8");
|
||||
|
||||
if ((zugferdRaw[0]==(byte)0xEF)&&(zugferdRaw[1]==(byte)0xBB)&&(zugferdRaw[2]==(byte)0xBF)) {
|
||||
// I don't like BOMs, lets remove it
|
||||
zugferdData=new byte[zugferdRaw.length-3];
|
||||
System.arraycopy(zugferdRaw,3,zugferdData,0,zugferdRaw.length-3);
|
||||
} else {
|
||||
zugferdData=zugferdRaw;
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} //$NON-NLS-1$
|
||||
if ((zugferdRaw[0] == (byte) 0xEF) && (zugferdRaw[1] == (byte) 0xBB) && (zugferdRaw[2] == (byte) 0xBF)) {
|
||||
// I don't like BOMs, lets remove it
|
||||
zugferdData = new byte[zugferdRaw.length - 3];
|
||||
System.arraycopy(zugferdRaw, 3, zugferdData, 0, zugferdRaw.length - 3);
|
||||
} else {
|
||||
zugferdData = zugferdRaw;
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,5 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public enum ZUGFeRDConformanceLevel {
|
||||
BASIC, COMFORT, EXTENDED, EN16931/*=Comfort*/, MINIMUM, BASICWL /*basic without lines, less than basic*/, CIUS
|
||||
;
|
||||
BASIC, COMFORT, EXTENDED, EN16931/*=Comfort*/, MINIMUM, BASICWL /*basic without lines, less than basic*/, CIUS
|
||||
}
|
||||
|
||||
@@ -19,23 +19,23 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public class ZUGFeRDExportException extends RuntimeException {
|
||||
/**
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ZUGFeRDExportException() {
|
||||
}
|
||||
}
|
||||
|
||||
public ZUGFeRDExportException(String message) {
|
||||
super(message);
|
||||
}
|
||||
public ZUGFeRDExportException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ZUGFeRDExportException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
public ZUGFeRDExportException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public ZUGFeRDExportException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
public ZUGFeRDExportException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,9 +19,9 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
|
||||
public class ZUGFeRDExporterFromA1Factory extends ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
public class ZUGFeRDExporterFromA1Factory extends ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
public ZUGFeRDExporterFromA1Factory() {
|
||||
ensurePDFisUpgraded=true;
|
||||
ensurePDFisUpgraded = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,15 +18,6 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import javax.activation.FileDataSource;
|
||||
import org.apache.pdfbox.io.IOUtils;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.preflight.PreflightDocument;
|
||||
@@ -34,29 +25,40 @@ import org.apache.pdfbox.preflight.exception.ValidationException;
|
||||
import org.apache.pdfbox.preflight.parser.PreflightParser;
|
||||
import org.apache.pdfbox.preflight.utils.ByteArrayDataSource;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import javax.activation.FileDataSource;
|
||||
import java.io.*;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
protected boolean ignorePDFAErrors = false;
|
||||
protected ZUGFeRDConformanceLevel zugferdConformanceLevel = ZUGFeRDConformanceLevel.EXTENDED;
|
||||
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
|
||||
/** Producer (attribute for PDF */
|
||||
/**
|
||||
* Producer (attribute for PDF
|
||||
*/
|
||||
protected String producer = "mustangproject";
|
||||
/** Human creator (attribute for PDF) */
|
||||
/**
|
||||
* Human creator (attribute for PDF)
|
||||
*/
|
||||
protected String creator = "mustangproject";
|
||||
/** Creator tool (attribute for PDF) */
|
||||
/**
|
||||
* Creator tool (attribute for PDF)
|
||||
*/
|
||||
protected String creatorTool = null;
|
||||
|
||||
private HashMap<String,byte[]> additionalXMLs=new HashMap<String,byte[]>();
|
||||
|
||||
|
||||
protected int ZFVersion=ZUGFeRDExporter.DefaultZUGFeRDVersion;
|
||||
protected boolean ensurePDFisUpgraded=false;
|
||||
private boolean attachZUGFeRDHeaders=true;
|
||||
private HashMap<String, byte[]> additionalXMLs = new HashMap<String, byte[]>();
|
||||
|
||||
|
||||
protected int ZFVersion = ZUGFeRDExporter.DefaultZUGFeRDVersion;
|
||||
protected boolean ensurePDFisUpgraded = false;
|
||||
private boolean attachZUGFeRDHeaders = true;
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
* metadata level, this will not e.g. convert graphics to JPG-2000)
|
||||
*
|
||||
* @param pdfFilename
|
||||
* filename of an PDF/A1 compliant document
|
||||
* @param pdfFilename filename of an PDF/A1 compliant document
|
||||
*/
|
||||
public ZUGFeRDExporter load(String pdfFilename) throws IOException {
|
||||
|
||||
@@ -78,13 +80,11 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
* metadata level, this will not e.g. convert graphics to JPG-2000)
|
||||
*
|
||||
* @param pdfBinary
|
||||
* binary of a PDF/A1 compliant document
|
||||
* @param pdfBinary binary of a PDF/A1 compliant document
|
||||
*/
|
||||
public ZUGFeRDExporter load(byte[] pdfBinary) throws IOException {
|
||||
ensurePDFIsValidPDFA(new ByteArrayDataSource(new ByteArrayInputStream(pdfBinary)));
|
||||
@@ -101,17 +101,16 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
return zugFeRDExporter;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3Factory () {
|
||||
public ZUGFeRDExporterFromA3Factory() {
|
||||
|
||||
ensurePDFisUpgraded=false;
|
||||
ensurePDFisUpgraded = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
* metadata level, this will not e.g. convert graphics to JPG-2000)
|
||||
*
|
||||
* @param pdfSource
|
||||
* source to read a PDF/A1 compliant document from
|
||||
* @param pdfSource source to read a PDF/A1 compliant document from
|
||||
*/
|
||||
public ZUGFeRDExporter load(InputStream pdfSource) throws IOException {
|
||||
return load(readAllBytes(pdfSource));
|
||||
@@ -128,6 +127,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
IOUtils.copy(in, buffer);
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
private static boolean isValidA1(DataSource dataSource) throws IOException {
|
||||
return getPDFAParserValidationResult(new PreflightParser(dataSource));
|
||||
}
|
||||
@@ -135,8 +135,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
/**
|
||||
* Sets the ZUGFeRD conformance level (override).
|
||||
*
|
||||
* @param zugferdConformanceLevel
|
||||
* the new conformance level
|
||||
* @param zugferdConformanceLevel the new conformance level
|
||||
*/
|
||||
public IExporterFactory setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zugferdConformanceLevel) {
|
||||
this.zugferdConformanceLevel = zugferdConformanceLevel;
|
||||
@@ -174,17 +173,15 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
|
||||
/**
|
||||
* All files are PDF/A-3, setConformance refers to the level conformance.
|
||||
*
|
||||
* <p/>
|
||||
* PDF/A-3 has three coformance levels, called "A", "U" and "B".
|
||||
*
|
||||
* <p/>
|
||||
* PDF/A-3-B where B means only visually preservable, U -standard for Mustang-
|
||||
* means visually and unicode preservable and A means full compliance, i.e.
|
||||
* visually, unicode and structurally preservable and tagged PDF, i.e. useful
|
||||
* metainformation for blind people.
|
||||
*
|
||||
* <p/>
|
||||
* Feel free to pass "A" as new level if you know what you are doing :-)
|
||||
*
|
||||
*
|
||||
*/
|
||||
public IExporterFactory setConformanceLevel(PDFAConformanceLevel newLevel) {
|
||||
conformanceLevel = newLevel;
|
||||
@@ -201,7 +198,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
this.creator = creator;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public IExporterFactory setCreatorTool(String creatorTool) {
|
||||
this.creatorTool = creatorTool;
|
||||
return this;
|
||||
@@ -211,6 +208,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
this.producer = producer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IExporterFactory setAttachZUGFeRDHeaders(boolean attachHeaders) {
|
||||
this.attachZUGFeRDHeaders = attachHeaders;
|
||||
return this;
|
||||
@@ -219,7 +217,7 @@ public class ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
|
||||
@Override
|
||||
public IExporterFactory setZUGFeRDVersion(int version) {
|
||||
this.ZFVersion=version;
|
||||
this.ZFVersion = version;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,30 +18,19 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.Transformer;
|
||||
import javax.xml.transform.TransformerConfigurationException;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.URIResolver;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.io.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ZUGFeRDMigrator {
|
||||
|
||||
static final ClassLoader CLASS_LOADER = ZUGFeRDMigrator.class.getClassLoader();
|
||||
private static final String RESOURCE_PATH = ""; //$NON-NLS-1$
|
||||
private static final Logger LOG = Logger.getLogger(ZUGFeRDMigrator.class.getName());
|
||||
// private static File createTempFileResult(final Transformer transformer, final StreamSource toTransform,
|
||||
static final ClassLoader CLASS_LOADER = ZUGFeRDMigrator.class.getClassLoader();
|
||||
private static final String RESOURCE_PATH = ""; //$NON-NLS-1$
|
||||
private static final Logger LOG = Logger.getLogger(ZUGFeRDMigrator.class.getName());
|
||||
// private static File createTempFileResult(final Transformer transformer, final StreamSource toTransform,
|
||||
// final String suffix) throws TransformerException, IOException {
|
||||
// File result = File.createTempFile("ZUV_", suffix); //$NON-NLS-1$
|
||||
// result.deleteOnExit();
|
||||
@@ -51,48 +40,48 @@ public class ZUGFeRDMigrator {
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
private TransformerFactory mFactory = null;
|
||||
private Templates mXsltTemplate = null;
|
||||
private TransformerFactory mFactory = null;
|
||||
private Templates mXsltTemplate = null;
|
||||
|
||||
public ZUGFeRDMigrator() {
|
||||
mFactory = new net.sf.saxon.TransformerFactoryImpl();
|
||||
//fact = TransformerFactory.newInstance();
|
||||
mFactory.setURIResolver(new ClasspathResourceURIResolver());
|
||||
try {
|
||||
mXsltTemplate = mFactory.newTemplates(new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "COMFORTtoEN16931.xsl")));
|
||||
} catch (TransformerConfigurationException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
public ZUGFeRDMigrator() {
|
||||
mFactory = new net.sf.saxon.TransformerFactoryImpl();
|
||||
//fact = TransformerFactory.newInstance();
|
||||
mFactory.setURIResolver(new ClasspathResourceURIResolver());
|
||||
try {
|
||||
mXsltTemplate = mFactory.newTemplates(new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "COMFORTtoEN16931.xsl")));
|
||||
} catch (TransformerConfigurationException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
public String migrateFromV1ToV2(String xmlFilename) throws FileNotFoundException, TransformerException, UnsupportedEncodingException {
|
||||
/**
|
||||
* *
|
||||
* http://www.unece.org/fileadmin/DAM/cefact/xml/XML-Naming-And-Design-Rules-V2_1.pdf
|
||||
* http://www.ferd-net.de/upload/Dokumente/FACTUR-X_ZUGFeRD_2p0_Teil1_Profil_EN16931_1p03.pdf
|
||||
* http://countwordsfree.com/xmlviewer
|
||||
*/
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
applySchematronXsl(new FileInputStream(xmlFilename), baos);
|
||||
String res = null;
|
||||
res = baos.toString("UTF-8");
|
||||
return res;
|
||||
}
|
||||
public String migrateFromV1ToV2(String xmlFilename) throws FileNotFoundException, TransformerException, UnsupportedEncodingException {
|
||||
/**
|
||||
* *
|
||||
* http://www.unece.org/fileadmin/DAM/cefact/xml/XML-Naming-And-Design-Rules-V2_1.pdf
|
||||
* http://www.ferd-net.de/upload/Dokumente/FACTUR-X_ZUGFeRD_2p0_Teil1_Profil_EN16931_1p03.pdf
|
||||
* http://countwordsfree.com/xmlviewer
|
||||
*/
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
applySchematronXsl(new FileInputStream(xmlFilename), baos);
|
||||
String res = null;
|
||||
res = baos.toString("UTF-8");
|
||||
return res;
|
||||
}
|
||||
|
||||
public void applySchematronXsl(final InputStream xmlFile,
|
||||
final OutputStream EN16931Outstream) throws TransformerException {
|
||||
Transformer transformer = mXsltTemplate.newTransformer();
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(EN16931Outstream));
|
||||
}
|
||||
public void applySchematronXsl(final InputStream xmlFile,
|
||||
final OutputStream EN16931Outstream) throws TransformerException {
|
||||
Transformer transformer = mXsltTemplate.newTransformer();
|
||||
transformer.transform(new StreamSource(xmlFile), new StreamResult(EN16931Outstream));
|
||||
}
|
||||
|
||||
private static class ClasspathResourceURIResolver implements URIResolver {
|
||||
ClasspathResourceURIResolver() {
|
||||
// Do nothing, just prevents synthetic access warning.
|
||||
}
|
||||
private static class ClasspathResourceURIResolver implements URIResolver {
|
||||
ClasspathResourceURIResolver() {
|
||||
// Do nothing, just prevents synthetic access warning.
|
||||
}
|
||||
|
||||
@Override
|
||||
public Source resolve(String href, String base) throws TransformerException {
|
||||
return new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + href));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Source resolve(String href, String base) throws TransformerException {
|
||||
return new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + href));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,7 +19,7 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class DateTimeTypeConstants {
|
||||
public static final String DATE = "102";
|
||||
public static final String MONTH = "610";
|
||||
public static final String WEEK = "616";
|
||||
public static final String DATE = "102";
|
||||
public static final String MONTH = "610";
|
||||
public static final String WEEK = "616";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class DocumentCodeTypeConstants {
|
||||
public static final String INVOICE = "380";
|
||||
public static final String DEBITNOTE = "84";
|
||||
public static final String CREDITNOTE = "389";
|
||||
public static final String INVOICE = "380";
|
||||
public static final String DEBITNOTE = "84";
|
||||
public static final String CREDITNOTE = "389";
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class NoteTypeConstants {
|
||||
public static final String GENERAL = "";
|
||||
public static final String REGULARINFO = "REG";
|
||||
public static final String PRICECONDITION = "AAK";
|
||||
public static final String CONDITIONS = "AAJ";
|
||||
public static final String PAYMENTINFO = "PMT";
|
||||
public static final String GENERAL = "";
|
||||
public static final String REGULARINFO = "REG";
|
||||
public static final String PRICECONDITION = "AAK";
|
||||
public static final String CONDITIONS = "AAJ";
|
||||
public static final String PAYMENTINFO = "PMT";
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class PaymentMeansCodeTypeConstants {
|
||||
public static final String BANKACCOUNT = "42";
|
||||
public static final String NOTSPECIFIED = "1";
|
||||
public static final String AUTOMATICCLEARING = "3";
|
||||
public static final String CASH = "10";
|
||||
public static final String CHECK = "20";
|
||||
public static final String DEBITADVICE = "31";
|
||||
public static final String CREDITCARD = "48";
|
||||
public static final String DEBIT = "49";
|
||||
public static final String COMPENSATION = "97";
|
||||
public static final String BANKACCOUNT = "42";
|
||||
public static final String NOTSPECIFIED = "1";
|
||||
public static final String AUTOMATICCLEARING = "3";
|
||||
public static final String CASH = "10";
|
||||
public static final String CHECK = "20";
|
||||
public static final String DEBITADVICE = "31";
|
||||
public static final String CREDITCARD = "48";
|
||||
public static final String DEBIT = "49";
|
||||
public static final String COMPENSATION = "97";
|
||||
}
|
||||
|
||||
@@ -19,25 +19,25 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class QuantityTypeConstants {
|
||||
public static final String PIECE = "C62";
|
||||
public static final String DAY = "DAY";
|
||||
public static final String HECTARE = "HAR";
|
||||
public static final String HOUR = "HUR";
|
||||
public static final String KILOGRAM = "KGM";
|
||||
public static final String KILOMETER = "KTM";
|
||||
public static final String KILOWATTHOUR = "KWH";
|
||||
public static final String FIXEDRATE = "LS";
|
||||
public static final String LITRE = "LTR";
|
||||
public static final String MINUTE = "MIN";
|
||||
public static final String SQUAREMILLIMETER = "MMK";
|
||||
public static final String MILLIMETER = "MMT";
|
||||
public static final String SQUAREMETER = "MTK";
|
||||
public static final String CUBICMETER = "MTQ";
|
||||
public static final String METER = "MTR";
|
||||
public static final String PRODUCTCOUNT = "NAR";
|
||||
public static final String PRODUCTPAIR = "NPR";
|
||||
public static final String PERCENT = "P1";
|
||||
public static final String SET = "SET";
|
||||
public static final String TON = "TNE";
|
||||
public static final String WEEK = "WEE";
|
||||
public static final String PIECE = "C62";
|
||||
public static final String DAY = "DAY";
|
||||
public static final String HECTARE = "HAR";
|
||||
public static final String HOUR = "HUR";
|
||||
public static final String KILOGRAM = "KGM";
|
||||
public static final String KILOMETER = "KTM";
|
||||
public static final String KILOWATTHOUR = "KWH";
|
||||
public static final String FIXEDRATE = "LS";
|
||||
public static final String LITRE = "LTR";
|
||||
public static final String MINUTE = "MIN";
|
||||
public static final String SQUAREMILLIMETER = "MMK";
|
||||
public static final String MILLIMETER = "MMT";
|
||||
public static final String SQUAREMETER = "MTK";
|
||||
public static final String CUBICMETER = "MTQ";
|
||||
public static final String METER = "MTR";
|
||||
public static final String PRODUCTCOUNT = "NAR";
|
||||
public static final String PRODUCTPAIR = "NPR";
|
||||
public static final String PERCENT = "P1";
|
||||
public static final String SET = "SET";
|
||||
public static final String TON = "TNE";
|
||||
public static final String WEEK = "WEE";
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class TaxCategoryCodeTypeConstants {
|
||||
public static final String STANDARDRATE = "S";
|
||||
public static final String REVERSECHARGE = "AE";
|
||||
public static final String TAXEXEMPT = "E";
|
||||
public static final String ZEROTAXPRODUCTS = "Z";
|
||||
public static final String UNTAXEDSERVICE = "O";
|
||||
public static final String INTRACOMMUNITY = "IC";
|
||||
public static final String STANDARDRATE = "S";
|
||||
public static final String REVERSECHARGE = "AE";
|
||||
public static final String TAXEXEMPT = "E";
|
||||
public static final String ZEROTAXPRODUCTS = "Z";
|
||||
public static final String UNTAXEDSERVICE = "O";
|
||||
public static final String INTRACOMMUNITY = "IC";
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class TaxRegistrationTypeConstants {
|
||||
public static final String USTID = "VA";
|
||||
public static final String TAXID = "FC";
|
||||
public static final String USTID = "VA";
|
||||
public static final String TAXID = "FC";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
public class TaxTypeCodeTypeConstants {
|
||||
public static final String SALESTAX = "VAT";
|
||||
public static final String INSURANCETAX = "ZF_INSURANCE_TAX";
|
||||
public static final String OLDPART = "AAJ";
|
||||
public static final String SALESTAX = "VAT";
|
||||
public static final String INSURANCETAX = "ZF_INSURANCE_TAX";
|
||||
public static final String OLDPART = "AAJ";
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package org.mustangproject.ZUGFeRD.model;
|
||||
|
||||
import com.sun.xml.bind.marshaller.NamespacePrefixMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -23,18 +23,18 @@ import org.mustangproject.ZUGFeRD.ZUGFeRDImporter;
|
||||
public class FileChecker {
|
||||
String filename;
|
||||
StatRun thisRun;
|
||||
boolean isPDF=false;
|
||||
boolean isPDF = false;
|
||||
|
||||
public FileChecker(String filename, StatRun statistics) {
|
||||
this.filename=filename;
|
||||
thisRun=statistics;
|
||||
this.filename = filename;
|
||||
thisRun = statistics;
|
||||
thisRun.incFileCount();
|
||||
String extension = "";
|
||||
if (!thisRun.shallIgnoreFileExt()) {
|
||||
int extIndex = filename.lastIndexOf(".");
|
||||
if (extIndex >= 0) {
|
||||
extension = filename.substring(extIndex).toLowerCase();
|
||||
isPDF=extension.equals(".pdf");// alternative check for PDF: File starts with %PDF-
|
||||
isPDF = extension.equals(".pdf");// alternative check for PDF: File starts with %PDF-
|
||||
if (isPDF) {
|
||||
thisRun.incPDFCount();
|
||||
}
|
||||
@@ -46,10 +46,10 @@ public class FileChecker {
|
||||
}
|
||||
|
||||
public boolean checkForZUGFeRD() {
|
||||
if ((!isPDF)&&(!thisRun.shallIgnoreFileExt())) {
|
||||
if ((!isPDF) && (!thisRun.shallIgnoreFileExt())) {
|
||||
return false;
|
||||
}
|
||||
ZUGFeRDImporter zi=new ZUGFeRDImporter();
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
try {
|
||||
zi.extract(filename);
|
||||
if (zi.canParse()) {
|
||||
@@ -62,10 +62,10 @@ public class FileChecker {
|
||||
// something really rare happened -- corrupted ZF?
|
||||
/***
|
||||
* e.g. Exception in thread "main" java.lang.NullPointerException
|
||||
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractLowLevel(ZUGFeRDImporter.java:90)
|
||||
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extract(ZUGFeRDImporter.java:64)
|
||||
at toecount.FileChecker.checkForZUGFeRD(FileChecker.java:33)
|
||||
at toecount.Toecount.main(Toecount.java:111)
|
||||
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extractLowLevel(ZUGFeRDImporter.java:90)
|
||||
at org.mustangproject.ZUGFeRD.ZUGFeRDImporter.extract(ZUGFeRDImporter.java:64)
|
||||
at toecount.FileChecker.checkForZUGFeRD(FileChecker.java:33)
|
||||
at toecount.Toecount.main(Toecount.java:111)
|
||||
*
|
||||
*/
|
||||
// Ignore nevertheless, most likely we're batch processing
|
||||
@@ -73,10 +73,10 @@ public class FileChecker {
|
||||
} catch (Exception e2) {
|
||||
/**
|
||||
* probably thrown up from
|
||||
AM org.apache.pdfbox.pdfparser.PDFParser parse, most likely
|
||||
INFORMATION: Document is encrypted
|
||||
but also other internal PDF errors possible like
|
||||
..Okt 23, 2015 11:17:53 AM org.apache.pdfbox.pdfparser.XrefTrailerResolver setStartxref
|
||||
AM org.apache.pdfbox.pdfparser.PDFParser parse, most likely
|
||||
INFORMATION: Document is encrypted
|
||||
but also other internal PDF errors possible like
|
||||
..Okt 23, 2015 11:17:53 AM org.apache.pdfbox.pdfparser.XrefTrailerResolver setStartxref
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -20,20 +20,22 @@ package org.mustangproject.toecount;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import static java.nio.file.FileVisitResult.CONTINUE;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
|
||||
import static java.nio.file.FileVisitResult.CONTINUE;
|
||||
|
||||
public class FileTraverser extends SimpleFileVisitor<Path> {
|
||||
|
||||
|
||||
private StatRun thisRun;
|
||||
|
||||
public FileTraverser(StatRun statistics) {
|
||||
this.thisRun=statistics;
|
||||
this.thisRun = statistics;
|
||||
}
|
||||
|
||||
/***
|
||||
/**
|
||||
* check each file
|
||||
*/
|
||||
@Override
|
||||
@@ -50,7 +52,7 @@ public class FileTraverser extends SimpleFileVisitor<Path> {
|
||||
return CONTINUE;
|
||||
}
|
||||
|
||||
/***
|
||||
/**
|
||||
* for each directory
|
||||
*/
|
||||
@Override
|
||||
@@ -61,7 +63,7 @@ public class FileTraverser extends SimpleFileVisitor<Path> {
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
/**
|
||||
* show errors like file permission stacktraces
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -23,60 +23,64 @@ public class StatRun {
|
||||
private int horseCount = 0;
|
||||
private int fileCount = 0;
|
||||
private int dirCount = 0;
|
||||
private boolean checkFileExt=true;
|
||||
private boolean checkFileExt = true;
|
||||
|
||||
public void ignoreFileExtension() {
|
||||
checkFileExt=false;
|
||||
checkFileExt = false;
|
||||
}
|
||||
|
||||
public boolean shallIgnoreFileExt() {
|
||||
return !checkFileExt;
|
||||
}
|
||||
public void incFileCount(){
|
||||
|
||||
public void incFileCount() {
|
||||
fileCount++;
|
||||
}
|
||||
|
||||
public void incPDFCount(){
|
||||
public void incPDFCount() {
|
||||
pdfCount++;
|
||||
}
|
||||
|
||||
public void incZUGFeRDCount(){
|
||||
public void incZUGFeRDCount() {
|
||||
horseCount++;
|
||||
}
|
||||
|
||||
public void incDirCount(){
|
||||
public void incDirCount() {
|
||||
dirCount++;
|
||||
}
|
||||
|
||||
public int getFileCount(){
|
||||
public int getFileCount() {
|
||||
return fileCount;
|
||||
}
|
||||
|
||||
public int getPDFCount(){
|
||||
public int getPDFCount() {
|
||||
return pdfCount;
|
||||
}
|
||||
|
||||
public int getZUGFeRDCount(){
|
||||
public int getZUGFeRDCount() {
|
||||
return horseCount;
|
||||
}
|
||||
|
||||
public int getDirCount(){
|
||||
public int getDirCount() {
|
||||
return dirCount;
|
||||
}
|
||||
|
||||
/***
|
||||
/**
|
||||
* returns final statistics
|
||||
*
|
||||
* @return english string with linefeeds detailling number of files, directories, number of pdfs and of zugferd files
|
||||
*/
|
||||
public String getSummaryLine() {
|
||||
|
||||
return "\r\n===================================================================\r\n"+String.format(
|
||||
return "\r\n===================================================================\r\n" + String.format(
|
||||
"Files:\t%d\tDirs:\t%d\tPDF:\t%d\tZUGFeRD:\t%d\r\n",
|
||||
getFileCount(), getDirCount(), getPDFCount(), getZUGFeRDCount());
|
||||
|
||||
}
|
||||
/***
|
||||
|
||||
/**
|
||||
* show that something is happening
|
||||
*
|
||||
* @return String, usually a dot
|
||||
*/
|
||||
public String getOutputLine() {
|
||||
|
||||
@@ -25,24 +25,18 @@ package org.mustangproject.toecount;
|
||||
|
||||
import com.sanityinc.jargs.CmdLineParser;
|
||||
import com.sanityinc.jargs.CmdLineParser.Option;
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
|
||||
import javax.xml.transform.TransformerException;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDConformanceLevel;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporter;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1Factory;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3Factory;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDImporter;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDMigrator;
|
||||
|
||||
public class Toecount {
|
||||
// build with: /opt/local/bin/mvn clean compile assembly:single
|
||||
@@ -114,19 +108,15 @@ public class Toecount {
|
||||
+ "\t\t\tFor ZUGFeRD v2: <M>INIMUM, BASIC <W>L, <B>ASIC, <C>IUS, <E>N16931, E<X>TENDED\r\n");
|
||||
}
|
||||
|
||||
/***
|
||||
/**
|
||||
* Asks the user (repeatedly, if neccessary) on the command line for a String
|
||||
* (offering a defaultValue) conforming to a Regex pattern
|
||||
*
|
||||
* @param prompt
|
||||
* the question to be asked to the user
|
||||
* @param defaultValue
|
||||
* the default return value if user hits enter
|
||||
* @param pattern
|
||||
* a regex of acceptable values
|
||||
* @param prompt the question to be asked to the user
|
||||
* @param defaultValue the default return value if user hits enter
|
||||
* @param pattern a regex of acceptable values
|
||||
* @return the user answer conforming to pattern
|
||||
* @throws Exception
|
||||
* if pattern not compielable or IOexception on input
|
||||
* @throws Exception if pattern not compielable or IOexception on input
|
||||
*/
|
||||
protected static String getStringFromUser(String prompt, String defaultValue, String pattern) throws Exception {
|
||||
String input = "";
|
||||
@@ -162,24 +152,18 @@ public class Toecount {
|
||||
return input;
|
||||
}
|
||||
|
||||
/***
|
||||
/**
|
||||
* Prompts the user for a input or output filename
|
||||
*
|
||||
* @param the
|
||||
* text the user is asked
|
||||
* @param a
|
||||
* default Filename
|
||||
* @param expectedExtension
|
||||
* will warn if filename does not match expected file extension
|
||||
* @param ensureFileExists
|
||||
* will warn if file does NOT exist (for input files)
|
||||
* @param ensureFileNotExists
|
||||
* will warn if file DOES exist (for output files)
|
||||
*
|
||||
* @param the text the user is asked
|
||||
* @param a default Filename
|
||||
* @param expectedExtension will warn if filename does not match expected file extension
|
||||
* @param ensureFileExists will warn if file does NOT exist (for input files)
|
||||
* @param ensureFileNotExists will warn if file DOES exist (for output files)
|
||||
* @return String
|
||||
*/
|
||||
protected static String getFilenameFromUser(String prompt, String defaultFilename, String expectedExtension,
|
||||
boolean ensureFileExists, boolean ensureFileNotExists) {
|
||||
boolean ensureFileExists, boolean ensureFileNotExists) {
|
||||
boolean fileExistenceOK = false;
|
||||
String selectedName = "";
|
||||
do {
|
||||
@@ -322,9 +306,7 @@ public class Toecount {
|
||||
|
||||
if (helpRequested) {
|
||||
printHelp();
|
||||
}
|
||||
|
||||
else if (((directoryName != null) && (directoryName.length() > 0)) || filesFromStdIn.booleanValue()) {
|
||||
} else if (((directoryName != null) && (directoryName.length() > 0)) || filesFromStdIn.booleanValue()) {
|
||||
performMetrics(directoryName, filesFromStdIn, ignoreFileExt);
|
||||
} else if (combineRequested) {
|
||||
performCombine(sourceName, sourceXMLName, outName, zugferdVersion, zugferdProfile);
|
||||
@@ -437,7 +419,7 @@ public class Toecount {
|
||||
}
|
||||
|
||||
private static void performCombine(String pdfName, String xmlName, String outName, String zfVersion,
|
||||
String zfProfile) throws Exception {
|
||||
String zfProfile) throws Exception {
|
||||
/*
|
||||
* ZUGFeRDExporter ze= new ZUGFeRDExporterFromA1Factory()
|
||||
* .setProducer("toecount") .setCreator(System.getProperty("user.name"))
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:ferd:CrossIndustryDocument:invoice:1p0"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:element name="CrossIndustryDocument" type="rsm:CrossIndustryDocumentType"/>
|
||||
<xs:complexType name="CrossIndustryDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SpecifiedExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="HeaderExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:ferd:CrossIndustryDocument:invoice:1p0"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:element name="CrossIndustryDocument" type="rsm:CrossIndustryDocumentType"/>
|
||||
<xs:complexType name="CrossIndustryDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SpecifiedExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="HeaderExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,76 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
elementFormDefault="qualified"
|
||||
version="12.0">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:simpleType name="AllowanceChargeReasonCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="AllowanceChargeReasonCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:AllowanceChargeReasonCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="CountryIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="CountryIDType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:CountryIDContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="DateMandatoryDateTimeType">
|
||||
<xs:union memberTypes="xs:dateTime xs:date"/>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="DeliveryTermsCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="DeliveryTermsCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:DeliveryTermsCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="DocumentCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="DocumentCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:DocumentCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="PaymentMeansCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="PaymentMeansCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:PaymentMeansCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="ReferenceCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="ReferenceCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:ReferenceCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="TaxCategoryCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TaxCategoryCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:TaxCategoryCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="TaxTypeCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TaxTypeCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:TaxTypeCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
elementFormDefault="qualified"
|
||||
version="12.0">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:simpleType name="AllowanceChargeReasonCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="AllowanceChargeReasonCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:AllowanceChargeReasonCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="CountryIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="CountryIDType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:CountryIDContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="DateMandatoryDateTimeType">
|
||||
<xs:union memberTypes="xs:dateTime xs:date"/>
|
||||
</xs:simpleType>
|
||||
<xs:simpleType name="DeliveryTermsCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="DeliveryTermsCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:DeliveryTermsCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="DocumentCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="DocumentCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:DocumentCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="PaymentMeansCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="PaymentMeansCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:PaymentMeansCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="ReferenceCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="ReferenceCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:ReferenceCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="TaxCategoryCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TaxCategoryCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:TaxCategoryCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="TaxTypeCodeContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TaxTypeCodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="qdt:TaxTypeCodeContentType"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,352 +1,391 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
elementFormDefault="qualified"
|
||||
version="12.0">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15" schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="AccountName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ProprietaryID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CreditorFinancialInstitutionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BICID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="GermanBankleitzahlID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="ProprietaryID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialInstitutionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BICID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="GermanBankleitzahlID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DocumentContextParameterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DocumentLineDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TestIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="CopyIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="LanguageID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="EffectiveSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsServiceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AppliedAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AppliedTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsTransportMovementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ModeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ContentCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Content" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ValueMeasure" type="udt:MeasureType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Value" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="ClassName" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssueDateTime" type="qdt:DateMandatoryDateTimeType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="BuyerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="UnitQuantity" type="udt:QuantityType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SpecifiedPeriodType">
|
||||
<xs:sequence>
|
||||
<xs:element name="StartDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="EndDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="CompleteDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainConsignmentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SpecifiedLogisticsTransportMovement" type="ram:LogisticsTransportMovementType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ProductEndUserTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeDeliveryTerms" type="ram:TradeDeliveryTermsType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ChargeFreeQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="PackageQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="RelatedSupplyChainConsignment" type="ram:SupplyChainConsignmentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="UltimateShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ShipFromTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeAgreement" type="ram:SupplyChainTradeAgreementType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeDelivery" type="ram:SupplyChainTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeSettlement" type="ram:SupplyChainTradeSettlementType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedLogisticsServiceCharge" type="ram:LogisticsServiceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementMonetarySummation" type="ram:TradeSettlementMonetarySummationType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableSupplyChainTradeAgreement" type="ram:SupplyChainTradeAgreementType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableSupplyChainTradeDelivery" type="ram:SupplyChainTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableSupplyChainTradeSettlement" type="ram:SupplyChainTradeSettlementType" minOccurs="0"/>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="SequenceNumeric" type="udt:NumericType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReasonCode" type="qdt:AllowanceChargeReasonCodeType" minOccurs="0"/>
|
||||
<xs:element name="Reason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CategoryTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeContactType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PersonName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DepartmentName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TelephoneUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="FaxUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="EmailURIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeCountryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="qdt:CountryIDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeDeliveryTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DeliveryTypeCode" type="qdt:DeliveryTermsCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePartyType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentDiscountTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BasisDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="BasisPeriodMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualDiscountAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentPenaltyTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BasisDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="BasisPeriodMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualPenaltyAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="PartialPaymentAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradePaymentPenaltyTerms" type="ram:TradePaymentPenaltyTermsType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradePaymentDiscountTerms" type="ram:TradePaymentDiscountTermsType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="BuyerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableProductCharacteristic" type="ram:ProductCharacteristicType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DesignatedProductClassification" type="ram:ProductClassificationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="OriginTradeCountry" type="ram:TradeCountryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedReferencedProduct" type="ram:ReferencedProductType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TotalAllowanceChargeAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType" minOccurs="0"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayerSpecifiedDebtorFinancialInstitution" type="ram:DebtorFinancialInstitutionType" minOccurs="0"/>
|
||||
<xs:element name="PayeeSpecifiedCreditorFinancialInstitution" type="ram:CreditorFinancialInstitutionType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType" minOccurs="0"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="LineTotalBasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AllowanceChargeBasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType" minOccurs="0"/>
|
||||
<xs:element name="ApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="CompleteNumber" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
elementFormDefault="qualified"
|
||||
version="12.0">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:12"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
schemaLocation="ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="AccountName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ProprietaryID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CreditorFinancialInstitutionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BICID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="GermanBankleitzahlID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="ProprietaryID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialInstitutionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BICID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="GermanBankleitzahlID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DocumentContextParameterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DocumentLineDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TestIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="CopyIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="LanguageID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="EffectiveSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsServiceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AppliedAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AppliedTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsTransportMovementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ModeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ContentCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Content" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ValueMeasure" type="udt:MeasureType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Value" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="ClassName" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssueDateTime" type="qdt:DateMandatoryDateTimeType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="BuyerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="UnitQuantity" type="udt:QuantityType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SpecifiedPeriodType">
|
||||
<xs:sequence>
|
||||
<xs:element name="StartDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="EndDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="CompleteDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainConsignmentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SpecifiedLogisticsTransportMovement" type="ram:LogisticsTransportMovementType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ProductEndUserTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeDeliveryTerms" type="ram:TradeDeliveryTermsType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ChargeFreeQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="PackageQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="RelatedSupplyChainConsignment" type="ram:SupplyChainConsignmentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="UltimateShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ShipFromTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeAgreement" type="ram:SupplyChainTradeAgreementType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeDelivery" type="ram:SupplyChainTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedSupplyChainTradeSettlement" type="ram:SupplyChainTradeSettlementType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedLogisticsServiceCharge" type="ram:LogisticsServiceChargeType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementMonetarySummation" type="ram:TradeSettlementMonetarySummationType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableSupplyChainTradeAgreement" type="ram:SupplyChainTradeAgreementType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableSupplyChainTradeDelivery" type="ram:SupplyChainTradeDeliveryType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="ApplicableSupplyChainTradeSettlement" type="ram:SupplyChainTradeSettlementType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="SequenceNumeric" type="udt:NumericType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReasonCode" type="qdt:AllowanceChargeReasonCodeType" minOccurs="0"/>
|
||||
<xs:element name="Reason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CategoryTradeTax" type="ram:TradeTaxType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeContactType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PersonName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DepartmentName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TelephoneUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="FaxUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="EmailURIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeCountryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="qdt:CountryIDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeDeliveryTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DeliveryTypeCode" type="qdt:DeliveryTermsCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePartyType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentDiscountTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BasisDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="BasisPeriodMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualDiscountAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentPenaltyTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BasisDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="BasisPeriodMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualPenaltyAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="PartialPaymentAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradePaymentPenaltyTerms" type="ram:TradePaymentPenaltyTermsType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradePaymentDiscountTerms" type="ram:TradePaymentDiscountTermsType"
|
||||
minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SellerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="BuyerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableProductCharacteristic" type="ram:ProductCharacteristicType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="DesignatedProductClassification" type="ram:ProductClassificationType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
<xs:element name="OriginTradeCountry" type="ram:TradeCountryType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedReferencedProduct" type="ram:ReferencedProductType" minOccurs="0"
|
||||
maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TotalAllowanceChargeAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType" minOccurs="0"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="PayerSpecifiedDebtorFinancialInstitution" type="ram:DebtorFinancialInstitutionType"
|
||||
minOccurs="0"/>
|
||||
<xs:element name="PayeeSpecifiedCreditorFinancialInstitution" type="ram:CreditorFinancialInstitutionType"
|
||||
minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType" minOccurs="0"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="LineTotalBasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AllowanceChargeBasisAmount" type="udt:AmountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType" minOccurs="0"/>
|
||||
<xs:element name="ApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="CompleteNumber" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,95 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
elementFormDefault="qualified"
|
||||
version="15.0">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="udt:AmountTypeCurrencyIDContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="AmountTypeCurrencyIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateTimeType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateTimeString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string"/>
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
elementFormDefault="qualified"
|
||||
version="15.0">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="udt:AmountTypeCurrencyIDContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IDType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="schemeID" type="xs:token"/>
|
||||
<xs:attribute name="schemeAgencyID" type="udt:IDTypeSchemeAgencyIDContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="IDTypeSchemeAgencyIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="MeasureType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="unitCode" type="udt:MeasureTypeUnitCodeContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="MeasureTypeUnitCodeContentType">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:minLength value="1"/>
|
||||
<xs:maxLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="NumericType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PercentType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="QuantityType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="unitCode" type="udt:QuantityTypeUnitCodeContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="QuantityTypeUnitCodeContentType">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:minLength value="1"/>
|
||||
<xs:maxLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="AmountTypeCurrencyIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateTimeType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateTimeString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IDType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="schemeID" type="xs:token"/>
|
||||
<xs:attribute name="schemeAgencyID" type="udt:IDTypeSchemeAgencyIDContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="IDTypeSchemeAgencyIDContentType">
|
||||
<xs:restriction base="xs:token"/>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="MeasureType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="unitCode" type="udt:MeasureTypeUnitCodeContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="MeasureTypeUnitCodeContentType">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:minLength value="1"/>
|
||||
<xs:maxLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="NumericType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PercentType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="QuantityType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="unitCode" type="udt:QuantityTypeUnitCodeContentType"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:simpleType name="QuantityTypeUnitCodeContentType">
|
||||
<xs:restriction base="xs:token">
|
||||
<xs:minLength value="1"/>
|
||||
<xs:maxLength value="3"/>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -21,37 +21,37 @@ package org.mustangproject.ZUGFeRD;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class IZUGFeRDAllowanceChargeImpl implements IZUGFeRDAllowanceCharge {
|
||||
private BigDecimal totalAmount;
|
||||
private String reason;
|
||||
private BigDecimal taxPercent;
|
||||
private BigDecimal totalAmount;
|
||||
private String reason;
|
||||
private BigDecimal taxPercent;
|
||||
|
||||
@Override
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
@Override
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTaxPercent() {
|
||||
return taxPercent;
|
||||
}
|
||||
@Override
|
||||
public BigDecimal getTaxPercent() {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
public IZUGFeRDAllowanceChargeImpl setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDAllowanceChargeImpl setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDAllowanceChargeImpl setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDAllowanceChargeImpl setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDAllowanceChargeImpl setTaxPercent(BigDecimal taxPercent) {
|
||||
this.taxPercent = taxPercent;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDAllowanceChargeImpl setTaxPercent(BigDecimal taxPercent) {
|
||||
this.taxPercent = taxPercent;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,70 +19,70 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public class IZUGFeRDExportableContactImpl implements IZUGFeRDExportableContact {
|
||||
private String name;
|
||||
private String zIP;
|
||||
private String vATID;
|
||||
private String country;
|
||||
private String location;
|
||||
private String street;
|
||||
private String name;
|
||||
private String zIP;
|
||||
private String vATID;
|
||||
private String country;
|
||||
private String location;
|
||||
private String street;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getZIP() {
|
||||
return zIP;
|
||||
}
|
||||
@Override
|
||||
public String getZIP() {
|
||||
return zIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVATID() {
|
||||
return vATID;
|
||||
}
|
||||
@Override
|
||||
public String getVATID() {
|
||||
return vATID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
@Override
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
@Override
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
@Override
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setZIP(String zIP) {
|
||||
this.zIP = zIP;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setZIP(String zIP) {
|
||||
this.zIP = zIP;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setVATID(String vATID) {
|
||||
this.vATID = vATID;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setVATID(String vATID) {
|
||||
this.vATID = vATID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setCountry(String country) {
|
||||
this.country = country;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setCountry(String country) {
|
||||
this.country = country;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setLocation(String location) {
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setLocation(String location) {
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableContactImpl setStreet(String street) {
|
||||
this.street = street;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableContactImpl setStreet(String street) {
|
||||
this.street = street;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,59 +21,59 @@ package org.mustangproject.ZUGFeRD;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class IZUGFeRDExportableItemImpl implements IZUGFeRDExportableItem {
|
||||
private IZUGFeRDExportableProduct product;
|
||||
private IZUGFeRDAllowanceCharge[] itemAllowances;
|
||||
private IZUGFeRDAllowanceCharge[] itemCharges;
|
||||
private BigDecimal price;
|
||||
private BigDecimal quantity;
|
||||
private IZUGFeRDExportableProduct product;
|
||||
private IZUGFeRDAllowanceCharge[] itemAllowances;
|
||||
private IZUGFeRDAllowanceCharge[] itemCharges;
|
||||
private BigDecimal price;
|
||||
private BigDecimal quantity;
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableProduct getProduct() {
|
||||
return product;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDExportableProduct getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return itemAllowances;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return itemAllowances;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return itemCharges;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return itemCharges;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
@Override
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
@Override
|
||||
public BigDecimal getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItemImpl setProduct(IZUGFeRDExportableProduct product) {
|
||||
this.product = product;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableItemImpl setProduct(IZUGFeRDExportableProduct product) {
|
||||
this.product = product;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItemImpl setItemAllowances(IZUGFeRDAllowanceCharge[] itemAllowances) {
|
||||
this.itemAllowances = itemAllowances;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableItemImpl setItemAllowances(IZUGFeRDAllowanceCharge[] itemAllowances) {
|
||||
this.itemAllowances = itemAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItemImpl setItemCharges(IZUGFeRDAllowanceCharge[] itemCharges) {
|
||||
this.itemCharges = itemCharges;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableItemImpl setItemCharges(IZUGFeRDAllowanceCharge[] itemCharges) {
|
||||
this.itemCharges = itemCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItemImpl setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableItemImpl setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItemImpl setQuantity(BigDecimal quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableItemImpl setQuantity(BigDecimal quantity) {
|
||||
this.quantity = quantity;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,48 +21,48 @@ package org.mustangproject.ZUGFeRD;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class IZUGFeRDExportableProductImpl implements IZUGFeRDExportableProduct {
|
||||
private String unit;
|
||||
private String name;
|
||||
private String description;
|
||||
private BigDecimal vatPercent;
|
||||
private String unit;
|
||||
private String name;
|
||||
private String description;
|
||||
private BigDecimal vatPercent;
|
||||
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getVATPercent() {
|
||||
return vatPercent;
|
||||
}
|
||||
@Override
|
||||
public BigDecimal getVATPercent() {
|
||||
return vatPercent;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableProductImpl setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableProductImpl setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableProductImpl setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableProductImpl setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableProductImpl setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableProductImpl setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableProductImpl setVatPercent(BigDecimal vatPercent) {
|
||||
this.vatPercent = vatPercent;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableProductImpl setVatPercent(BigDecimal vatPercent) {
|
||||
this.vatPercent = vatPercent;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,290 +21,290 @@ package org.mustangproject.ZUGFeRD;
|
||||
import java.util.Date;
|
||||
|
||||
public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTransaction {
|
||||
private String number;
|
||||
private Date issueDate;
|
||||
private String ownOrganisationFullPlaintextInfo;
|
||||
private Date dueDate;
|
||||
private IZUGFeRDAllowanceCharge[] zFAllowances;
|
||||
private IZUGFeRDAllowanceCharge[] zFCharges;
|
||||
private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges;
|
||||
private IZUGFeRDExportableItem[] zFItems;
|
||||
private IZUGFeRDExportableContact recipient;
|
||||
private String ownKto;
|
||||
private String ownBLZ;
|
||||
private String ownBIC;
|
||||
private String ownBankName;
|
||||
private String ownIBAN;
|
||||
private String ownTaxID;
|
||||
private String ownVATID;
|
||||
private String ownOrganisationName;
|
||||
private String ownStreet;
|
||||
private String ownZIP;
|
||||
private String ownLocation;
|
||||
private String ownCountry;
|
||||
private Date deliveryDate;
|
||||
private String currency;
|
||||
private String ownPaymentInfoText;
|
||||
private String paymentTermDescription;
|
||||
private String referenceNumber;
|
||||
private String number;
|
||||
private Date issueDate;
|
||||
private String ownOrganisationFullPlaintextInfo;
|
||||
private Date dueDate;
|
||||
private IZUGFeRDAllowanceCharge[] zFAllowances;
|
||||
private IZUGFeRDAllowanceCharge[] zFCharges;
|
||||
private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges;
|
||||
private IZUGFeRDExportableItem[] zFItems;
|
||||
private IZUGFeRDExportableContact recipient;
|
||||
private String ownKto;
|
||||
private String ownBLZ;
|
||||
private String ownBIC;
|
||||
private String ownBankName;
|
||||
private String ownIBAN;
|
||||
private String ownTaxID;
|
||||
private String ownVATID;
|
||||
private String ownOrganisationName;
|
||||
private String ownStreet;
|
||||
private String ownZIP;
|
||||
private String ownLocation;
|
||||
private String ownCountry;
|
||||
private Date deliveryDate;
|
||||
private String currency;
|
||||
private String ownPaymentInfoText;
|
||||
private String paymentTermDescription;
|
||||
private String referenceNumber;
|
||||
|
||||
@Override
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
@Override
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getIssueDate() {
|
||||
return issueDate;
|
||||
}
|
||||
@Override
|
||||
public Date getIssueDate() {
|
||||
return issueDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return ownOrganisationFullPlaintextInfo;
|
||||
}
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return ownOrganisationFullPlaintextInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDueDate() {
|
||||
return dueDate;
|
||||
}
|
||||
@Override
|
||||
public Date getDueDate() {
|
||||
return dueDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return zFAllowances;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return zFAllowances;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return zFCharges;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return zFCharges;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return zFLogisticsServiceCharges;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return zFLogisticsServiceCharges;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableItem[] getZFItems() {
|
||||
return zFItems;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDExportableItem[] getZFItems() {
|
||||
return zFItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return recipient;
|
||||
}
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return recipient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return ownKto;
|
||||
}
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return ownKto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return ownBLZ;
|
||||
}
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return ownBLZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return ownBIC;
|
||||
}
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return ownBIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBankName() {
|
||||
return ownBankName;
|
||||
}
|
||||
@Override
|
||||
public String getOwnBankName() {
|
||||
return ownBankName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return ownIBAN;
|
||||
}
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return ownIBAN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return ownTaxID;
|
||||
}
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return ownTaxID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnVATID() {
|
||||
return ownVATID;
|
||||
}
|
||||
@Override
|
||||
public String getOwnVATID() {
|
||||
return ownVATID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationName() {
|
||||
return ownOrganisationName;
|
||||
}
|
||||
@Override
|
||||
public String getOwnOrganisationName() {
|
||||
return ownOrganisationName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnStreet() {
|
||||
return ownStreet;
|
||||
}
|
||||
@Override
|
||||
public String getOwnStreet() {
|
||||
return ownStreet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnZIP() {
|
||||
return ownZIP;
|
||||
}
|
||||
@Override
|
||||
public String getOwnZIP() {
|
||||
return ownZIP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnLocation() {
|
||||
return ownLocation;
|
||||
}
|
||||
@Override
|
||||
public String getOwnLocation() {
|
||||
return ownLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnCountry() {
|
||||
return ownCountry;
|
||||
}
|
||||
@Override
|
||||
public String getOwnCountry() {
|
||||
return ownCountry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDeliveryDate() {
|
||||
return deliveryDate;
|
||||
}
|
||||
@Override
|
||||
public Date getDeliveryDate() {
|
||||
return deliveryDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
@Override
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnPaymentInfoText() {
|
||||
return ownPaymentInfoText;
|
||||
}
|
||||
@Override
|
||||
public String getOwnPaymentInfoText() {
|
||||
return ownPaymentInfoText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentTermDescription() {
|
||||
return paymentTermDescription;
|
||||
}
|
||||
@Override
|
||||
public String getPaymentTermDescription() {
|
||||
return paymentTermDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReferenceNumber() {
|
||||
return referenceNumber;
|
||||
}
|
||||
@Override
|
||||
public String getReferenceNumber() {
|
||||
return referenceNumber;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
this.ownOrganisationFullPlaintextInfo = ownOrganisationFullPlaintextInfo;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
this.ownOrganisationFullPlaintextInfo = ownOrganisationFullPlaintextInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
this.zFAllowances = zFAllowances;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
this.zFAllowances = zFAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
this.zFCharges = zFCharges;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
this.zFCharges = zFCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
this.zFLogisticsServiceCharges = zFLogisticsServiceCharges;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
this.zFLogisticsServiceCharges = zFLogisticsServiceCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
this.zFItems = zFItems;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
this.zFItems = zFItems;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
this.recipient = recipient;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
this.recipient = recipient;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBLZ(String ownBLZ) {
|
||||
this.ownBLZ = ownBLZ;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBLZ(String ownBLZ) {
|
||||
this.ownBLZ = ownBLZ;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBIC(String ownBIC) {
|
||||
this.ownBIC = ownBIC;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBIC(String ownBIC) {
|
||||
this.ownBIC = ownBIC;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBankName(String ownBankName) {
|
||||
this.ownBankName = ownBankName;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnBankName(String ownBankName) {
|
||||
this.ownBankName = ownBankName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnKto(String ownKto) {
|
||||
this.ownKto = ownKto;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnKto(String ownKto) {
|
||||
this.ownKto = ownKto;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnIBAN(String ownIBAN) {
|
||||
this.ownIBAN = ownIBAN;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnIBAN(String ownIBAN) {
|
||||
this.ownIBAN = ownIBAN;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
this.ownOrganisationName = ownOrganisationName;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
this.ownOrganisationName = ownOrganisationName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
this.ownStreet = ownStreet;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
this.ownStreet = ownStreet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
this.ownZIP = ownZIP;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
this.ownZIP = ownZIP;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
this.ownLocation = ownLocation;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
this.ownLocation = ownLocation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
this.ownCountry = ownCountry;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
this.ownCountry = ownCountry;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnPaymentInfoText(String ownPaymentInfoText) {
|
||||
this.ownPaymentInfoText = ownPaymentInfoText;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setOwnPaymentInfoText(String ownPaymentInfoText) {
|
||||
this.ownPaymentInfoText = ownPaymentInfoText;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
this.paymentTermDescription = paymentTermDescription;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
this.paymentTermDescription = paymentTermDescription;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
this.referenceNumber = referenceNumber;
|
||||
return this;
|
||||
}
|
||||
public IZUGFeRDExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
this.referenceNumber = referenceNumber;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,23 +18,23 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName
|
||||
* name of the test case
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public MustangReaderWriterCustomXMLTest(String testName) {
|
||||
super(testName);
|
||||
@@ -49,7 +49,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
// //////// TESTS
|
||||
// //////////////////////////////////////////////////////////////////////////////////////////
|
||||
public void testCustomZF2Export() throws Exception {
|
||||
public void testCustomZF2Export() throws Exception {
|
||||
|
||||
final String TARGET_PDF = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506custom.pdf";
|
||||
// the writing part
|
||||
@@ -60,210 +60,210 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator("Test").setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931)
|
||||
.load(SOURCE_PDF);
|
||||
|
||||
final byte[] UTF8ByteOrderMark = new byte[] { (byte)0xef, (byte)0xbb,
|
||||
(byte)0xbf };
|
||||
|
||||
final byte[] UTF8ByteOrderMark = new byte[]{(byte) 0xef, (byte) 0xbb,
|
||||
(byte) 0xbf};
|
||||
/* we have much more information than just in the basic profile (comfort or extended) but it's perfectly valid to provide more information, just not less. */
|
||||
String ownZUGFeRDXML = new String(UTF8ByteOrderMark)+"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n" +
|
||||
" <rsm:ExchangedDocumentContext>\n" +
|
||||
" <ram:TestIndicator><udt:Indicator>false</udt:Indicator></ram:TestIndicator>\n" +
|
||||
" <ram:GuidelineSpecifiedDocumentContextParameter>\n" +
|
||||
" <ram:ID>urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended</ram:ID>\n" +
|
||||
" </ram:GuidelineSpecifiedDocumentContextParameter>\n" +
|
||||
" </rsm:ExchangedDocumentContext>\n" +
|
||||
" <rsm:ExchangedDocument>\n" +
|
||||
" <ram:ID>RE-20171118/506</ram:ID>\n" +
|
||||
" <ram:Name>RECHNUNG</ram:Name>\n" +
|
||||
" <ram:TypeCode>380</ram:TypeCode>\n" +
|
||||
" <ram:IssueDateTime><udt:DateTimeString format=\"102\">20171118</udt:DateTimeString></ram:IssueDateTime>\n" +
|
||||
" </rsm:ExchangedDocument>\n" +
|
||||
" <rsm:SupplyChainTradeTransaction>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>1</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">160.0000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"HUR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">160.0000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"HUR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"HUR\">1.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">160.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>2</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Luftballon: Bunt, ca. 500ml</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.7900</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"C62\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.7900</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"C62\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"C62\">400.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">316.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>3</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Heiße Luft pro Liter</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.1000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"LTR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.1000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"LTR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"LTR\">200.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">20.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:ApplicableHeaderTradeAgreement>\n" +
|
||||
" <ram:SellerTradeParty>\n" +
|
||||
" <ram:Name>Bei Spiel GmbH</ram:Name>\n" +
|
||||
" <ram:PostalTradeAddress>\n" +
|
||||
" <ram:PostcodeCode>12345</ram:PostcodeCode>\n" +
|
||||
" <ram:LineOne>Ecke 12</ram:LineOne>\n" +
|
||||
" <ram:CityName>Stadthausen</ram:CityName>\n" +
|
||||
" <ram:CountryID>DE</ram:CountryID>\n" +
|
||||
" </ram:PostalTradeAddress>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"FC\">22/815/0815/4</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"VA\">DE136695976</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" </ram:SellerTradeParty>\n" +
|
||||
" <ram:BuyerTradeParty>\n" +
|
||||
" <ram:Name>Theodor Est</ram:Name>\n" +
|
||||
" <ram:PostalTradeAddress>\n" +
|
||||
" <ram:PostcodeCode>88802</ram:PostcodeCode>\n" +
|
||||
" <ram:LineOne>Bahnstr. 42</ram:LineOne>\n" +
|
||||
" <ram:CityName>Spielkreis</ram:CityName>\n" +
|
||||
" <ram:CountryID>DE</ram:CountryID>\n" +
|
||||
" </ram:PostalTradeAddress>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"VA\">DE999999999</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" </ram:BuyerTradeParty>\n" +
|
||||
" </ram:ApplicableHeaderTradeAgreement>\n" +
|
||||
" <ram:ApplicableHeaderTradeDelivery>\n" +
|
||||
" <ram:ActualDeliverySupplyChainEvent>\n" +
|
||||
" <ram:OccurrenceDateTime><udt:DateTimeString format=\"102\">20171117</udt:DateTimeString></ram:OccurrenceDateTime>\n" +
|
||||
" </ram:ActualDeliverySupplyChainEvent>\n" +
|
||||
" </ram:ApplicableHeaderTradeDelivery>\n" +
|
||||
" <ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" <ram:PaymentReference>RE-20171118/506</ram:PaymentReference>\n" +
|
||||
" <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n" +
|
||||
" <ram:SpecifiedTradeSettlementPaymentMeans>\n" +
|
||||
" <ram:TypeCode>42</ram:TypeCode>\n" +
|
||||
" <ram:Information>Überweisung</ram:Information>\n" +
|
||||
" <ram:PayeePartyCreditorFinancialAccount>\n" +
|
||||
String ownZUGFeRDXML = new String(UTF8ByteOrderMark) + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
|
||||
"<rsm:CrossIndustryInvoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n" +
|
||||
" <rsm:ExchangedDocumentContext>\n" +
|
||||
" <ram:TestIndicator><udt:Indicator>false</udt:Indicator></ram:TestIndicator>\n" +
|
||||
" <ram:GuidelineSpecifiedDocumentContextParameter>\n" +
|
||||
" <ram:ID>urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:extended</ram:ID>\n" +
|
||||
" </ram:GuidelineSpecifiedDocumentContextParameter>\n" +
|
||||
" </rsm:ExchangedDocumentContext>\n" +
|
||||
" <rsm:ExchangedDocument>\n" +
|
||||
" <ram:ID>RE-20171118/506</ram:ID>\n" +
|
||||
" <ram:Name>RECHNUNG</ram:Name>\n" +
|
||||
" <ram:TypeCode>380</ram:TypeCode>\n" +
|
||||
" <ram:IssueDateTime><udt:DateTimeString format=\"102\">20171118</udt:DateTimeString></ram:IssueDateTime>\n" +
|
||||
" </rsm:ExchangedDocument>\n" +
|
||||
" <rsm:SupplyChainTradeTransaction>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>1</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">160.0000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"HUR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">160.0000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"HUR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"HUR\">1.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">160.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>2</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Luftballon: Bunt, ca. 500ml</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.7900</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"C62\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.7900</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"C62\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"C62\">400.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">316.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:LineID>3</ram:LineID>\n" +
|
||||
" </ram:AssociatedDocumentLineDocument>\n" +
|
||||
" <ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:Name>Heiße Luft pro Liter</ram:Name>\n" +
|
||||
" <ram:Description></ram:Description>\n" +
|
||||
" </ram:SpecifiedTradeProduct>\n" +
|
||||
" <ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.1000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"LTR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:GrossPriceProductTradePrice>\n" +
|
||||
" <ram:NetPriceProductTradePrice>\n" +
|
||||
" <ram:ChargeAmount currencyID=\"EUR\">0.1000</ram:ChargeAmount>\n" +
|
||||
" <ram:BasisQuantity unitCode=\"LTR\">1.0000</ram:BasisQuantity>\n" +
|
||||
" </ram:NetPriceProductTradePrice>\n" +
|
||||
" </ram:SpecifiedLineTradeAgreement>\n" +
|
||||
" <ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:BilledQuantity unitCode=\"LTR\">200.0000</ram:BilledQuantity>\n" +
|
||||
" </ram:SpecifiedLineTradeDelivery>\n" +
|
||||
" <ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">20.00</ram:LineTotalAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementLineMonetarySummation>\n" +
|
||||
" </ram:SpecifiedLineTradeSettlement>\n" +
|
||||
" </ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:ApplicableHeaderTradeAgreement>\n" +
|
||||
" <ram:SellerTradeParty>\n" +
|
||||
" <ram:Name>Bei Spiel GmbH</ram:Name>\n" +
|
||||
" <ram:PostalTradeAddress>\n" +
|
||||
" <ram:PostcodeCode>12345</ram:PostcodeCode>\n" +
|
||||
" <ram:LineOne>Ecke 12</ram:LineOne>\n" +
|
||||
" <ram:CityName>Stadthausen</ram:CityName>\n" +
|
||||
" <ram:CountryID>DE</ram:CountryID>\n" +
|
||||
" </ram:PostalTradeAddress>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"FC\">22/815/0815/4</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"VA\">DE136695976</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" </ram:SellerTradeParty>\n" +
|
||||
" <ram:BuyerTradeParty>\n" +
|
||||
" <ram:Name>Theodor Est</ram:Name>\n" +
|
||||
" <ram:PostalTradeAddress>\n" +
|
||||
" <ram:PostcodeCode>88802</ram:PostcodeCode>\n" +
|
||||
" <ram:LineOne>Bahnstr. 42</ram:LineOne>\n" +
|
||||
" <ram:CityName>Spielkreis</ram:CityName>\n" +
|
||||
" <ram:CountryID>DE</ram:CountryID>\n" +
|
||||
" </ram:PostalTradeAddress>\n" +
|
||||
" <ram:SpecifiedTaxRegistration>\n" +
|
||||
" <ram:ID schemeID=\"VA\">DE999999999</ram:ID>\n" +
|
||||
" </ram:SpecifiedTaxRegistration>\n" +
|
||||
" </ram:BuyerTradeParty>\n" +
|
||||
" </ram:ApplicableHeaderTradeAgreement>\n" +
|
||||
" <ram:ApplicableHeaderTradeDelivery>\n" +
|
||||
" <ram:ActualDeliverySupplyChainEvent>\n" +
|
||||
" <ram:OccurrenceDateTime><udt:DateTimeString format=\"102\">20171117</udt:DateTimeString></ram:OccurrenceDateTime>\n" +
|
||||
" </ram:ActualDeliverySupplyChainEvent>\n" +
|
||||
" </ram:ApplicableHeaderTradeDelivery>\n" +
|
||||
" <ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" <ram:PaymentReference>RE-20171118/506</ram:PaymentReference>\n" +
|
||||
" <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>\n" +
|
||||
" <ram:SpecifiedTradeSettlementPaymentMeans>\n" +
|
||||
" <ram:TypeCode>42</ram:TypeCode>\n" +
|
||||
" <ram:Information>Überweisung</ram:Information>\n" +
|
||||
" <ram:PayeePartyCreditorFinancialAccount>\n" +
|
||||
" <ram:IBANID>DE88 2008 0000 0970 3757 00</ram:IBANID>\n" +
|
||||
" <ram:ProprietaryID>44421800</ram:ProprietaryID>\n" +
|
||||
" </ram:PayeePartyCreditorFinancialAccount>\n" +
|
||||
" <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
|
||||
" <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
|
||||
" <ram:BICID>COBADEFFXXX</ram:BICID>\n" +
|
||||
" <ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n" +
|
||||
" <ram:Name>Commerzbank</ram:Name>\n" +
|
||||
" </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
|
||||
" </ram:SpecifiedTradeSettlementPaymentMeans>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:CalculatedAmount currencyID=\"EUR\">11.20</ram:CalculatedAmount>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:BasisAmount currencyID=\"EUR\">160.00</ram:BasisAmount>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:CalculatedAmount currencyID=\"EUR\">63.84</ram:CalculatedAmount>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:BasisAmount currencyID=\"EUR\">336.00</ram:BasisAmount>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradePaymentTerms>\n" +
|
||||
" <ram:Description>Zahlbar ohne Abzug bis 09.12.2017</ram:Description>\n" +
|
||||
" <ram:DueDateDateTime><udt:DateTimeString format=\"102\">20171209</udt:DateTimeString></ram:DueDateDateTime>\n" +
|
||||
" </ram:SpecifiedTradePaymentTerms>\n" +
|
||||
" <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">496.00</ram:LineTotalAmount>\n" +
|
||||
" <ram:ChargeTotalAmount currencyID=\"EUR\">0.00</ram:ChargeTotalAmount>\n" +
|
||||
" <ram:AllowanceTotalAmount currencyID=\"EUR\">0.00</ram:AllowanceTotalAmount>\n" +
|
||||
" <ram:TaxBasisTotalAmount currencyID=\"EUR\">496.00</ram:TaxBasisTotalAmount>\n" +
|
||||
" <ram:TaxTotalAmount currencyID=\"EUR\">75.04</ram:TaxTotalAmount>\n" +
|
||||
" <ram:GrandTotalAmount currencyID=\"EUR\">571.04</ram:GrandTotalAmount>\n" +
|
||||
" <ram:DuePayableAmount currencyID=\"EUR\">571.04</ram:DuePayableAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" +
|
||||
" </ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" </rsm:SupplyChainTradeTransaction>\n" +
|
||||
" <ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n" +
|
||||
" <ram:Name>Commerzbank</ram:Name>\n" +
|
||||
" </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" +
|
||||
" </ram:SpecifiedTradeSettlementPaymentMeans>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:CalculatedAmount currencyID=\"EUR\">11.20</ram:CalculatedAmount>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:BasisAmount currencyID=\"EUR\">160.00</ram:BasisAmount>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>7.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:ApplicableTradeTax>\n" +
|
||||
" <ram:CalculatedAmount currencyID=\"EUR\">63.84</ram:CalculatedAmount>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:BasisAmount currencyID=\"EUR\">336.00</ram:BasisAmount>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:ApplicableTradeTax>\n" +
|
||||
" <ram:SpecifiedTradePaymentTerms>\n" +
|
||||
" <ram:Description>Zahlbar ohne Abzug bis 09.12.2017</ram:Description>\n" +
|
||||
" <ram:DueDateDateTime><udt:DateTimeString format=\"102\">20171209</udt:DateTimeString></ram:DueDateDateTime>\n" +
|
||||
" </ram:SpecifiedTradePaymentTerms>\n" +
|
||||
" <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" +
|
||||
" <ram:LineTotalAmount currencyID=\"EUR\">496.00</ram:LineTotalAmount>\n" +
|
||||
" <ram:ChargeTotalAmount currencyID=\"EUR\">0.00</ram:ChargeTotalAmount>\n" +
|
||||
" <ram:AllowanceTotalAmount currencyID=\"EUR\">0.00</ram:AllowanceTotalAmount>\n" +
|
||||
" <ram:TaxBasisTotalAmount currencyID=\"EUR\">496.00</ram:TaxBasisTotalAmount>\n" +
|
||||
" <ram:TaxTotalAmount currencyID=\"EUR\">75.04</ram:TaxTotalAmount>\n" +
|
||||
" <ram:GrandTotalAmount currencyID=\"EUR\">571.04</ram:GrandTotalAmount>\n" +
|
||||
" <ram:DuePayableAmount currencyID=\"EUR\">571.04</ram:DuePayableAmount>\n" +
|
||||
" </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n" +
|
||||
" </ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" </rsm:SupplyChainTradeTransaction>\n" +
|
||||
"</rsm:CrossIndustryInvoice>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
|
||||
ByteArrayOutputStream baos=new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
zea1.export(baos);
|
||||
zea1.close();
|
||||
String pdfContent=baos.toString("UTF-8");
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org")==-1);
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
|
||||
} catch (IOException e) {
|
||||
@@ -278,31 +278,32 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
String ref = null;
|
||||
|
||||
if (zi.canParse()) {
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
blz = zi.getBLZ();
|
||||
blz = zi.getBLZ();
|
||||
bic = zi.getBIC();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(blz, "41441604");
|
||||
assertEquals(blz, "41441604");
|
||||
assertEquals(bic, "COBADEFFXXX");
|
||||
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(kto, "44421800");
|
||||
assertEquals(holder, "Bei Spiel GmbH");
|
||||
assertEquals(ref, "RE-20171118/506");
|
||||
}
|
||||
|
||||
/**
|
||||
* The exporter test bases on @{code
|
||||
* ./src/test/MustangGnuaccountingBeispielRE-20140703_502blanko.pdf}, adds
|
||||
@@ -361,10 +362,10 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
+ "<ram:ProprietaryID>44421800</ram:ProprietaryID>\n"
|
||||
+ "</ram:PayeePartyCreditorFinancialAccount>\n"
|
||||
+ "<ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
||||
+ "<ram:BICID>COBADEFFXXX</ram:BICID>\n"
|
||||
+ "<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n"
|
||||
+ "<ram:BICID>COBADEFFXXX</ram:BICID>\n"
|
||||
+ "<ram:GermanBankleitzahlID>41441604</ram:GermanBankleitzahlID>\n"
|
||||
+ "<ram:Name>Commerzbank</ram:Name>\n"
|
||||
+ "</ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
||||
+ "</ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
||||
+ "</ram:SpecifiedTradeSettlementPaymentMeans>\n" + "<ram:ApplicableTradeTax>\n"
|
||||
+ "<ram:CalculatedAmount currencyID=\"EUR\">11.20</ram:CalculatedAmount>\n"
|
||||
+ "<ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||
@@ -458,13 +459,13 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
+ "</rsm:SpecifiedSupplyChainTradeTransaction>\n" + "</rsm:CrossIndustryDocument>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
|
||||
ByteArrayOutputStream baos=new ByteArrayOutputStream();
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
zea1.export(baos);
|
||||
zea1.close();
|
||||
String pdfContent=baos.toString("UTF-8");
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org")==-1);
|
||||
String pdfContent = baos.toString("UTF-8");
|
||||
assertFalse(pdfContent.indexOf("(via mustangproject.org") == -1);
|
||||
assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>BASIC</zf:ConformanceLevel>") == -1);
|
||||
|
||||
} catch (IOException e) {
|
||||
@@ -479,7 +480,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
@@ -489,7 +490,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
bic = zi.getBIC();
|
||||
blz = zi.getBLZ();
|
||||
blz = zi.getBLZ();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
@@ -498,7 +499,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, "COBADEFFXXX");
|
||||
assertEquals(blz, "41441604");
|
||||
assertEquals(blz, "41441604");
|
||||
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(kto, "44421800");
|
||||
assertEquals(holder, "Bei Spiel GmbH");
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
@@ -25,464 +31,407 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExportableTransaction
|
||||
{
|
||||
|
||||
@Override
|
||||
public Date getDeliveryDate()
|
||||
{
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 7).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDueDate()
|
||||
{
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 30).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getIssueDate()
|
||||
{
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 9).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNumber()
|
||||
{
|
||||
return "RE-20170509/505";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnKto()
|
||||
{
|
||||
return "44421800";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBLZ()
|
||||
{
|
||||
return "41441604";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBIC()
|
||||
{
|
||||
return "COBADEFFXXX";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBankName()
|
||||
{
|
||||
return "Commerzbank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnCountry()
|
||||
{
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN()
|
||||
{
|
||||
return "DE88 2008 0000 0970 3757 00";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnLocation()
|
||||
{
|
||||
return "Stadthausen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationName()
|
||||
{
|
||||
return "Bei Spiel GmbH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnStreet()
|
||||
{
|
||||
return "Ecke 12";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID()
|
||||
{
|
||||
return "22/815/0815/4";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnVATID()
|
||||
{
|
||||
return "DE136695976";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnZIP()
|
||||
{
|
||||
return "12345";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient()
|
||||
{
|
||||
return new Contact();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrency()
|
||||
{
|
||||
return "EUR";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableItem[] getZFItems()
|
||||
{
|
||||
Item[] allItems = new Item[3];
|
||||
Product designProduct = new Product("", "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung", "HUR", new BigDecimal("7.000000"));
|
||||
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||
|
||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||
return allItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnPaymentInfoText() {
|
||||
return "Überweisung";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentTermDescription() {
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||
return "Zahlbar ohne Abzug bis zum " + germanDateFormat.format(getDueDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReferenceNumber() {
|
||||
return null;
|
||||
}
|
||||
|
||||
class Contact implements IZUGFeRDExportableContact
|
||||
{
|
||||
|
||||
@Override
|
||||
public String getCountry()
|
||||
{
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation()
|
||||
{
|
||||
return "Spielkreis";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Theodor Est";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStreet()
|
||||
{
|
||||
return "Bahnstr. 42";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVATID()
|
||||
{
|
||||
return "DE999999999";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getZIP()
|
||||
{
|
||||
return "88802";
|
||||
}
|
||||
}
|
||||
|
||||
class Item implements IZUGFeRDExportableItem
|
||||
{
|
||||
|
||||
public Item(BigDecimal price, BigDecimal quantity, Product product)
|
||||
{
|
||||
super();
|
||||
this.price = price;
|
||||
this.quantity = quantity;
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
private BigDecimal price,quantity;
|
||||
private Product product;
|
||||
|
||||
@Override
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Product getProduct()
|
||||
{
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(Product product)
|
||||
{
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Product implements IZUGFeRDExportableProduct
|
||||
{
|
||||
private String description, name, unit;
|
||||
private BigDecimal VATPercent;
|
||||
|
||||
public Product(String description, String name, String unit, BigDecimal VATPercent)
|
||||
{
|
||||
super();
|
||||
this.description = description;
|
||||
this.name = name;
|
||||
this.unit = unit;
|
||||
this.VATPercent = VATPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getVATPercent()
|
||||
{
|
||||
return VATPercent;
|
||||
}
|
||||
|
||||
public void setVATPercent(BigDecimal vATPercent)
|
||||
{
|
||||
VATPercent = vATPercent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName
|
||||
* name of the test case
|
||||
*/
|
||||
public MustangReaderWriterEdgeTest(String testName)
|
||||
{
|
||||
super(testName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite()
|
||||
{
|
||||
return new TestSuite(MustangReaderWriterEdgeTest.class);
|
||||
}
|
||||
|
||||
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20170509_505.pdf to check the values.
|
||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
||||
* testZExport
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
||||
public void testAImport() throws IOException
|
||||
{
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
zi.extractLowLevel(this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505.pdf"));
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
String ref = null;
|
||||
String dueDate = null;
|
||||
|
||||
if (zi.canParse())
|
||||
{
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
bic = zi.getBIC();
|
||||
blz = zi.getBLZ();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
dueDate = zi.getDueDate();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, getOwnBIC());
|
||||
assertEquals(blz, getOwnBLZ());
|
||||
assertEquals(iban, getOwnIBAN());
|
||||
assertEquals(kto, getOwnKto());
|
||||
assertEquals(holder, getOwnOrganisationName());
|
||||
|
||||
assertEquals(dueDate, "20170530");
|
||||
assertEquals(ref, getNumber());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The exporter test bases on @{code ./src/test/MustangGnuaccountingBeispielRE-20140703_502blanko.pdf}, adds metadata,
|
||||
* writes
|
||||
* to @{code ./target/testout-*} and then imports to check the values.
|
||||
* It would not make sense to have it run before the less complex importer test (which is probably redundant)
|
||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the Exporter Test test-Z-Export
|
||||
*/
|
||||
public void testEdgeExport() throws Exception {
|
||||
|
||||
final String TARGET_PDF = "./target/testout-MustangGnuaccountingBeispielRE-20170509_505newEdge.pdf";
|
||||
// the writing part
|
||||
|
||||
try(InputStream SOURCE_PDF =
|
||||
this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory()
|
||||
.setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name"))
|
||||
.ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.setZUGFeRDVersion(1);
|
||||
ze.PDFattachZugferdFile(this);
|
||||
String theXML=new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryDocument"));
|
||||
ze.export(TARGET_PDF);
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
zi.extract(TARGET_PDF);
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
String ref = null;
|
||||
|
||||
if (zi.canParse())
|
||||
{
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
bic = zi.getBIC();
|
||||
blz = zi.getBLZ();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, getOwnBIC());
|
||||
assertEquals(blz, getOwnBLZ());
|
||||
assertEquals(iban, getOwnIBAN());
|
||||
assertEquals(kto, getOwnKto());
|
||||
assertEquals(holder, getOwnOrganisationName());
|
||||
assertEquals(ref, getNumber());
|
||||
|
||||
}
|
||||
public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExportableTransaction {
|
||||
|
||||
@Override
|
||||
public Date getDeliveryDate() {
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 7).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDueDate() {
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 30).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getIssueDate() {
|
||||
return new GregorianCalendar(2017, Calendar.MAY, 9).getTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNumber() {
|
||||
return "RE-20170509/505";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return "44421800";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return "41441604";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return "COBADEFFXXX";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBankName() {
|
||||
return "Commerzbank";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnCountry() {
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return "DE88 2008 0000 0970 3757 00";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnLocation() {
|
||||
return "Stadthausen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationName() {
|
||||
return "Bei Spiel GmbH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnStreet() {
|
||||
return "Ecke 12";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return "22/815/0815/4";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnVATID() {
|
||||
return "DE136695976";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnZIP() {
|
||||
return "12345";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new Contact();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrency() {
|
||||
return "EUR";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableItem[] getZFItems() {
|
||||
Item[] allItems = new Item[3];
|
||||
Product designProduct = new Product("", "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung", "HUR", new BigDecimal("7.000000"));
|
||||
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||
|
||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||
return allItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnPaymentInfoText() {
|
||||
return "Überweisung";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentTermDescription() {
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||
return "Zahlbar ohne Abzug bis zum " + germanDateFormat.format(getDueDate());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReferenceNumber() {
|
||||
return null;
|
||||
}
|
||||
|
||||
class Contact implements IZUGFeRDExportableContact {
|
||||
|
||||
@Override
|
||||
public String getCountry() {
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
return "Spielkreis";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Theodor Est";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStreet() {
|
||||
return "Bahnstr. 42";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVATID() {
|
||||
return "DE999999999";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getZIP() {
|
||||
return "88802";
|
||||
}
|
||||
}
|
||||
|
||||
class Item implements IZUGFeRDExportableItem {
|
||||
|
||||
public Item(BigDecimal price, BigDecimal quantity, Product product) {
|
||||
super();
|
||||
this.price = price;
|
||||
this.quantity = quantity;
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
private BigDecimal price, quantity;
|
||||
private Product product;
|
||||
|
||||
@Override
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setQuantity(BigDecimal quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Product getProduct() {
|
||||
return product;
|
||||
}
|
||||
|
||||
public void setProduct(Product product) {
|
||||
this.product = product;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Product implements IZUGFeRDExportableProduct {
|
||||
private String description, name, unit;
|
||||
private BigDecimal VATPercent;
|
||||
|
||||
public Product(String description, String name, String unit, BigDecimal VATPercent) {
|
||||
super();
|
||||
this.description = description;
|
||||
this.name = name;
|
||||
this.unit = unit;
|
||||
this.VATPercent = VATPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getVATPercent() {
|
||||
return VATPercent;
|
||||
}
|
||||
|
||||
public void setVATPercent(BigDecimal vATPercent) {
|
||||
VATPercent = vATPercent;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public MustangReaderWriterEdgeTest(String testName) {
|
||||
super(testName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the suite of tests being tested
|
||||
*/
|
||||
public static Test suite() {
|
||||
return new TestSuite(MustangReaderWriterEdgeTest.class);
|
||||
}
|
||||
|
||||
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20170509_505.pdf to check the values.
|
||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
||||
* testZExport
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
||||
public void testAImport() throws IOException {
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
zi.extractLowLevel(this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505.pdf"));
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
String ref = null;
|
||||
String dueDate = null;
|
||||
|
||||
if (zi.canParse()) {
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
bic = zi.getBIC();
|
||||
blz = zi.getBLZ();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
dueDate = zi.getDueDate();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, getOwnBIC());
|
||||
assertEquals(blz, getOwnBLZ());
|
||||
assertEquals(iban, getOwnIBAN());
|
||||
assertEquals(kto, getOwnKto());
|
||||
assertEquals(holder, getOwnOrganisationName());
|
||||
|
||||
assertEquals(dueDate, "20170530");
|
||||
assertEquals(ref, getNumber());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* The exporter test bases on @{code ./src/test/MustangGnuaccountingBeispielRE-20140703_502blanko.pdf}, adds metadata,
|
||||
* writes
|
||||
* to @{code ./target/testout-*} and then imports to check the values.
|
||||
* It would not make sense to have it run before the less complex importer test (which is probably redundant)
|
||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the Exporter Test test-Z-Export
|
||||
*/
|
||||
public void testEdgeExport() throws Exception {
|
||||
|
||||
final String TARGET_PDF = "./target/testout-MustangGnuaccountingBeispielRE-20170509_505newEdge.pdf";
|
||||
// the writing part
|
||||
|
||||
try (InputStream SOURCE_PDF =
|
||||
this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory()
|
||||
.setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name"))
|
||||
.ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.setZUGFeRDVersion(1);
|
||||
ze.PDFattachZugferdFile(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryDocument"));
|
||||
ze.export(TARGET_PDF);
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
zi.extract(TARGET_PDF);
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = null;
|
||||
String bic = null;
|
||||
String blz = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
String holder = null;
|
||||
String ref = null;
|
||||
|
||||
if (zi.canParse()) {
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
bic = zi.getBIC();
|
||||
blz = zi.getBLZ();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
holder = zi.getHolder();
|
||||
ref = zi.getForeignReference();
|
||||
}
|
||||
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(bic, getOwnBIC());
|
||||
assertEquals(blz, getOwnBLZ());
|
||||
assertEquals(iban, getOwnIBAN());
|
||||
assertEquals(kto, getOwnKto());
|
||||
assertEquals(holder, getOwnOrganisationName());
|
||||
assertEquals(ref, getNumber());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -27,11 +33,6 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExportableTransaction {
|
||||
@@ -56,17 +57,17 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
return "RE-20171118/506";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return "44421800";
|
||||
}
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return "44421800";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return "41441604";
|
||||
}
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return "41441604";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return "COBADEFFXXX";
|
||||
}
|
||||
@@ -319,8 +320,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName
|
||||
* name of the test case
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public MustangReaderWriterTest(String testName) {
|
||||
super(testName);
|
||||
@@ -355,7 +355,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = null;
|
||||
String blz = null;
|
||||
String blz = null;
|
||||
String bic = null;
|
||||
String iban = null;
|
||||
String kto = null;
|
||||
@@ -365,7 +365,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
if (zi.canParse()) {
|
||||
zi.parse();
|
||||
amount = zi.getAmount();
|
||||
blz = zi.getBLZ();
|
||||
blz = zi.getBLZ();
|
||||
bic = zi.getBIC();
|
||||
iban = zi.getIBAN();
|
||||
kto = zi.getKTO();
|
||||
@@ -375,7 +375,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
// this resembles the data written in MustangReaderWriterCustomXMLTest
|
||||
assertEquals(amount, "571.04");
|
||||
assertEquals(blz, "41441604");
|
||||
assertEquals(bic, "COBADEFFXXX");
|
||||
assertEquals(bic, "COBADEFFXXX");
|
||||
assertEquals(iban, "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(kto, "44421800");
|
||||
assertEquals(holder, "Bei Spiel GmbH");
|
||||
@@ -385,95 +385,94 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
|
||||
public void testForeignImport() throws IOException {
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||
|
||||
|
||||
try (InputStream inputStream = this.getClass()
|
||||
.getResourceAsStream("/zugferd_invoice.pdf")) {
|
||||
zi.extractLowLevel(inputStream);
|
||||
}
|
||||
// Reading ZUGFeRD
|
||||
|
||||
String amount = zi.getAmount();
|
||||
|
||||
assertEquals("<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n" +
|
||||
" <x:xmpmeta xmlns:x=\"adobe:ns:meta/\">\n" +
|
||||
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:xmpMM=\"http://ns.adobe.com/xap/1.0/mm/\">\n" +
|
||||
" <xmpMM:InstanceID>uuid:6776DD95-DAF6-768E-DAE6-2697750D95C5</xmpMM:InstanceID>\n" +
|
||||
" <xmpMM:DocumentID>uuid:47380404-5938-FE2C-8F0B-B505DCE43BF5</xmpMM:DocumentID>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:zf=\"urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#\">\n" +
|
||||
" <zf:ConformanceLevel>BASIC</zf:ConformanceLevel>\n" +
|
||||
" <zf:DocumentFileName>ZUGFeRD-invoice.xml</zf:DocumentFileName>\n" +
|
||||
" <zf:DocumentType>INVOICE</zf:DocumentType>\n" +
|
||||
" <zf:Version>1.0</zf:Version>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdfaExtension=\"http://www.aiim.org/pdfa/ns/extension/\" xmlns:pdfaSchema=\"http://www.aiim.org/pdfa/ns/schema#\" xmlns:pdfaProperty=\"http://www.aiim.org/pdfa/ns/property#\">\n" +
|
||||
" <pdfaExtension:schemas>\n" +
|
||||
" <rdf:Bag>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaSchema:schema>ZUGFeRD PDFA Extension Schema</pdfaSchema:schema>\n" +
|
||||
" <pdfaSchema:namespaceURI>urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>\n" +
|
||||
" <pdfaSchema:prefix>zf</pdfaSchema:prefix>\n" +
|
||||
" <pdfaSchema:property>\n" +
|
||||
" <rdf:Seq>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>DocumentFileName</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>name of the embedded XML invoice file</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>DocumentType</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>INVOICE</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>Version</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>The actual version of the ZUGFeRD XML schema</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>ConformanceLevel</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>The conformance level of the embedded ZUGFeRD data</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" </rdf:Seq>\n" +
|
||||
" </pdfaSchema:property>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" </rdf:Bag>\n" +
|
||||
" </pdfaExtension:schemas>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdfaid=\"http://www.aiim.org/pdfa/ns/id/\">\n" +
|
||||
" <pdfaid:part>3</pdfaid:part>\n" +
|
||||
" <pdfaid:conformance>B</pdfaid:conformance>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" +
|
||||
" <xmp:CreateDate>2014-07-11T13:39:46+02:00</xmp:CreateDate>\n" +
|
||||
" <xmp:ModifyDate>2014-07-11T13:39:46+02:00</xmp:ModifyDate>\n" +
|
||||
" <xmp:CreatorTool>zugferd_invoice.java</xmp:CreatorTool>\n" +
|
||||
" <xmp:MetadataDate>2014-07-11T13:39:46+02:00</xmp:MetadataDate>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" +
|
||||
" <pdf:Producer>PDFlib Personalization Server 9.0.3 (JDK 1.6/Mac OS X-10.6 64)</pdf:Producer>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" +
|
||||
" <dc:title>\n" +
|
||||
" <rdf:Alt>\n" +
|
||||
" <rdf:li xml:lang=\"x-default\">ZUGFeRD Rechnung $Revision: 1.13 $</rdf:li>\n" +
|
||||
" </rdf:Alt>\n" +
|
||||
" </dc:title>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" </rdf:RDF>\n" +
|
||||
" </x:xmpmeta>\n" +
|
||||
String amount = zi.getAmount();
|
||||
|
||||
assertEquals("<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>\n" +
|
||||
" <x:xmpmeta xmlns:x=\"adobe:ns:meta/\">\n" +
|
||||
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:xmpMM=\"http://ns.adobe.com/xap/1.0/mm/\">\n" +
|
||||
" <xmpMM:InstanceID>uuid:6776DD95-DAF6-768E-DAE6-2697750D95C5</xmpMM:InstanceID>\n" +
|
||||
" <xmpMM:DocumentID>uuid:47380404-5938-FE2C-8F0B-B505DCE43BF5</xmpMM:DocumentID>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:zf=\"urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#\">\n" +
|
||||
" <zf:ConformanceLevel>BASIC</zf:ConformanceLevel>\n" +
|
||||
" <zf:DocumentFileName>ZUGFeRD-invoice.xml</zf:DocumentFileName>\n" +
|
||||
" <zf:DocumentType>INVOICE</zf:DocumentType>\n" +
|
||||
" <zf:Version>1.0</zf:Version>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdfaExtension=\"http://www.aiim.org/pdfa/ns/extension/\" xmlns:pdfaSchema=\"http://www.aiim.org/pdfa/ns/schema#\" xmlns:pdfaProperty=\"http://www.aiim.org/pdfa/ns/property#\">\n" +
|
||||
" <pdfaExtension:schemas>\n" +
|
||||
" <rdf:Bag>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaSchema:schema>ZUGFeRD PDFA Extension Schema</pdfaSchema:schema>\n" +
|
||||
" <pdfaSchema:namespaceURI>urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>\n" +
|
||||
" <pdfaSchema:prefix>zf</pdfaSchema:prefix>\n" +
|
||||
" <pdfaSchema:property>\n" +
|
||||
" <rdf:Seq>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>DocumentFileName</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>name of the embedded XML invoice file</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>DocumentType</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>INVOICE</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>Version</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>The actual version of the ZUGFeRD XML schema</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" <rdf:li rdf:parseType=\"Resource\">\n" +
|
||||
" <pdfaProperty:name>ConformanceLevel</pdfaProperty:name>\n" +
|
||||
" <pdfaProperty:valueType>Text</pdfaProperty:valueType>\n" +
|
||||
" <pdfaProperty:category>external</pdfaProperty:category>\n" +
|
||||
" <pdfaProperty:description>The conformance level of the embedded ZUGFeRD data</pdfaProperty:description>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" </rdf:Seq>\n" +
|
||||
" </pdfaSchema:property>\n" +
|
||||
" </rdf:li>\n" +
|
||||
" </rdf:Bag>\n" +
|
||||
" </pdfaExtension:schemas>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdfaid=\"http://www.aiim.org/pdfa/ns/id/\">\n" +
|
||||
" <pdfaid:part>3</pdfaid:part>\n" +
|
||||
" <pdfaid:conformance>B</pdfaid:conformance>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\">\n" +
|
||||
" <xmp:CreateDate>2014-07-11T13:39:46+02:00</xmp:CreateDate>\n" +
|
||||
" <xmp:ModifyDate>2014-07-11T13:39:46+02:00</xmp:ModifyDate>\n" +
|
||||
" <xmp:CreatorTool>zugferd_invoice.java</xmp:CreatorTool>\n" +
|
||||
" <xmp:MetadataDate>2014-07-11T13:39:46+02:00</xmp:MetadataDate>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\">\n" +
|
||||
" <pdf:Producer>PDFlib Personalization Server 9.0.3 (JDK 1.6/Mac OS X-10.6 64)</pdf:Producer>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" <rdf:Description rdf:about=\"\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n" +
|
||||
" <dc:title>\n" +
|
||||
" <rdf:Alt>\n" +
|
||||
" <rdf:li xml:lang=\"x-default\">ZUGFeRD Rechnung $Revision: 1.13 $</rdf:li>\n" +
|
||||
" </rdf:Alt>\n" +
|
||||
" </dc:title>\n" +
|
||||
" </rdf:Description>\n" +
|
||||
" </rdf:RDF>\n" +
|
||||
" </x:xmpmeta>\n" +
|
||||
"<?xpacket end=\"r\"?>", zi.getXMP());
|
||||
// this resembles the data written in MustangReaderWriterCustomXMLTest
|
||||
assertEquals(amount, "1005.55");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void testMigratePDFA1ToA3() throws IOException {
|
||||
@@ -505,7 +504,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.disableAutoClose(true);
|
||||
@@ -553,8 +552,8 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
}
|
||||
|
||||
/**
|
||||
* @Test(expected = IndexOutOfBoundsException.class)
|
||||
* @throws Exception
|
||||
* @Test(expected = IndexOutOfBoundsException.class)
|
||||
*/
|
||||
public void testExceptionOnPDF14() throws Exception {
|
||||
|
||||
@@ -565,7 +564,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDF14.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -16,13 +16,7 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.*;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.Charset;
|
||||
@@ -32,28 +26,35 @@ import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
|
||||
/** This test utility class is providing usability functions for test file resources */
|
||||
/**
|
||||
* This test utility class is providing usability functions for test file resources
|
||||
*/
|
||||
public class ResourceUtilities {
|
||||
private static final Logger LOG = Logger.getLogger(ResourceUtilities.class.getName());
|
||||
private static final Logger LOG = Logger.getLogger(ResourceUtilities.class.getName());
|
||||
|
||||
/** Loading a File into a String using a certain encoding and file path */
|
||||
public static String readFile(Charset encoding, String path) throws IOException {
|
||||
byte[] content = Files.readAllBytes(Paths.get(path));
|
||||
return new String(content, encoding);
|
||||
}
|
||||
/**
|
||||
* Loading a File into a String using a certain encoding and file path
|
||||
*/
|
||||
public static String readFile(Charset encoding, String path) throws IOException {
|
||||
byte[] content = Files.readAllBytes(Paths.get(path));
|
||||
return new String(content, encoding);
|
||||
}
|
||||
|
||||
/** Saving a String as a file to a certain file path */
|
||||
public static void saveFile(Charset encoding, String path, String content) throws FileNotFoundException {
|
||||
/**
|
||||
* Saving a String as a file to a certain file path
|
||||
*/
|
||||
public static void saveFile(Charset encoding, String path, String content) throws FileNotFoundException {
|
||||
|
||||
// resources will be released automatically
|
||||
try (PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(new File(path)), encoding), true)) {
|
||||
out.println(content);
|
||||
}
|
||||
}
|
||||
// resources will be released automatically
|
||||
try (PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(new File(path)), encoding), true)) {
|
||||
out.println(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** The relative path of the test file will be resolved and the absolute will be returned
|
||||
/**
|
||||
* The relative path of the test file will be resolved and the absolute will be returned
|
||||
*
|
||||
* @param relativeFilePath Path of the test resource relative to <code>src/test/resource/</code>.
|
||||
* @return the absolute path of the test file
|
||||
* @throws FileNotFoundException If the file could not be found
|
||||
@@ -72,7 +73,9 @@ public class ResourceUtilities {
|
||||
return uri.getPath();
|
||||
}
|
||||
|
||||
/** The relative path of the test file will be resolved and the absolute will be returned
|
||||
/**
|
||||
* The relative path of the test file will be resolved and the absolute will be returned
|
||||
*
|
||||
* @param relativeFilePath Path of the test resource relative to <code>src/test/resource/</code>.
|
||||
* @return the URI created based on the relativeFilePath
|
||||
* @throws URISyntaxException if no URI could be created from the given relative path
|
||||
@@ -83,19 +86,23 @@ public class ResourceUtilities {
|
||||
return new URI(filePath);
|
||||
}
|
||||
|
||||
/** The relative path of the test file will be used to determine an absolute
|
||||
* path to a temporary directory in the output directory.
|
||||
/**
|
||||
* The relative path of the test file will be used to determine an absolute
|
||||
* path to a temporary directory in the output directory.
|
||||
*
|
||||
* @param relativeFilePath Path of the test resource relative to <code>src/test/resource/</code>.
|
||||
* @return absolute path to a test output
|
||||
* @throws IOException if no absolute Path could be created.
|
||||
*/
|
||||
public static String getTestOutput(String relativeFilePath) throws IOException {
|
||||
File tempFile=File.createTempFile(relativeFilePath, null);
|
||||
File tempFile = File.createTempFile(relativeFilePath, null);
|
||||
tempFile.deleteOnExit();
|
||||
return tempFile.getAbsolutePath();
|
||||
}
|
||||
|
||||
/** The Input of the test file will be resolved and the absolute will be returned
|
||||
/**
|
||||
* The Input of the test file will be resolved and the absolute will be returned
|
||||
*
|
||||
* @param relativeFilePath Path of the test resource relative to <code>src/test/resource/</code>.
|
||||
* @return the absolute path of the test file
|
||||
*/
|
||||
@@ -103,7 +110,9 @@ public class ResourceUtilities {
|
||||
return ResourceUtilities.class.getClassLoader().getResourceAsStream(relativeFilePath);
|
||||
}
|
||||
|
||||
/** Relative to the test output directory a test file will be returned dependent on the relativeFilePath provided.
|
||||
/**
|
||||
* Relative to the test output directory a test file will be returned dependent on the relativeFilePath provided.
|
||||
*
|
||||
* @param relativeFilePath Path of the test output resource relative to <code>target/test-classes/</code>.
|
||||
* @return the empty <code>File</code> of the test output (to be filled)
|
||||
*/
|
||||
@@ -133,17 +142,17 @@ public class ResourceUtilities {
|
||||
public static File getTempTestDirectory() {
|
||||
File tempDir = new File(ResourceUtilities.getTestOutputFolder() + "temp");
|
||||
tempDir.mkdir(); //if it already exist no problem
|
||||
return tempDir;
|
||||
return tempDir;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* To fix the 3 slashes bug for File URI: For example:
|
||||
* file:/C:/work/test.txt -> file:///C:/work/test.txt
|
||||
*
|
||||
* @param u - the File URI
|
||||
* @return the String of the URI
|
||||
*/
|
||||
public static String toExternalForm(URI u) {
|
||||
public static String toExternalForm(URI u) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (u.getScheme() != null) {
|
||||
sb.append(u.getScheme());
|
||||
@@ -186,13 +195,14 @@ public class ResourceUtilities {
|
||||
sb.append(u.getFragment());
|
||||
}
|
||||
String ret = null;
|
||||
try {
|
||||
ret = new URI(sb.toString()).toASCIIString();
|
||||
} catch (URISyntaxException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
try {
|
||||
ret = new URI(sb.toString()).toASCIIString();
|
||||
} catch (URISyntaxException ex) {
|
||||
LOG.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
private ResourceUtilities() {
|
||||
}
|
||||
|
||||
private ResourceUtilities() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,20 +16,24 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Scanner;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.xmlunit.builder.DiffBuilder;
|
||||
import org.xmlunit.diff.Diff;
|
||||
|
||||
import javax.xml.transform.TransformerException;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
||||
|
||||
/**
|
||||
@@ -37,18 +41,18 @@ import org.junit.runners.Parameterized;
|
||||
* will be migrated to <code>src/test/resources/migration/output</code>.
|
||||
* If there is a similar named file as test reference <code>src/test/resources/migration/reference</code> a test
|
||||
* will be triggered for every single file.
|
||||
*
|
||||
* <p/>
|
||||
* Note: Any 'ZUGFeRD1' will be exchanged to 'ZUGFeRD2' during migration and adequate reference will be searched for.
|
||||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
public class VersionMigrationTest {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(VersionMigrationTest.class.getName());
|
||||
private static final Logger LOG = Logger.getLogger(VersionMigrationTest.class.getName());
|
||||
|
||||
private static final String INPUT_DIR = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "migration" + File.separator + "input" + File.separator;
|
||||
private static final String REFERENCE_DIR = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "migration" + File.separator + "reference" + File.separator;
|
||||
private static final String OUTPUT_DIR = "target" + File.separator + "test-classes" + File.separator + "migration" + File.separator + "output" + File.separator;
|
||||
private File mTestFile = null;
|
||||
private static final String INPUT_DIR = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "migration" + File.separator + "input" + File.separator;
|
||||
private static final String REFERENCE_DIR = "src" + File.separator + "test" + File.separator + "resources" + File.separator + "migration" + File.separator + "reference" + File.separator;
|
||||
private static final String OUTPUT_DIR = "target" + File.separator + "test-classes" + File.separator + "migration" + File.separator + "output" + File.separator;
|
||||
private File mTestFile = null;
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpBeforeClass() throws Exception {
|
||||
@@ -68,77 +72,45 @@ public class VersionMigrationTest {
|
||||
}
|
||||
|
||||
private static void addFilesFromFolder(final File folder, Collection<Object[]> testSuiteData) {
|
||||
String filePath = null;
|
||||
for (final File fileEntry : folder.listFiles()) {
|
||||
filePath = fileEntry.getAbsolutePath();
|
||||
if (fileEntry.isDirectory()) {
|
||||
for (final File fileEntry : folder.listFiles()) {
|
||||
String filePath = fileEntry.getAbsolutePath();
|
||||
if (fileEntry.isDirectory()) {
|
||||
LOG.log(Level.INFO, "*** testDirectory:{0}", filePath);
|
||||
addFilesFromFolder(fileEntry, testSuiteData);
|
||||
} else {
|
||||
LOG.log(Level.INFO, "*** testFile: {0}", filePath);
|
||||
Object[] testData = new Object[]{fileEntry};
|
||||
testSuiteData.add(testData);
|
||||
LOG.log(Level.INFO, "*** testFile: {0}", filePath);
|
||||
Object[] testData = new Object[]{fileEntry};
|
||||
testSuiteData.add(testData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
/**
|
||||
* ZUGFeRD 1.0 to 2.0 migration test.
|
||||
* For more information see class description. */
|
||||
/**
|
||||
* ZUGFeRD 1.0 to 2.0 migration test.
|
||||
* For more information see class description. */
|
||||
public void testFile() {
|
||||
testMigration(mTestFile.getName());
|
||||
testMigration(mTestFile.getName());
|
||||
}
|
||||
|
||||
private void testMigration(String fileName) {
|
||||
try {
|
||||
String tmp = new ZUGFeRDMigrator().migrateFromV1ToV2(INPUT_DIR + fileName);
|
||||
String newName = fileName.replace("ZUGFeRD1", "ZUGFeRD2");
|
||||
ResourceUtilities.saveFile(StandardCharsets.UTF_8, OUTPUT_DIR + newName, tmp);
|
||||
if(new File(REFERENCE_DIR + newName).exists()){
|
||||
// we need to save the string and reload it otherwise two bytes are missing (likely EOF related)
|
||||
String outXML = ResourceUtilities.readFile(StandardCharsets.UTF_8, OUTPUT_DIR + newName);
|
||||
String refXML = ResourceUtilities.readFile(StandardCharsets.UTF_8, REFERENCE_DIR + newName);
|
||||
int t = outXML.length();
|
||||
int r = refXML.length();
|
||||
if (t != r || !(outXML.equals(refXML))) {
|
||||
LOG.info("There are differences between:"
|
||||
+ "\nZUGFeRD 2.0 Test Output @ " + OUTPUT_DIR + newName
|
||||
+ "\nZUGFeRD 2.0 Test Reference @ " + REFERENCE_DIR + newName);
|
||||
LOG.info("\n\nFile sizes:\n "
|
||||
+ "\nZUGFeRD 2.0 Test Output character count: " + t
|
||||
+ "\nZUGFeRD 2.0 Test Refer. character count: " + r);
|
||||
findLineDiffs(outXML, refXML);
|
||||
Assert.fail("Version update failed, as test result and reference are different!");
|
||||
}else{
|
||||
LOG.log(Level.INFO,"\n*** Tested successfull migration from ZUGFeRD 1.0 to 2.0: '" + newName + "'' ***\n", OUTPUT_DIR);
|
||||
}
|
||||
}else{
|
||||
LOG.log(Level.INFO,"\n*** Migrated from ZUGFeRD 1.0 to 2.0 invoice: '" + newName + "'' ***\n", OUTPUT_DIR);
|
||||
}
|
||||
} catch (IOException | TransformerException t) {
|
||||
LOG.log(Level.SEVERE, t.getMessage(), t);
|
||||
Assert.fail("Failed with " + t.getClass().getName() + ": '" + t.getMessage() + "'");
|
||||
}
|
||||
}
|
||||
private void testMigration(String fileName) {
|
||||
try {
|
||||
String tmp = new ZUGFeRDMigrator().migrateFromV1ToV2(INPUT_DIR + fileName);
|
||||
String newName = fileName.replace("ZUGFeRD1", "ZUGFeRD2");
|
||||
ResourceUtilities.saveFile(StandardCharsets.UTF_8, OUTPUT_DIR + newName, tmp);
|
||||
if (new File(REFERENCE_DIR + newName).exists()) {
|
||||
// we need to save the string and reload it otherwise two bytes are missing (likely EOF related)
|
||||
String outXML = ResourceUtilities.readFile(StandardCharsets.UTF_8, OUTPUT_DIR + newName);
|
||||
String refXML = ResourceUtilities.readFile(StandardCharsets.UTF_8, REFERENCE_DIR + newName);
|
||||
Diff myDiff = DiffBuilder.compare(refXML).withTest(outXML).checkForSimilar().ignoreComments().ignoreWhitespace().build();
|
||||
assertFalse(myDiff.toString(), myDiff.hasDifferences());
|
||||
} else {
|
||||
LOG.log(Level.INFO, "\n*** Migrated from ZUGFeRD 1.0 to 2.0 invoice: '" + newName + "'' ***\n", OUTPUT_DIR);
|
||||
}
|
||||
} catch (IOException | TransformerException t) {
|
||||
LOG.log(Level.SEVERE, t.getMessage(), t);
|
||||
Assert.fail("Failed with " + t.getClass().getName() + ": '" + t.getMessage() + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static void findLineDiffs(String outXML, String refXML){
|
||||
Scanner outScanner = new Scanner(outXML);
|
||||
Scanner refScanner = new Scanner(refXML);
|
||||
String outLine = null;
|
||||
String refLine = null;
|
||||
while (outScanner.hasNextLine() && refScanner.hasNextLine()) {
|
||||
outLine = outScanner.nextLine();
|
||||
refLine = refScanner.nextLine();
|
||||
if(!outLine.equals(refLine)){
|
||||
LOG.info("First line difference between reference and output file:" +
|
||||
"\nRefLine: " + refLine +
|
||||
"\nOutLine: " + outLine + "\n");
|
||||
}
|
||||
}
|
||||
refScanner.close();
|
||||
outScanner.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,56 +18,57 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import org.junit.Test;
|
||||
import org.mustangproject.ZUGFeRD.model.CrossIndustryDocumentType;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
public class ZUGFeRDTransactionModelConverterTest {
|
||||
@Test
|
||||
public void convertToModel_convertsMinimalTransactionToValidXml() throws Exception {
|
||||
// setup
|
||||
IZUGFeRDExportableTransaction transaction = new IZUGFeRDExportableTransactionImpl()
|
||||
.setIssueDate(createDate(2000, 1, 1))
|
||||
.setDeliveryDate(createDate(2000, 1, 2))
|
||||
.setDueDate(createDate(2000, 1, 3))
|
||||
.setNumber("num")
|
||||
.setRecipient(new IZUGFeRDExportableContactImpl()
|
||||
.setName("recipient name")
|
||||
.setStreet("recipient street")
|
||||
.setLocation("recipient city")
|
||||
.setCountry("recipient country")
|
||||
)
|
||||
.setOwnOrganisationName("own org")
|
||||
.setOwnStreet("own street")
|
||||
.setOwnCountry("own country")
|
||||
.setOwnLocation("own city")
|
||||
.setOwnBankName("own bank")
|
||||
.setZFItems(
|
||||
new IZUGFeRDExportableItemImpl()
|
||||
.setProduct(new IZUGFeRDExportableProductImpl()
|
||||
.setVatPercent(new BigDecimal("1.19"))
|
||||
.setName("product name")
|
||||
.setDescription("product description")
|
||||
.setUnit("product unit")
|
||||
)
|
||||
.setQuantity(BigDecimal.ONE)
|
||||
.setPrice(BigDecimal.TEN)
|
||||
);
|
||||
@Test
|
||||
public void convertToModel_convertsMinimalTransactionToValidXml() throws Exception {
|
||||
// setup
|
||||
IZUGFeRDExportableTransaction transaction = new IZUGFeRDExportableTransactionImpl()
|
||||
.setIssueDate(createDate(2000, 1, 1))
|
||||
.setDeliveryDate(createDate(2000, 1, 2))
|
||||
.setDueDate(createDate(2000, 1, 3))
|
||||
.setNumber("num")
|
||||
.setRecipient(new IZUGFeRDExportableContactImpl()
|
||||
.setName("recipient name")
|
||||
.setStreet("recipient street")
|
||||
.setLocation("recipient city")
|
||||
.setCountry("recipient country")
|
||||
)
|
||||
.setOwnOrganisationName("own org")
|
||||
.setOwnStreet("own street")
|
||||
.setOwnCountry("own country")
|
||||
.setOwnLocation("own city")
|
||||
.setOwnBankName("own bank")
|
||||
.setZFItems(
|
||||
new IZUGFeRDExportableItemImpl()
|
||||
.setProduct(new IZUGFeRDExportableProductImpl()
|
||||
.setVatPercent(new BigDecimal("1.19"))
|
||||
.setName("product name")
|
||||
.setDescription("product description")
|
||||
.setUnit("product unit")
|
||||
)
|
||||
.setQuantity(BigDecimal.ONE)
|
||||
.setPrice(BigDecimal.TEN)
|
||||
);
|
||||
|
||||
// execution
|
||||
final JAXBElement<CrossIndustryDocumentType> actual =
|
||||
new ZUGFeRDTransactionModelConverter(transaction).convertToModel();
|
||||
// execution
|
||||
final JAXBElement<CrossIndustryDocumentType> actual =
|
||||
new ZUGFeRDTransactionModelConverter(transaction).convertToModel();
|
||||
|
||||
// evaluation
|
||||
ZUGFeRDXMLAssert.assertValidZugferd(actual);
|
||||
}
|
||||
// evaluation
|
||||
ZUGFeRDXMLAssert.assertValidZugferd(actual);
|
||||
}
|
||||
|
||||
private static Date createDate(int year, int month, int day) {
|
||||
final GregorianCalendar calendar = new GregorianCalendar();
|
||||
calendar.set(year, month-1, day);
|
||||
return calendar.getTime();
|
||||
}
|
||||
private static Date createDate(int year, int month, int day) {
|
||||
final GregorianCalendar calendar = new GregorianCalendar();
|
||||
calendar.set(year, month - 1, day);
|
||||
return calendar.getTime();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,39 +18,39 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import com.helger.commons.state.EValidity;
|
||||
import com.helger.schematron.ISchematronResource;
|
||||
import com.helger.schematron.pure.SchematronResourcePure;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import org.junit.Assert;
|
||||
import org.mustangproject.ZUGFeRD.model.CrossIndustryDocumentType;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
|
||||
public class ZUGFeRDXMLAssert {
|
||||
private static final ISchematronResource SCHEMATRON = loadSchematron();
|
||||
private static final ISchematronResource SCHEMATRON = loadSchematron();
|
||||
|
||||
public static void assertValidZugferd(JAXBElement<CrossIndustryDocumentType> xml) throws Exception {
|
||||
assertValidZugferd(toDocument(xml));
|
||||
}
|
||||
public static void assertValidZugferd(JAXBElement<CrossIndustryDocumentType> xml) throws Exception {
|
||||
assertValidZugferd(toDocument(xml));
|
||||
}
|
||||
|
||||
public static void assertValidZugferd(Node xml) throws Exception {
|
||||
Assert.assertTrue("schema valid", SCHEMATRON.getSchematronValidity(xml, null).isValid());
|
||||
}
|
||||
public static void assertValidZugferd(Node xml) throws Exception {
|
||||
Assert.assertTrue("schema valid", SCHEMATRON.getSchematronValidity(xml, null).isValid());
|
||||
}
|
||||
|
||||
private static Document toDocument(Object jaxbElement) throws Exception {
|
||||
final Document result = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
JAXBContext.newInstance("org.mustangproject.ZUGFeRD.model").createMarshaller().marshal(jaxbElement, result);
|
||||
return result;
|
||||
}
|
||||
private static Document toDocument(Object jaxbElement) throws Exception {
|
||||
final Document result = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||
JAXBContext.newInstance("org.mustangproject.ZUGFeRD.model").createMarshaller().marshal(jaxbElement, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
private static SchematronResourcePure loadSchematron() {
|
||||
final SchematronResourcePure result = SchematronResourcePure.fromClassPath("/ZUGFeRD_1p0.scmt");
|
||||
if (!result.isValidSchematron ()) {
|
||||
throw new IllegalArgumentException("Invalid Schematron!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private static SchematronResourcePure loadSchematron() {
|
||||
final SchematronResourcePure result = SchematronResourcePure.fromClassPath("/ZUGFeRD_1p0.scmt");
|
||||
if (!result.isValidSchematron()) {
|
||||
throw new IllegalArgumentException("Invalid Schematron!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15" xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0">
|
||||
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0">
|
||||
<rsm:SpecifiedExchangedDocumentContext>
|
||||
<ram:TestIndicator>
|
||||
<udt:Indicator>false</udt:Indicator>
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15" xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0">
|
||||
<rsm:CrossIndustryDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15"
|
||||
xmlns:rsm="urn:ferd:CrossIndustryDocument:invoice:1p0">
|
||||
<rsm:SpecifiedExchangedDocumentContext>
|
||||
<ram:TestIndicator>
|
||||
<udt:Indicator>false</udt:Indicator>
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:Standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"><!--
|
||||
Migrated by Mustangproject XSLT
|
||||
--><rsm:ExchangedDocumentContext>
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
|
||||
<!--Migrated by Mustangproject XSLT-->
|
||||
<rsm:ExchangedDocumentContext>
|
||||
<ram:TestIndicator>
|
||||
<udt:Indicator>false</udt:Indicator>
|
||||
</ram:TestIndicator>
|
||||
@@ -28,7 +28,7 @@ Migrated by Mustangproject XSLT
|
||||
<ram:ID>urn:ferd:CrossIndustryDocument:invoice:1p0:extended</ram:ID>
|
||||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<rsm:ExchangedDocument xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:ID>RE-20170509/505</ram:ID>
|
||||
<ram:Name>RECHNUNG</ram:Name>
|
||||
<ram:TypeCode>380</ram:TypeCode>
|
||||
@@ -36,16 +36,16 @@ Migrated by Mustangproject XSLT
|
||||
<udt:DateTimeString format="102">20170509</udt:DateTimeString>
|
||||
</ram:IssueDateTime>
|
||||
</rsm:ExchangedDocument>
|
||||
<rsm:SupplyChainTradeTransaction xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<rsm:SupplyChainTradeTransaction xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100">
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>1</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Künstlerische Gestaltung (Stunde): Einer Beispielrechnung</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">160.0000</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
|
||||
@@ -55,10 +55,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="HUR">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="HUR">1.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -68,16 +68,16 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">160.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>2</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Luftballon: Bunt, ca. 500ml</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">0.7900</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="C62">1.0000</ram:BasisQuantity>
|
||||
@@ -87,10 +87,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="C62">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="C62">400.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -100,16 +100,16 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">316.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>3</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Heiße Luft pro Liter</ram:Name>
|
||||
<ram:Description/>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:GrossPriceProductTradePrice>
|
||||
<ram:ChargeAmount currencyID="EUR">0.1000</ram:ChargeAmount>
|
||||
<ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
|
||||
@@ -119,10 +119,10 @@ Migrated by Mustangproject XSLT
|
||||
<ram:BasisQuantity unitCode="LTR">1.0000</ram:BasisQuantity>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="LTR">200.0000</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
@@ -132,8 +132,8 @@ Migrated by Mustangproject XSLT
|
||||
<ram:LineTotalAmount currencyID="EUR">20.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:SellerTradeParty>
|
||||
<ram:Name>Bei Spiel GmbH</ram:Name>
|
||||
<ram:PostalTradeAddress>
|
||||
@@ -162,14 +162,14 @@ Migrated by Mustangproject XSLT
|
||||
</ram:SpecifiedTaxRegistration>
|
||||
</ram:BuyerTradeParty>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ActualDeliverySupplyChainEvent>
|
||||
<ram:OccurrenceDateTime>
|
||||
<udt:DateTimeString format="102">20170507</udt:DateTimeString>
|
||||
</ram:OccurrenceDateTime>
|
||||
</ram:ActualDeliverySupplyChainEvent>
|
||||
</ram:ApplicableHeaderTradeDelivery>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:PaymentReference>RE-20170509/505</ram:PaymentReference>
|
||||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
@@ -215,6 +215,6 @@ Migrated by Mustangproject XSLT
|
||||
<ram:DuePayableAmount currencyID="EUR">571.04</ram:DuePayableAmount>
|
||||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
</ram:ApplicableHeaderTradeSettlement>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:CrossIndustryInvoice>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user