310
History.md
310
History.md
@@ -1,32 +1,77 @@
|
||||
2.0 todo
|
||||
- verapdf as prevalidation
|
||||
- remove jaxb
|
||||
- visualization?
|
||||
- factory for xrechnung
|
||||
- new sample innvoice
|
||||
- complete or discard read into push provider
|
||||
- validate as library doc
|
||||
- javadoc export
|
||||
- prompt for source file for validation has to be pdf
|
||||
- be able to disable "source pdf set to timeout"
|
||||
- automated tests zuv/verapdf validate created library test files
|
||||
- unify loggers
|
||||
done
|
||||
- 2.1 now default
|
||||
## 2.0
|
||||
### done
|
||||
|
||||
- support for ZF 2.1.1, i.e. "Reference profile" Xrechnung
|
||||
- ZF 2.1.1 now default (up to 1.7.8 ZF2 could be set but ZF1 was default)
|
||||
- removed jaxb
|
||||
- pushprovider
|
||||
- new xrechnung profile
|
||||
- visualization? zugferdvisualizer?
|
||||
- german bank account numbers can no longer be specified (dropped in favor of IBAN and BIC)
|
||||
- factory for xrechnung
|
||||
- moved to Maven central
|
||||
- complete or discard read into push provider
|
||||
- integrates validator
|
||||
- validator now additionally supports xrechnung
|
||||
- integrates mustangserver
|
||||
- modular project setup
|
||||
- getSellerTradePartyAddress (PR #157 ) thanks to aberndt-hub
|
||||
- switched from eclipse to IntelliJ
|
||||
- added ph-schematron-maven-plugin so that xrechnung xslt can be generated
|
||||
- remove migration
|
||||
- removed migration feature (XSLT upgrade of ZF1)
|
||||
- be able to recursively validate directories
|
||||
- be able to ignore input pdf errors with -i
|
||||
- be able to recursively scan directories using validateExpectValid/validateExpectInvalid
|
||||
- upgraded to verapdf 1.16.1
|
||||
- support to validate XRechnung 2.0
|
||||
- added Ghostscript signature
|
||||
- removal of izugferddate/IZUGFeRDPaymentTerms,IZUGFeRDPaymentDiscountTerms
|
||||
switch
|
||||
- change from ZUGFeRDExporter to IZUGFeRDExporter
|
||||
- switch recipient, shipping address from contact to tradeparty
|
||||
- switch from profiles to profile
|
||||
- javadoc export
|
||||
- have visualizer
|
||||
- validate as library doc
|
||||
- unify loggers
|
||||
- release notes
|
||||
- new tradeparty class, Contact getOwnContact superseded by TradeParty getSender
|
||||
- new invoicecorrection class
|
||||
- order-x xml read support
|
||||
- automated tests zuv/verapdf validate created library test files
|
||||
- trans.getTradeSettlementPayment() removed in favor of trans.getTradeSettlement()
|
||||
- commandline option for no notices
|
||||
- new features
|
||||
- additional docs,
|
||||
- contract id,
|
||||
- delivery period,
|
||||
- corrected invoices,
|
||||
- contacts also for recipients
|
||||
- absolute and relative allowances and charges on item and document level,
|
||||
- support contact fax numbers
|
||||
|
||||
1.7.7
|
||||
### 2.0 still todo
|
||||
- dont show empty tax number field
|
||||
- new sample invoice
|
||||
- *visualizer to work with Extended profile
|
||||
- *visualizer tests
|
||||
- *validator not to XR error on ZF files (only notices)
|
||||
- *from A3 does not seem tow ork see mustangreaderwriteredgetest:testedgeexport
|
||||
- xmp errors may not show correctly in log
|
||||
- confirm correct generation from pdf/a3 files zf2edgetest
|
||||
- *correctiontest exports zf1+zf2?
|
||||
- *USt 0% wird aus invoice-klasse noch nicht sauber abgefangen
|
||||
- finalize invoiceimporter
|
||||
Alpha3 2020-10-24
|
||||
Alpha2 2020-09-15
|
||||
Alpha1 2020-08-06
|
||||
|
||||
Mustangproject 1.7.8
|
||||
=====
|
||||
2020-06-14
|
||||
- corrected ZF2 gross price
|
||||
|
||||
|
||||
Mustangproject 1.7.7
|
||||
=====
|
||||
2020-05-26
|
||||
|
||||
@@ -35,7 +80,30 @@ done
|
||||
- #148 support additional documents for items
|
||||
- #154 german VAT ID may not be used for sellercontact scheme id
|
||||
|
||||
1.7.6
|
||||
Validator 0.9.0
|
||||
=====
|
||||
2020-03-24
|
||||
|
||||
- ZF 2.1 Schema/Schematrons
|
||||
- check against URI allowing for different fragments
|
||||
- #27 wrong exit code
|
||||
- now context also loggs
|
||||
- introduced fatal errors. new errors: filename empty (10), xml not extractable (17), En16931 CEN Schematron error (24)
|
||||
- fail better if -f missing
|
||||
- validate against CEN 1.3
|
||||
- corrected invalidation of complete output status for broken pdfs
|
||||
- mention filename in report
|
||||
- escape xml in report elements, e.g. < in criterion to become <
|
||||
- validation element has been removed from pdf info and added as attribute in root, duration is now direct child of info
|
||||
- file not found and file too small now without filename
|
||||
- XML pretty print output. (XML report may now contain header <?xml...)
|
||||
- First XMLUnit tests
|
||||
- Better Check of XML Validity also against documents which start with comments or not with xml header <?xml...
|
||||
- prevent accidental CEN EN16931 application on extended profile
|
||||
- solved issues when XML structures start with comments instead of root node
|
||||
- added Symtrax signature
|
||||
|
||||
Mustangproject 1.7.6
|
||||
=====
|
||||
2020-02-06
|
||||
|
||||
@@ -45,7 +113,7 @@ done
|
||||
- allow different currencies also for ZF2 (#150)
|
||||
- minor correction VAT exemptions
|
||||
|
||||
1.7.5
|
||||
Mustangproject 1.7.5
|
||||
=====
|
||||
2019-11-05
|
||||
|
||||
@@ -56,7 +124,31 @@ done
|
||||
- corrected RDF metadata for ZF2
|
||||
- default conformance level now EN16931, not extended
|
||||
|
||||
1.7.4
|
||||
Validator 0.8.3
|
||||
=====
|
||||
2019-10-20
|
||||
|
||||
- #22 rounding errors when applying schematron
|
||||
- check for 1.0 or 2p0 in RDF, not 1.0 and 2.0 like before
|
||||
- updated to zf 2.0.1
|
||||
|
||||
Validator 0.8.2
|
||||
=====
|
||||
2019-10-10
|
||||
|
||||
- #22 rounding errors when applying schematron
|
||||
|
||||
Validator 0.8.1
|
||||
=====
|
||||
2019-09-01
|
||||
|
||||
- added Signature pdfMachine
|
||||
- added check for additional data correctness
|
||||
- #23 ZF2 basic was incorrectly checked against Minimum/Basic Without lines Schema/Schematron
|
||||
- Merged -x and -z to -f
|
||||
- Created ZUGFeRDValidatorClass and MiscValidatorTests for e.g. tests without existing files
|
||||
|
||||
Mustangproject 1.7.4
|
||||
=====
|
||||
2019-08-24
|
||||
|
||||
@@ -67,7 +159,7 @@ done
|
||||
- #132 Mustangproject does not work w/ Java 11
|
||||
|
||||
|
||||
1.7.3
|
||||
Mustangproject 1.7.3
|
||||
=====
|
||||
2019-08-01
|
||||
|
||||
@@ -80,93 +172,149 @@ done
|
||||
- have unit tests for nDigitFormat #23
|
||||
|
||||
|
||||
1.7.2
|
||||
Mustangproject 1.7.2
|
||||
=====
|
||||
2019-07-08
|
||||
|
||||
Support BuyerReference (r+w), as well as SpecifiedLegalOrganization (w) and DefinedTradeContact (w)
|
||||
use dom4j to format output xml document
|
||||
corrected some exception logging glitches
|
||||
upgrade PDFBox to 2.0.15+
|
||||
extraction to use proper filename instead of alias #98
|
||||
NullPointerException in ZUGFeRDImporter.extractLowLevel #96
|
||||
Removed Bankleitzahl from ZF2
|
||||
- Support BuyerReference (r+w), as well as SpecifiedLegalOrganization (w) and DefinedTradeContact (w)
|
||||
- use dom4j to format output xml document
|
||||
- corrected some exception logging glitches
|
||||
- upgrade PDFBox to 2.0.15+
|
||||
- extraction to use proper filename instead of alias #98
|
||||
- NullPointerException in ZUGFeRDImporter.extractLowLevel #96
|
||||
- Removed Bankleitzahl from ZF2
|
||||
|
||||
Validator 0.8.0
|
||||
=====
|
||||
2019-07-08
|
||||
|
||||
1.7.1
|
||||
- updated Mustang to mitigate #20 zf1 validation does not always return a section
|
||||
- validate not only against schematron but also against schema files
|
||||
|
||||
Validator 0.7.0
|
||||
=====
|
||||
2019-05-31
|
||||
|
||||
- ZUGFeRD 2 final compatible
|
||||
- now displaying number of applied and failed rules
|
||||
- now failing if no rule could be applied at all
|
||||
- profileoverride option no longer needed
|
||||
- version dependent checks for profiles (i.e. comfort is not a valid ZF2 profile!)
|
||||
- allow new ZF2 filename (zugferd-invoice.xml instead ZUGFeRD-invoice.xml)
|
||||
- more JUnit tests
|
||||
- include own version number in XML report
|
||||
|
||||
Mustangproject 1.7.1
|
||||
=====
|
||||
2019-05-26
|
||||
|
||||
Corrected EN16931 ZF2 profile name
|
||||
|
||||
1.7.0
|
||||
Mustangproject 1.7.0
|
||||
=====
|
||||
2019-05-05
|
||||
|
||||
Export ZF2 final now seems halfway valid (new filename, new namespace prefixa)
|
||||
Migrates profile names in ZF1 to ZF2 migration
|
||||
Nullpointerex solved with certain invalid profiles
|
||||
Be able to access additional files ("additional data")
|
||||
Known bugs: src/test/resources/migration/reference/ZUGFeRD2_EXTENDED_Warenrechnung.xml is invalid
|
||||
- Export ZF2 final now seems halfway valid (new filename, new namespace prefixa)
|
||||
- Migrates profile names in ZF1 to ZF2 migration
|
||||
- Nullpointerex solved with certain invalid profiles
|
||||
- Be able to access additional files ("additional data")
|
||||
- Known bugs: src/test/resources/migration/reference/ZUGFeRD2_EXTENDED_Warenrechnung.xml is invalid
|
||||
|
||||
Validator 0.6.0
|
||||
=====
|
||||
2019-02-15
|
||||
|
||||
Factur-X compatible Mention xpath location where the errors occurred JUnit tests new way to collect&handle errors XMP/PDF-A-Schema extension validation
|
||||
|
||||
|
||||
1.6.0
|
||||
Mustangproject 1.6.0
|
||||
=====
|
||||
2019-02-03
|
||||
|
||||
Closes #69.
|
||||
Corrected EN 16931 XMP Schema Extension header
|
||||
Can now read xmp metadata via ZUGFeRDImporter getXMP
|
||||
Exporting valid EN16931 Factur-X when version/profile set to 2/EN16931 mode
|
||||
- Closes #69.
|
||||
- Corrected EN 16931 XMP Schema Extension header
|
||||
- Can now read xmp metadata via ZUGFeRDImporter getXMP
|
||||
- Exporting valid EN16931 Factur-X when version/profile set to 2/EN16931 mode
|
||||
|
||||
|
||||
1.5.5
|
||||
Mustangproject 1.5.5
|
||||
=====
|
||||
2018-10-22
|
||||
|
||||
Fixes by Indigo744: Issues #66 Commandline: provide a way to set input parameters and #68 Combine with ZUGFeRD v2: NullPointerException
|
||||
Fixes #63 PDF/A3 conversion not valid.
|
||||
- Fixes by Indigo744: Issues #66 Commandline: provide a way to set input parameters and #68 Combine with ZUGFeRD v2: NullPointerException
|
||||
- Fixes #63 PDF/A3 conversion not valid.
|
||||
|
||||
1.5.4
|
||||
Validator 0.5.0
|
||||
=====
|
||||
2018-09-10
|
||||
|
||||
- Non-16931 profiles are no longer automatically (but still can be manually) checked
|
||||
- now writing a log file
|
||||
- attempt to find out which toolkit created that particular file (issue #2)
|
||||
- fixing that XML could not be extracted from certain valid PDF/A-3 files (issue #9)
|
||||
- added --action parameter (has to be validate)
|
||||
- -f option changes to "-o -z"
|
||||
- added APL license
|
||||
- added possibility to check XML files only
|
||||
- fixing issues with files that contained a UTF8 BOM in the XML content ("Content not allowed in prolog")
|
||||
- Upgraded VeraPDF-validation from 1.10.5 to 1.12.1
|
||||
|
||||
Mustangproject 1.5.4
|
||||
=====
|
||||
2018-08-29
|
||||
|
||||
Fixed #62 fail gracefully on commandline extraction of XML if none is present.
|
||||
New public function: ZUGFeRDImporter.getUTF8 returns raw XML without Byte Order Mark, if one had been used.
|
||||
- Fixed #62 fail gracefully on commandline extraction of XML if none is present.
|
||||
- New public function: ZUGFeRDImporter.getUTF8 returns raw XML without Byte Order Mark, if one had been used.
|
||||
|
||||
1.5.3
|
||||
Mustangproject 1.5.3
|
||||
=====
|
||||
2018-07-20
|
||||
|
||||
Fixed #60 nullpointerexception in ZUGFeRDimporter on some input files
|
||||
and #61 missing in maven repo
|
||||
Now possible to skip parse() and go from zi.extract to e.g. zi.getAmount()
|
||||
- Fixed #60 nullpointerexception in ZUGFeRDimporter on some input files
|
||||
- and #61 missing in maven repo
|
||||
- Now possible to skip parse() and go from zi.extract to e.g. zi.getAmount()
|
||||
|
||||
|
||||
|
||||
1.5.2
|
||||
Mustangproject 1.5.2
|
||||
=====
|
||||
2018-06-10
|
||||
|
||||
Fixed #57 commandline not converting PDF from A1 to A3 when adding XML to PDF (-c)
|
||||
|
||||
1.5.1
|
||||
Validator 0.4.3
|
||||
=====
|
||||
2018-03-19
|
||||
|
||||
Java 8 capability (fixes issue #8)
|
||||
|
||||
Validator 0.4.2
|
||||
=====
|
||||
2018-03-11
|
||||
|
||||
POJO embedding VeraPDF: unable to solve some severe deployment issues
|
||||
|
||||
Validator 0.4.1
|
||||
=====
|
||||
2018-02-12
|
||||
|
||||
ZUGFeRD 2 public preview EN16931 validation using the schematron files the CEN had published under APL
|
||||
|
||||
Mustangproject 1.5.1
|
||||
=====
|
||||
2018-01-13
|
||||
|
||||
Fixed a major issue with the Maven repository (thanks to Markus Plangg, https://github.com/ZUGFeRD/mustangproject/issues/52)
|
||||
|
||||
1.5.0
|
||||
Mustangproject 1.5.0
|
||||
=====
|
||||
2017-11-30
|
||||
|
||||
Support for ZUGFeRD 2.0 "public review" part 1.
|
||||
Now using factories to create/configure ZUGFeRDExporter.
|
||||
Export is now also possible on OutputStream.
|
||||
Removed need to call PDFattachZugferdFile(null) or exporter close();
|
||||
More unit tests, e.g. for custom xml export, PDF/A Schema extensions.
|
||||
The command line utility "toecount" is now integrated and the main class so "java -jar mustang-1.5.0.jar" should suffice.
|
||||
It now also features options to combine PDF with XML and upgrade XML files from ZF1 to ZF2.
|
||||
- Support for ZUGFeRD 2.0 "public review" part 1.
|
||||
- Now using factories to create/configure ZUGFeRDExporter.
|
||||
- Export is now also possible on OutputStream.
|
||||
- Removed need to call PDFattachZugferdFile(null) or exporter close();
|
||||
- More unit tests, e.g. for custom xml export, PDF/A Schema extensions.
|
||||
- The command line utility "toecount" is now integrated and the main class so "java -jar mustang-1.5.0.jar" should suffice.
|
||||
- It now also features options to combine PDF with XML and upgrade XML files from ZF1 to ZF2.
|
||||
|
||||
First attempts be able to start with a PDF/A-3 in the first place and better error messages for non-PDF/A-conformance.
|
||||
|
||||
@@ -180,45 +328,59 @@ Further changes:
|
||||
* invalid a3 #44
|
||||
* warn on export #39
|
||||
|
||||
Validator 0.3.0
|
||||
=====
|
||||
2017-07-24
|
||||
|
||||
First release as VeraPDF plugin
|
||||
|
||||
1.4.0
|
||||
Mustangproject 1.4.0
|
||||
=====
|
||||
2017-05-11
|
||||
Switched to ZUGFeRD extended, new all-in-one jar including dependencies,
|
||||
switch to Apache PDFBox 2.0. Some bugfixes.
|
||||
|
||||
- Switched to ZUGFeRD extended, new all-in-one jar including dependencies,
|
||||
- switch to Apache PDFBox 2.0. Some bugfixes.
|
||||
Thanks to AlexanderSchmidt and yankee42.
|
||||
|
||||
1.3.1
|
||||
Mustangproject 1.3.1
|
||||
=====
|
||||
2016-06-01
|
||||
|
||||
1.3.0
|
||||
Mustangproject 1.3.0
|
||||
=====
|
||||
2016-03-15
|
||||
|
||||
Additional checks in the new version facilitate correct usage within your own applications. For example, input data (PDF/A-1) and the sequence of the calls are checked for accuracy.
|
||||
A community patch (thanks to Alexander Schmidt) improves the internal functioning and removes the last known bugs.
|
||||
|
||||
1.2.0
|
||||
Mustangproject 1.2.0
|
||||
=====
|
||||
2015-10-15
|
||||
|
||||
Compliance to GEFEG and ZUGFeRD Checker.
|
||||
|
||||
1.1.2
|
||||
Mustangproject 1.1.2
|
||||
=====
|
||||
2015-06-15
|
||||
|
||||
The ZUGFeRD-Metadata now conforms to more validators like the Konik Validation Service. As a new feature it is now also possible to create test invoices.
|
||||
|
||||
1.1.1
|
||||
Mustangproject 1.1.1
|
||||
=====
|
||||
2015-03-31
|
||||
|
||||
Maven and custom xml
|
||||
|
||||
1.1.0
|
||||
Mustangproject 1.1.0
|
||||
=====
|
||||
2014-12-07
|
||||
|
||||
ZUGFeRD 1.0
|
||||
|
||||
1.0.0
|
||||
Mustangproject 1.0.0
|
||||
=====
|
||||
2014-05-22
|
||||
|
||||
ZUGFeRD 1.0RC Comfort
|
||||
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<parent>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.zugferd</groupId>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>Mustang-CLI</artifactId>
|
||||
<name>Mustang commandline tool</name>
|
||||
<packaging>jar</packaging>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<!-- for jargs -->
|
||||
@@ -31,7 +31,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<!-- prototypes of new mustangproject versions can be installed by referring to them and installed to the local repo from a jar file with
|
||||
mvn install:install-file -Dfile=mustang-1.5.4-SNAPSHOT.jar -DgroupId=org.mustangproject.ZUGFeRD -DartifactId=mustang -Dversion=1.5.4 -Dpackaging=jar -DgeneratePom=true
|
||||
-->
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
@@ -163,12 +164,6 @@
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>com.sun.xml.bind:jaxb-core</artifact>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
||||
@@ -18,40 +18,35 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.commandline;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import com.sanityinc.jargs.CmdLineParser;
|
||||
import com.sanityinc.jargs.CmdLineParser.Option;
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
import org.mustangproject.validator.Validator;
|
||||
import org.mustangproject.validator.ZUGFeRDValidator;
|
||||
|
||||
import java.io.*;
|
||||
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.ZUGFeRDImporter;
|
||||
import org.mustangproject.validator.ZUGFeRDValidator;
|
||||
|
||||
/***
|
||||
* This is the command line interface to mustangproject
|
||||
*
|
||||
*/
|
||||
|
||||
import com.sanityinc.jargs.CmdLineParser;
|
||||
import com.sanityinc.jargs.CmdLineParser.Option;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.xml.transform.TransformerException;
|
||||
|
||||
public class Main {
|
||||
// build with: /opt/local/bin/mvn clean compile assembly:single
|
||||
private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(Validator.class.getCanonicalName()); // log output
|
||||
|
||||
private static void printUsage() {
|
||||
System.err.println(getUsage());
|
||||
}
|
||||
|
||||
private static String getUsage() {
|
||||
return "Usage: --action metrics|combine|extract|a3only|validate [-d,--directory] [-l,--listfromstdin] [-i,--ignore fileextension, PDF/A errors] | [-h,--help] \r\n"
|
||||
return "Usage: --action metrics|combine|extract|a3only|validate|visualize [-d,--directory] [-l,--listfromstdin] [-i,--ignore fileextension, PDF/A errors] | [-h,--help] \r\n"
|
||||
+ "* merics\n" + " -d, --directory count ZUGFeRD files in directory to be scanned\n"
|
||||
+ " If it is a directory, it will recurse.\n"
|
||||
+ " -l, --listfromstdin count ZUGFeRD files from a list of linefeed separated files on runtime.\n"
|
||||
@@ -60,59 +55,43 @@ public class Main {
|
||||
+ " [-i, --ignorefileextension] Check for all files (*.*) instead of PDF files only (*.pdf) in metrics, ignore PDF/A input file errors in combine\n"
|
||||
+ "\n" + "* Merge actions\n" + " extract extract ZUGFeRD PDF to XML file\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " [--source <filename>]: set input PDF file\n"
|
||||
+ " [--out <filename>]: set output XML file\n"
|
||||
+ " [--source=<filename>]: set input PDF file\n"
|
||||
+ " [--out=<filename>]: set output XML file\n"
|
||||
+ " a3only upgrade from PDF/A1 to A3 only (no ZUGFeRD data attached)\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " [--source <filename>]: set input PDF file\n"
|
||||
+ " [--out <filename>]: set output PDF file\n"
|
||||
+ " [--source=<filename>]: set input PDF file\n"
|
||||
+ " [--out=<filename>]: set output PDF file\n"
|
||||
+ " combine combine XML and PDF file to ZUGFeRD PDF file\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " [--source <filename>]: set input PDF file\n"
|
||||
+ " [--source-xml <filename>]: set input XML file\n"
|
||||
+ " [--out <filename>]: set output PDF file\n"
|
||||
+ " [--source=<filename>]: set input PDF file\n"
|
||||
+ " [--source-xml=<filename>]: set input XML file\n"
|
||||
+ " [--out=<filename>]: set output PDF file\n"
|
||||
+ " [--format <fx|zf>]: set ZUGFeRD or FacturX\n"
|
||||
+ " [--version <1|2>]: set ZUGFeRD version\n"
|
||||
+ " [--profile <...>]: set ZUGFeRD profile\n"
|
||||
+ " For ZUGFeRD v1: <B>ASIC, <C>OMFORT or <E>XTENDED\n"
|
||||
+ " For ZUGFeRD v2: <M>INIMUM, BASIC <W>L, <B>ASIC, <C>IUS, <E>N16931, E<X>TENDED "
|
||||
+ " For ZUGFeRD v1: <B>ASIC, <C>OMFORT or EX<T>ENDED\n"
|
||||
+ " For ZUGFeRD v2: <M>INIMUM, BASIC <W>L, <B>ASIC, <C>IUS, <E>N16931, <X>Rechnung, EX<T>ENDED "
|
||||
+ " validate validate XML or PDF file \n"
|
||||
+ " [--no-notices]: refrain from reporting notices\n"
|
||||
+ " [--logAppend=<text>]: text to be added to log line\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " [--source <filename>]: input PDF or XML file\n"
|
||||
+ " [--source=<filename>]: input PDF or XML file\n"
|
||||
+ " validateExpectValid validate directory expecting positive results \n"
|
||||
+ " [--no-notices]: refrain from reporting notices\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " -d, --directory to check recursively \n"
|
||||
+ " validateExpectInvalid validate directory expecting negative results \n"
|
||||
+ " [--no-notices]: refrain from reporting notices\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " -d, --directory to check recursively\n"
|
||||
+ " visualize convert XML to HTML \n"
|
||||
;
|
||||
}
|
||||
|
||||
private static void printHelp() {
|
||||
System.out.println("Mustangproject.org " + org.mustangproject.ZUGFeRD.Version.VERSION + " \r\n"
|
||||
+ "A Apache Public License library and command line tool for statistics on PDF invoices with\r\n"
|
||||
+ "ZUGFeRD Metadata (http://www.zugferd.org)\r\n" + "\r\n" + getUsage() + "\r\n"
|
||||
+ "* Count operations\r\n" + "\t-d, --directory\tcount ZUGFeRD files in directory to be scanned\r\n"
|
||||
+ "\t\tIf it is a directory, it will recurse.\r\n"
|
||||
+ "\t-l, --listfromstdin\tcount ZUGFeRD files from a list of linefeed separated files on runtime.\r\n"
|
||||
+ "\t\tIt will start once a blank line has been entered.\r\n" + "\r\n"
|
||||
+ "\tAdditional parameter for both count operations\r\n"
|
||||
+ "\t[-i, --ignorefileextension]\tCheck for all files (*.*) instead of PDF files only (*.pdf)\r\n"
|
||||
+ "\r\n" + "* Merge operations\r\n" + "\t-e, --extract\textract ZUGFeRD PDF to XML file\r\n"
|
||||
+ "\t\tAdditional parameters (optional - user will be prompted if not defined)\r\n"
|
||||
+ "\t\t[--source <filename>]: set input PDF file\r\n"
|
||||
+ "\t\t[--out <filename>]: set output XML file\r\n"
|
||||
+ "\t-u, --upgrade\tupgrade ZUGFeRD XML to ZUGFeRD 2 XML\r\n"
|
||||
+ "\t\tAdditional parameters (optional - user will be prompted if not defined)\r\n"
|
||||
+ "\t\t[--source <filename>]: set input XML ZUGFeRD 1 file\r\n"
|
||||
+ "\t\t[--out <filename>]: set output XML ZUGFeRD 2 file\r\n"
|
||||
+ "\t-a, --a3only\tupgrade from PDF/A1 to A3 only (no ZUGFeRD data attached) \r\n"
|
||||
+ "\t\tAdditional parameters (optional - user will be prompted if not defined)\r\n"
|
||||
+ "\t\t[--source <filename>]: set input PDF file\r\n"
|
||||
+ "\t\t[--out <filename>]: set output PDF file\r\n"
|
||||
+ "\t-c, --combine\tcombine XML and PDF file to ZUGFeRD PDF file\r\n"
|
||||
+ "\t\tAdditional parameters (optional - user will be prompted if not defined)\r\n"
|
||||
+ "\t\t[--source <filename>]: set input PDF file\r\n"
|
||||
+ "\t\t[--source-xml <filename>]: set input XML file\r\n"
|
||||
+ "\t\t[--out <filename>]: set output PDF file\r\n"
|
||||
+ "\t\t[--format <fx|zf>]: enable factur-x or ZUGFeRD\r\n"
|
||||
+ "\t\t[--version <1|2>]: set ZUGFeRD version\r\n" + "\t\t[--profile <...>]: set ZUGFeRD profile\r\n"
|
||||
+ "\t\t\tFor ZUGFeRD v1: <B>ASIC, <C>OMFORT or <E>XTENDED\r\n"
|
||||
+ "\t\t\tFor ZUGFeRD v2: <M>INIMUM, BASIC <W>L, <B>ASIC, <C>IUS, <E>N16931, EX<T>ENDED, <X>Rechnung\r\n");
|
||||
+ "A Apache Public License tool for e-invoices with\r\n"
|
||||
+ "ZUGFeRD Metadata (http://www.zugferd.org)\r\n" + "\r\n" + getUsage() + "\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +127,7 @@ public class Main {
|
||||
try {
|
||||
input = buffer.readLine();
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
|
||||
}
|
||||
|
||||
@@ -168,7 +147,7 @@ public class Main {
|
||||
*
|
||||
* @param prompt the text the user is asked
|
||||
* @param defaultFilename a default Filename
|
||||
* @param expectedExtension will warn if filename does not match expected file extension
|
||||
* @param expectedExtension will warn if filename does not match expected file extension, "or" possible with e.g. pdf|xml
|
||||
* @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
|
||||
@@ -185,7 +164,7 @@ public class Main {
|
||||
try {
|
||||
selectedName = buffer.readLine();
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
|
||||
}
|
||||
|
||||
@@ -194,22 +173,15 @@ public class Main {
|
||||
selectedName = defaultFilename;
|
||||
}
|
||||
|
||||
boolean hasCorrectExtension=false;
|
||||
String[] expectedExtensions=expectedExtension.split("\\|");
|
||||
for (String currentExtension: expectedExtensions) {
|
||||
if (selectedName.toLowerCase().endsWith(expectedExtension.toLowerCase())) {
|
||||
hasCorrectExtension=true;
|
||||
}
|
||||
}
|
||||
// error cases
|
||||
if (!selectedName.toLowerCase().endsWith(expectedExtension.toLowerCase())) {
|
||||
System.err.println("Expected " + expectedExtension
|
||||
+ " extension, this may corrupt your file. Do you still want to continue?(Y|N)");
|
||||
String selectedAnswer = "";
|
||||
try {
|
||||
selectedAnswer = buffer.readLine();
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
}
|
||||
if (!selectedAnswer.equals("Y") && !selectedAnswer.equals("y")) {
|
||||
System.err.println("Aborted by user");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
} else if (ensureFileExists) {
|
||||
if (ensureFileExists) {
|
||||
if (fileExists(selectedName)) {
|
||||
fileExistenceOK = true;
|
||||
} else {
|
||||
@@ -217,6 +189,20 @@ public class Main {
|
||||
// discard the input, a scanner.reset is not sufficient
|
||||
fileExistenceOK = false;
|
||||
}
|
||||
} else if (!hasCorrectExtension) {
|
||||
System.err.println("Expected " + expectedExtension
|
||||
+ " extension, this may corrupt your file. Do you still want to continue?(Y|N)");
|
||||
String selectedAnswer = "";
|
||||
try {
|
||||
selectedAnswer = buffer.readLine();
|
||||
} catch (IOException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
if (!selectedAnswer.equals("Y") && !selectedAnswer.equals("y")) {
|
||||
System.err.println("Aborted by user");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
} else {
|
||||
fileExistenceOK = true;
|
||||
|
||||
@@ -252,7 +238,8 @@ public class Main {
|
||||
Option<String> sourceOption = parser.addStringOption("source");
|
||||
// --out: output file
|
||||
Option<String> outOption = parser.addStringOption("out");
|
||||
|
||||
Option<Boolean> noNoticesOption = parser.addBooleanOption("no-notices");
|
||||
Option<String> logAppendOption = parser.addStringOption("logAppend");
|
||||
|
||||
// Command: Combining PDF and XML
|
||||
// --combine
|
||||
@@ -275,7 +262,6 @@ public class Main {
|
||||
// Command: Show metrics from list from stdin
|
||||
// --listfromstdin
|
||||
Option<Boolean> filesFromStdInOption = parser.addBooleanOption('l', "listfromstdin");
|
||||
|
||||
try {
|
||||
parser.parse(args);
|
||||
} catch (CmdLineParser.OptionException e) {
|
||||
@@ -294,6 +280,8 @@ public class Main {
|
||||
String sourceXMLName = parser.getOptionValue(sourceXmlOption);
|
||||
String outName = parser.getOptionValue(outOption);
|
||||
String format = parser.getOptionValue(formatOption);
|
||||
Boolean noNotices = parser.getOptionValue(noNoticesOption);
|
||||
|
||||
String zugferdVersion = parser.getOptionValue(zugferdVersionOption);
|
||||
String zugferdProfile = parser.getOptionValue(zugferdProfileOption);
|
||||
boolean optionsRecognized=false;
|
||||
@@ -312,41 +300,39 @@ public class Main {
|
||||
} else if ((action!=null)&&(action.equals("a3only"))) {
|
||||
performConvert(sourceName, outName);
|
||||
optionsRecognized=true;
|
||||
} else if ((action!=null)&&(action.equals("visualize"))) {
|
||||
performVisualization(sourceName, outName);
|
||||
optionsRecognized=true;
|
||||
} else if ((action!=null)&&(action.equals("validate"))) {
|
||||
|
||||
optionsRecognized=performValidate(sourceName);
|
||||
|
||||
optionsRecognized=performValidate(sourceName, noNotices!=null&&noNotices, parser.getOptionValue(logAppendOption));
|
||||
} else if ((action!=null)&&(action.equals("validateExpectValid"))) {
|
||||
|
||||
optionsRecognized=performValidateExpect(true, directoryName);
|
||||
|
||||
|
||||
} else if ((action!=null)&&(action.equals("validateExpectInvalid"))) {
|
||||
|
||||
optionsRecognized=performValidateExpect(false, directoryName);
|
||||
|
||||
} else {
|
||||
// no argument or argument unknown
|
||||
printUsage();
|
||||
System.exit(2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean performValidate(String sourceName) {
|
||||
private static boolean performValidate(String sourceName, boolean noNotices, String logAppend) {
|
||||
boolean optionsRecognized;
|
||||
if (sourceName == null) {
|
||||
sourceName = getFilenameFromUser("Source PDF", "invoice.pdf", "pdf", true, false);
|
||||
} else {
|
||||
System.out.println("Source PDF set to " + sourceName);
|
||||
sourceName = getFilenameFromUser("Source PDF or XML", "invoice.pdf", "pdf|xml", true, false);
|
||||
}
|
||||
|
||||
ZUGFeRDValidator zfv=new ZUGFeRDValidator();
|
||||
if ((logAppend!=null)&&(logAppend.length()>0)) {
|
||||
zfv.setLogAppend(logAppend);
|
||||
}
|
||||
if (noNotices) {
|
||||
zfv.disableNotices();
|
||||
}
|
||||
System.out.println(zfv.validate(sourceName));
|
||||
optionsRecognized = !zfv.hasOptionsError();
|
||||
if (!zfv.wasCompletelyValid()) {
|
||||
@@ -398,7 +384,7 @@ public class Main {
|
||||
ensureFileNotExists(outName);
|
||||
|
||||
// All params are good! continue...
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setAttachZUGFeRDHeaders(false).load(pdfName);
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().convertOnly().load(pdfName);
|
||||
|
||||
ze.export(outName);
|
||||
System.out.println("Written to " + outName);
|
||||
@@ -412,7 +398,7 @@ public class Main {
|
||||
System.out.println("Source PDF set to " + pdfName);
|
||||
}
|
||||
if (xmlName == null) {
|
||||
xmlName = getFilenameFromUser("ZUGFeRD XML", "ZUGFeRD-invoice.xml", "xml", false, true);
|
||||
xmlName = getFilenameFromUser("ZUGFeRD XML", "factur-x.xml", "xml", false, true);
|
||||
} else {
|
||||
System.out.println("ZUGFeRD XML set to " + pdfName);
|
||||
}
|
||||
@@ -441,8 +427,8 @@ public class Main {
|
||||
* .loadFromPDFA1("invoice.pdf");
|
||||
*/
|
||||
try {
|
||||
int zfIntVersion = ZUGFeRDExporter.DefaultZUGFeRDVersion;
|
||||
ZUGFeRDConformanceLevel zfConformanceLevelProfile = ZUGFeRDConformanceLevel.EXTENDED;
|
||||
int zfIntVersion = ZUGFeRDExporterFromA3.DefaultZUGFeRDVersion;
|
||||
Profile zfConformanceLevelProfile = Profiles.getByName("EXTENDED");
|
||||
|
||||
if (pdfName == null) {
|
||||
pdfName = getFilenameFromUser("Source PDF", "invoice.pdf", "pdf", true, false);
|
||||
@@ -451,7 +437,7 @@ public class Main {
|
||||
}
|
||||
|
||||
if (xmlName == null) {
|
||||
xmlName = getFilenameFromUser("ZUGFeRD XML", "ZUGFeRD-invoice.xml", "xml", true, false);
|
||||
xmlName = getFilenameFromUser("ZUGFeRD XML", "factur-x.xml", "xml", true, false);
|
||||
} else {
|
||||
System.out.println("ZUGFeRD XML set to " + xmlName);
|
||||
}
|
||||
@@ -466,7 +452,7 @@ public class Main {
|
||||
try {
|
||||
format = getStringFromUser("Format (fx=Factur-X, zf=ZUGFeRD)", "zf", "fx|zf");
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Format set to " + format);
|
||||
@@ -474,9 +460,9 @@ public class Main {
|
||||
|
||||
if (zfVersion == null) {
|
||||
try {
|
||||
zfVersion = getStringFromUser("Version (1 or 2)", Integer.toString(ZUGFeRDExporter.DefaultZUGFeRDVersion), "1|2");
|
||||
zfVersion = getStringFromUser("Version (1 or 2)", Integer.toString(ZUGFeRDExporterFromA3.DefaultZUGFeRDVersion), "1|2");
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Version set to " + zfVersion);
|
||||
@@ -493,8 +479,7 @@ public class Main {
|
||||
"M|m|W|w|B|b|C|c|E|e|T|t|X|x|");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
} else {
|
||||
System.out.println("Profile set to " + zfProfile);
|
||||
@@ -512,29 +497,29 @@ public class Main {
|
||||
|
||||
if ((format.equals("zf")) && (zfIntVersion == 1)) {
|
||||
if (zfProfile.equals("b")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.BASIC;
|
||||
zfConformanceLevelProfile = Profiles.getByName("BASIC", zfIntVersion);
|
||||
} else if (zfProfile.equals("c")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.COMFORT;
|
||||
zfConformanceLevelProfile = Profiles.getByName("COMFORT", zfIntVersion);
|
||||
} else if (zfProfile.equals("e")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.EXTENDED;
|
||||
zfConformanceLevelProfile = Profiles.getByName("EXTENDED", zfIntVersion);
|
||||
} else {
|
||||
throw new Exception(String.format("Unknown ZUGFeRD profile '%s'", zfProfile));
|
||||
}
|
||||
} else if (((format.equals("zf")) && (zfIntVersion == 2)) || (format.equals("fx"))) {
|
||||
if (zfProfile.equals("m")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.MINIMUM;
|
||||
zfConformanceLevelProfile = Profiles.getByName("MINIMUM", zfIntVersion);
|
||||
} else if (zfProfile.equals("w")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.BASICWL;
|
||||
zfConformanceLevelProfile = Profiles.getByName("BASICWL", zfIntVersion);
|
||||
} else if (zfProfile.equals("b")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.BASIC;
|
||||
zfConformanceLevelProfile = Profiles.getByName("BASIC", zfIntVersion);
|
||||
} else if (zfProfile.equals("c")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.CIUS;
|
||||
zfConformanceLevelProfile = Profiles.getByName("CIUS", zfIntVersion);
|
||||
} else if (zfProfile.equals("e")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.EN16931;
|
||||
zfConformanceLevelProfile = Profiles.getByName("EN16931", zfIntVersion);
|
||||
} else if (zfProfile.equals("t")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.EXTENDED;
|
||||
zfConformanceLevelProfile = Profiles.getByName("EXTENDED", zfIntVersion);
|
||||
} else if (zfProfile.equals("x")) {
|
||||
zfConformanceLevelProfile = ZUGFeRDConformanceLevel.XRECHNUNG;
|
||||
zfConformanceLevelProfile = Profiles.getByName("XRECHNUNG", zfIntVersion);
|
||||
} else {
|
||||
throw new Exception(String.format("Unknown ZUGFeRD profile '%s'", zfProfile));
|
||||
}
|
||||
@@ -543,28 +528,27 @@ public class Main {
|
||||
}
|
||||
|
||||
// All params are good! continue...
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setProducer("Mustang-cli")
|
||||
ZUGFeRDExporterFromA1 ze = (ZUGFeRDExporterFromA1) new ZUGFeRDExporterFromA1().setProducer("Mustang-cli")
|
||||
.setZUGFeRDVersion(zfIntVersion)
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDConformanceLevel(zfConformanceLevelProfile)
|
||||
.setCreator(System.getProperty("user.name")).setProfile(zfConformanceLevelProfile)
|
||||
.load(pdfName);
|
||||
if (ignoreInputErrors) {
|
||||
ze.ignoreA1Errors();
|
||||
ze.ignorePDFAErrors();
|
||||
|
||||
}
|
||||
|
||||
if (format.equals("fx")) {
|
||||
ze.setFacturX();
|
||||
if (!format.equals("fx")) {
|
||||
ze.disableFacturX();
|
||||
}
|
||||
|
||||
ze.setZUGFeRDXMLData(Files.readAllBytes(Paths.get(xmlName)));
|
||||
ze.setXML(Files.readAllBytes(Paths.get(xmlName)));
|
||||
|
||||
ze.export(outName);
|
||||
|
||||
System.out.println("Written to " + outName);
|
||||
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
|
||||
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,6 +590,91 @@ public class Main {
|
||||
System.out.println(sr.getSummaryLine());
|
||||
}
|
||||
|
||||
private static void performVisualization(String sourceName, String outName) {
|
||||
// Get params from user if not already defined
|
||||
if (sourceName == null) {
|
||||
sourceName = getFilenameFromUser("ZUGFeRD XML source", "factur-x.xml", "xml", true, false);
|
||||
} else {
|
||||
System.out.println("ZUGFeRD XML source set to " + sourceName);
|
||||
}
|
||||
if (outName == null) {
|
||||
outName = getFilenameFromUser("HTML target file", "factur-x.html", "html", false, true);
|
||||
} else {
|
||||
System.out.println("HTML target set to " + outName);
|
||||
}
|
||||
|
||||
// Verify params
|
||||
try {
|
||||
ensureFileExists(sourceName);
|
||||
ensureFileNotExists(outName);
|
||||
|
||||
// stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt
|
||||
} catch (IOException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
|
||||
String xml = null;
|
||||
try {
|
||||
xml = zvi.visualize(sourceName);
|
||||
Files.write(Paths.get(outName), xml.getBytes());
|
||||
} catch (FileNotFoundException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
} catch (TransformerException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
System.out.println("Written to " + outName);
|
||||
|
||||
try {
|
||||
ExportResource("/xrechnung-viewer.css");
|
||||
ExportResource("/xrechnung-viewer.js");
|
||||
|
||||
System.out.println("xrechnung-viewer.css and xrechnung-viewer.js written as well (to local working dir)");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Export a resource embedded into a Jar file to the local file path.
|
||||
*
|
||||
* @param resourceName ie.: "/SmartLibrary.dll"
|
||||
* @return The path to the exported resource
|
||||
* @throws Exception e.g. if the specified resource does not exist at the specified location
|
||||
*/
|
||||
static public String ExportResource(String resourceName) throws Exception {
|
||||
InputStream stream = null;
|
||||
OutputStream resStreamOut = null;
|
||||
String jarFolder;
|
||||
try {
|
||||
stream = Main.class.getResourceAsStream(resourceName);//note that each / is a directory down in the "jar tree" been the jar the root of the tree
|
||||
if(stream == null) {
|
||||
throw new Exception("Cannot get resource \"" + resourceName + "\" from Jar file.");
|
||||
}
|
||||
|
||||
int readBytes;
|
||||
byte[] buffer = new byte[4096];
|
||||
jarFolder = System.getProperty("user.dir");
|
||||
resStreamOut = new FileOutputStream(jarFolder + resourceName);
|
||||
while ((readBytes = stream.read(buffer)) > 0) {
|
||||
resStreamOut.write(buffer, 0, readBytes);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw ex;
|
||||
} finally {
|
||||
stream.close();
|
||||
resStreamOut.close();
|
||||
}
|
||||
|
||||
return jarFolder + resourceName;
|
||||
}
|
||||
|
||||
private static void ensureFileExists(String fileName) throws IOException {
|
||||
if (!fileExists(fileName)) {
|
||||
throw new IOException(String.format("File %s does not exists", fileName));
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<target>System.err</target>
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
@@ -24,6 +25,6 @@
|
||||
<!-- Configure so that it outputs to both console and log file -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="STDERR" />
|
||||
</root>
|
||||
</configuration>
|
||||
|
||||
165
Release_Notes.md
Normal file
165
Release_Notes.md
Normal file
@@ -0,0 +1,165 @@
|
||||
|
||||
## Changes
|
||||
|
||||
On it's official website you can [download](https://www.mustangproject.org/files/Mustang-CLI-2.0.0-alpha3.jar) a alpha release of Mustang 2.
|
||||
|
||||
It integrates the successor of the ZUGFeRD [Validator ZUV](https://github.com/ZUGFeRD/ZUV/) in it's command line tool and can be used as library.
|
||||
|
||||
Additionally, the default changed from ZUGFeRD 1 to ZUGFeRD 2.1.1 (previously you had to enable that, now you have to specify that you want to use ZF1 if that's the case), it's now available via Maven Central and additionally to the old Interface-style pullProvider requiring you to implement methods there is now also a "normal", class-orientierted, halfway fluent "Push-Provider". It's describe below, if you are impatient please feel free to have a look at it's tests on https://github.com/ZUGFeRD/mustangproject/blob/master/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java.
|
||||
|
||||
This is a preview release, please do not (yet) use it in production.
|
||||
|
||||
### Use on command line
|
||||
`java -jar Mustang-CLI-2.0.0-alpha3.jar --action=combine` embedds a XML into a PDF (A-1) file and exports as PDF/A-3
|
||||
|
||||
`java -jar mustang-cli.jar --action=extract` extracts XML from a ZUGFeRD file and
|
||||
|
||||
`java -jar mustang-cli.jar --action=validate` validates XML or PDF files.
|
||||
|
||||
`java -jar mustang-cli.jar --help` still outputs the parameters which can be used
|
||||
to for non-interactive (i.e., batch) processing.
|
||||
|
||||
|
||||
The source file parameter for validation changed
|
||||
from `-f` (ZUV) to the usual `--source`. The following
|
||||
result codes apply:
|
||||
|
||||
| section | meaning |
|
||||
|---|---|
|
||||
| 1 | file not found |
|
||||
| 2 | additional data schema validation fails |
|
||||
| 3 | xml data not found |
|
||||
| 4 | schematron rule failed |
|
||||
| 5 | file too small |
|
||||
| 6 | VeraPDFException |
|
||||
| 7 | IOException PDF |
|
||||
| 8 | File does not look like PDF nor XML (contains neither %PDF nor <?xml) |
|
||||
| 9 | IOException XML |
|
||||
| 11 | XMP Metadata: ConformanceLevel not found |
|
||||
| 12 | XMP Metadata: ConformanceLevel contains invalid value |
|
||||
| 13 | XMP Metadata: DocumentType not found |
|
||||
| 14 | XMP Metadata: DocumentType invalid |
|
||||
| 15 | XMP Metadata: Version not found |
|
||||
| 16 | XMP Metadata: Version contains invalid value |
|
||||
| 18 | schema validation failed |
|
||||
| 19 | XMP Metadata: DocumentFileName contains invalid value |
|
||||
| 20 | not a pdf |
|
||||
| 21 | XMP Metadata: DocumentFileName not found") |
|
||||
| 22 | generic XML validation exception |
|
||||
| 23 | Not a PDF/A-3 |
|
||||
| 24 | Issues in CEN EN16931 Schematron Check |
|
||||
| 25 | Unsupported profile type |
|
||||
| 26 | No rules matched, XML to minimal? |
|
||||
| 27 | XRechnung Schematron Check |
|
||||
|
||||
|
||||
### Use as Library
|
||||
|
||||
We're now on maven central, please remove the old github repository. Additionally, the following changed
|
||||
|
||||
| What | old value | new value |
|
||||
|---|---|---|
|
||||
| Group id | org.mustangproject.zugferd | org.mustangproject|
|
||||
| Artifact ID | mustang | library |
|
||||
| Version | 1.7.8 | 2.0.0-alpha3 |
|
||||
|
||||
If you want you can also embed the validator in your software using validator
|
||||
as artifact ID. "validator" includes the library functionality but is >20 MB
|
||||
bigger due to it's dependencies.
|
||||
|
||||
|
||||
### Update from 1.x to 2.0
|
||||
|
||||
ZF2 was possible with Mustang 1 but it is default in Mustang 2, so
|
||||
you will need to `.setZUGFeRDVersion(1)` if you don't want ZUGFeRD 2 files.
|
||||
`PDFattachZugferdFile` is now called `setTransaction` and instead of
|
||||
a `ZUGFeRDExporterFromA1Factory` the `ZUGFeRDExporterFromA1` will now return a
|
||||
a class implementing `IZUGFeRDExporter` instead of a `ZUGFeRDExporter`.
|
||||
So
|
||||
```
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.COMFORT).load(SOURCE_PDF)) {
|
||||
|
||||
```
|
||||
changes to
|
||||
```
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(1).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
```
|
||||
|
||||
The importer can still be used like
|
||||
|
||||
```
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(inputStream);
|
||||
String amount = zi.getAmount();
|
||||
```
|
||||
but we are also working on an importer to import into the new invoice class.
|
||||
|
||||
### Using the library to create e-invoices
|
||||
From maven central fetch
|
||||
```
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>library</artifactId>
|
||||
<version>2.0.0-alpha3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
```
|
||||
```
|
||||
import org.mustangproject.Contact;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.Item;
|
||||
import org.mustangproject.Product;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExporter;
|
||||
import org.mustangproject.ZUGFeRD.Profiles;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA1;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName("My company").setOwnStreet("teststr").setOwnZIP("12345").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber("INV/123").addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), new BigDecimal(1.0), new BigDecimal(1.0)));
|
||||
try {
|
||||
IZUGFeRDExporter ie = new ZUGFeRDExporterFromA1().load("source.pdf").setZUGFeRDVersion(2).setProfile(Profiles.EN16931);
|
||||
ie.setProfile(Profiles.EN16931).setTransaction(i).export("target.pdf");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Export XML
|
||||
A invoice like this
|
||||
```
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), amount, new BigDecimal(1.0)));
|
||||
```
|
||||
can be used to get XML
|
||||
```
|
||||
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
|
||||
zf2p.generateXML(i);
|
||||
String theXML = new String(zf2p.getXML());
|
||||
```
|
||||
or can also be used with setTransaction to generate invoice PDFs straight away.
|
||||
### Embedding the validator
|
||||
```
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<version>2.0.0-alpha3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
```
|
||||
```
|
||||
import org.mustangproject.validator.ZUGFeRDValidator;
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
ZUGFeRDValidator zfv = new ZUGFeRDValidator();
|
||||
System.out.println(zfv.validate("/tmp/factur-x.xml"));
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
1. build
|
||||
|
||||
as excercise to check if the neccessary tools are there, the build is in a stable state and works on your platform, e.g. download and extract https://github.com/ZUGFeRD/mustangproject/archive/master.zip and run ./mvnw clean package
|
||||
To check if the necessary tools are there, the build is in a stable state and works on your platform, e.g. download and extract https://github.com/ZUGFeRD/mustangproject/archive/master.zip and run ./mvnw clean package
|
||||
|
||||
Mvnw is a maven wrapper which will download maven.Maven is the dependency management tool which will download all libraries, their dependencies, and build the whole thing.
|
||||
|
||||
@@ -27,6 +27,20 @@ If you do a pull request, please do a feature branch, e.g. if you are working on
|
||||
Most of mustang is a library, adding (autmated junit) test cases is often not only the most sustainable but also the fastest way to see if new/changed functionality works. If something is changed so that old test cases break on purpose please do not just remove them but take the time to fix the test cases
|
||||
|
||||
|
||||
## Architecture
|
||||
|
||||
Mustang contains a library to read/write e-invoices,
|
||||
a validator library
|
||||
(and can also read/write e-invoices, but is substantially
|
||||
larger) and a commandline application using the latter
|
||||
library.
|
||||
|
||||
The validator component embeds VeraPDF, a open-source
|
||||
PDF/A-validator, via maven dependency and uses standard java
|
||||
checks against schema and ph-schematron for checks against the schematron
|
||||
to validate the XML part of the invoices.
|
||||
|
||||

|
||||
|
||||
## New build
|
||||
|
||||
@@ -46,7 +60,13 @@ can be used as debug configuration goal in Eclipse. In that case you can set bre
|
||||
|
||||
## Validate
|
||||
|
||||
[ZUV](https://github.com/ZUGFeRD/ZUV/) can be used to validate generated files.
|
||||
The former ZUGFeRD VeraPDF [ZUV](https://github.com/ZUGFeRD/ZUV/) validator
|
||||
is now part of Mustangproject.
|
||||
The JUnit tests of the validator component will also run through a couple of
|
||||
test files of the library component.
|
||||
|
||||
|
||||
|
||||
|
||||
## Deployment
|
||||
|
||||
@@ -59,8 +79,28 @@ As „servers“, enter the following
|
||||
<id>github</id>
|
||||
<password>GITHUB-TOKEN</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>jstaerk</username>
|
||||
<password>JIRA-PASSWORD</password>
|
||||
</server>
|
||||
</servers>
|
||||
```
|
||||
Add a profiles section to settings.xml
|
||||
```
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<gpg.passphrase>PASSPHRASE</gpg.passphrase>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
```
|
||||
|
||||
The whole settings.xml then looks e.g. like this
|
||||
```xml
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
@@ -77,15 +117,32 @@ The whole settings.xml then looks e.g. like this
|
||||
<id>github</id>
|
||||
<password>TOKEN</password>
|
||||
</server>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>jstaerk</username>
|
||||
<password>JIRA-PASSWORD</password>
|
||||
</server>
|
||||
|
||||
</servers>
|
||||
<mirrors/>
|
||||
<proxies/>
|
||||
<profiles/>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
<properties>
|
||||
<gpg.passphrase>PASSPHRASE</gpg.passphrase>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
<activeProfiles/>
|
||||
</settings>
|
||||
```
|
||||
|
||||
The password is generated on github.
|
||||
The TOKEN is generated on github.
|
||||
Deployment to maven central is described e.g. on [dzone](https://dzone.com/articles/publish-your-artifacts-to-maven-central).
|
||||
See the following screenshot:
|
||||
|
||||
|
||||
@@ -93,6 +150,7 @@ Sign in in GitHub and click on the profile picture -> Settings. Now just generat
|
||||

|
||||
The Token-ID is the password.
|
||||
|
||||
|
||||
## Integrate before release
|
||||
|
||||
If you added functionality which you need to test in another project before a new version of Mustang is released you can
|
||||
@@ -113,6 +171,7 @@ Change to the project directory and run
|
||||
* clean the release with `mvn release:clean` and prepare the release with
|
||||
* `mvn release:prepare -DignoreSnapshots=true` and enter the version numbers.
|
||||
* After that is through you can create a new release via `mvn release:perform -Dmaven.java.skip=True`.This will also update the maven repo.
|
||||
* Experimental: mvn deploy -Dregistry=https://maven.pkg.github.com/ZUGFeRD -Dtoken=GH_TOKEN
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
<parent>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>library</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>Library to write and read FacturX and ZUGFeRD e-invoices. </name>
|
||||
<description>The Mustang project is a java library to read and write ZUGFeRD meta data inside your invoice PDFs. To write files, a provided PDF/A will be combined with generated or provided XML.
|
||||
@@ -54,7 +54,7 @@
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<version>9.8.0-11</version>
|
||||
<version>9.9.0-1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
@@ -80,7 +80,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@@ -92,32 +92,19 @@
|
||||
<dependency>
|
||||
<groupId>org.xmlunit</groupId>
|
||||
<artifactId>xmlunit-core</artifactId>
|
||||
<version>2.6.2</version>
|
||||
<version>2.6.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- For Toecount -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sanityinc</groupId>
|
||||
<artifactId>jargs</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<groupId>org.xmlunit</groupId>
|
||||
<artifactId>xmlunit-assertj</artifactId>
|
||||
<version>2.6.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin><!-- mvn help:effective-pom will otherwise tell it just defaults
|
||||
to 2.3.2 - which does not release in the maven repo, and neither shows any
|
||||
error message :-( -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
|
||||
<!-- toecount -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
@@ -132,67 +119,13 @@
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
<!-- http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven
|
||||
mvn clean compile assembly:single -->
|
||||
<!-- http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven
|
||||
mvn clean compile assembly:single -->
|
||||
<!-- or whatever version you use -->
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!-- /toecount -->
|
||||
<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>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<configuration>
|
||||
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo
|
||||
</altDeploymentRepository>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.github.github</groupId>
|
||||
<artifactId>site-maven-plugin</artifactId>
|
||||
<version>0.12</version>
|
||||
<configuration>
|
||||
<message>Maven artifacts for ${project.version}</message>
|
||||
<!-- git commit message -->
|
||||
<noJekyll>true</noJekyll>
|
||||
<!-- disable webpage processing -->
|
||||
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
|
||||
<!-- matches distribution management repository url above -->
|
||||
<branch>refs/heads/mvn-repo</branch>
|
||||
<!-- remote branch name -->
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<merge>true</merge>
|
||||
<repositoryName>mustangproject</repositoryName>
|
||||
<!-- github repo name -->
|
||||
<repositoryOwner>ZUGFeRD</repositoryOwner>
|
||||
<!-- github username -->
|
||||
</configuration>
|
||||
<executions>
|
||||
<!-- run site-maven-plugin's 'site' target as part of the build's normal
|
||||
'deploy' phase -->
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@@ -237,9 +170,9 @@
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<excludes>
|
||||
<!--exclude>classworlds:classworlds</exclude> <exclude>junit:junit</exclude>
|
||||
<exclude>jmock:*</exclude> <exclude>*:xml-apis</exclude> <exclude>org.apache.maven:lib:tests</exclude>
|
||||
<exclude>log4j:log4j:jar:</exclude -->
|
||||
<!--exclude>classworlds:classworlds</exclude> <exclude>junit:junit</exclude>
|
||||
<exclude>jmock:*</exclude> <exclude>*:xml-apis</exclude> <exclude>org.apache.maven:lib:tests</exclude>
|
||||
<exclude>log4j:log4j:jar:</exclude -->
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
@@ -261,6 +194,8 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<mailingLists>
|
||||
<mailingList>
|
||||
<name>User List</name>
|
||||
|
||||
22
library/src/main/java/org/mustangproject/Allowance.java
Normal file
22
library/src/main/java/org/mustangproject/Allowance.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IExportableTransaction;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Allowance extends Charge implements IZUGFeRDAllowanceCharge {
|
||||
|
||||
public Allowance() {
|
||||
|
||||
}
|
||||
public Allowance(BigDecimal totalAmount) {
|
||||
super(totalAmount);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
44
library/src/main/java/org/mustangproject/BankDetails.java
Normal file
44
library/src/main/java/org/mustangproject/BankDetails.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDTradeSettlementPayment;
|
||||
|
||||
public class BankDetails implements IZUGFeRDTradeSettlementPayment {
|
||||
protected String IBAN, BIC;
|
||||
|
||||
public BankDetails(String IBAN, String BIC) {
|
||||
this.IBAN = IBAN;
|
||||
this.BIC = BIC;
|
||||
}
|
||||
|
||||
public String getIBAN() {
|
||||
return IBAN;
|
||||
}
|
||||
|
||||
public BankDetails setIBAN(String IBAN) {
|
||||
this.IBAN = IBAN;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getBIC() {
|
||||
return BIC;
|
||||
}
|
||||
|
||||
public BankDetails setBIC(String BIC) {
|
||||
this.BIC = BIC;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return getBIC();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return getIBAN();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
91
library/src/main/java/org/mustangproject/Charge.java
Normal file
91
library/src/main/java/org/mustangproject/Charge.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IAbsoluteValueProvider;
|
||||
import org.mustangproject.ZUGFeRD.IExportableTransaction;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
|
||||
protected BigDecimal percent = null;
|
||||
protected BigDecimal totalAmount;
|
||||
protected BigDecimal taxPercent;
|
||||
protected String reason;
|
||||
protected String categoryCode;
|
||||
|
||||
public Charge() {
|
||||
taxPercent=new BigDecimal(0);
|
||||
}
|
||||
|
||||
/***
|
||||
* creates a item level or invoice level charge
|
||||
* @param totalAmount (the absolute amount)
|
||||
*/
|
||||
public Charge(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
|
||||
public Charge setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setPercent(BigDecimal percent) {
|
||||
this.percent = percent;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Charge setTaxPercent(BigDecimal taxPercent) {
|
||||
this.taxPercent = taxPercent;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public Charge setReason(String reason) {
|
||||
this.reason = reason;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal getTotalAmount(IAbsoluteValueProvider currentItem) {
|
||||
if (totalAmount!=null) {
|
||||
return totalAmount;
|
||||
} else if (percent!=null) {
|
||||
return currentItem.getValue().multiply(getPercent().divide(new BigDecimal(100)));
|
||||
} else {
|
||||
throw new RuntimeException("Either totalAmount or percent must be set");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BigDecimal getPercent() {
|
||||
return percent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getTaxPercent() {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
this.categoryCode = categoryCode;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,18 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableContact;
|
||||
|
||||
public class Contact implements IZUGFeRDExportableContact {
|
||||
|
||||
protected String name,phone,email,zip,street,location,country;
|
||||
protected String fax=null;
|
||||
|
||||
public Contact(String name, String phone, String email) {
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
this.email = email;
|
||||
|
||||
}
|
||||
public Contact(String name, String phone, String email, String street, String zip, String location, String country) {
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
@@ -35,6 +44,16 @@ public class Contact implements IZUGFeRDExportableContact {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public Contact setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEMail() {
|
||||
return email;
|
||||
}
|
||||
@@ -82,4 +101,5 @@ public class Contact implements IZUGFeRDExportableContact {
|
||||
this.country = country;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
67
library/src/main/java/org/mustangproject/FileAttachment.java
Normal file
67
library/src/main/java/org/mustangproject/FileAttachment.java
Normal file
@@ -0,0 +1,67 @@
|
||||
package org.mustangproject;
|
||||
|
||||
public class FileAttachment {
|
||||
|
||||
protected String filename;
|
||||
protected String mimetype;
|
||||
protected String relation;
|
||||
protected String description;
|
||||
protected byte[] data;
|
||||
|
||||
public FileAttachment(String filename, String mimetype, String relation, byte[] data) {
|
||||
this.filename = filename;
|
||||
this.mimetype = mimetype;
|
||||
this.relation = relation;
|
||||
this.data = data;
|
||||
description = "Additional file attachment";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public FileAttachment setDescription(String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getFilename() {
|
||||
return filename;
|
||||
}
|
||||
|
||||
public FileAttachment setFilename(String filename) {
|
||||
this.filename = filename;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getMimetype() {
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public FileAttachment setMimetype(String mimetype) {
|
||||
this.mimetype = mimetype;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getRelation() {
|
||||
return relation;
|
||||
}
|
||||
|
||||
public FileAttachment setRelation(String relation) {
|
||||
this.relation = relation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public byte[] getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public FileAttachment setData(byte[] data) {
|
||||
this.data = data;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -18,27 +18,35 @@
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
public class Invoice implements IExportableTransaction {
|
||||
|
||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownTaxID = null, ownVATID = null, ownForeignOrganisationID = null, ownOrganisationName = null, ownStreet = null, ownZIP = null, ownLocation = null, ownCountry = null, currency = null, paymentTermDescription = null;
|
||||
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
|
||||
protected Date issueDate = null, dueDate = null, deliveryDate = null;
|
||||
protected BigDecimal totalPrepaidAmount = null;
|
||||
protected IZUGFeRDExportableContact ownContact = null, recipient = null, deliveryAddress = null;
|
||||
protected TradeParty sender=null, recipient = null, deliveryAddress = null;
|
||||
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
|
||||
protected String contractReferencedDocument = null;
|
||||
|
||||
protected IZUGFeRDAllowanceCharge[] ZFAllowances = null, ZFCharges = null, ZFLogisticsServiceCharges = null;
|
||||
protected IZUGFeRDTradeSettlement[] getTradeSettlement = null;
|
||||
protected Date occurrenceDateFrom = null;
|
||||
protected Date occurrenceDateTo = null;
|
||||
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
|
||||
Charges = new ArrayList<IZUGFeRDAllowanceCharge>(), LogisticsServiceCharges = new ArrayList<IZUGFeRDAllowanceCharge>();
|
||||
protected IZUGFeRDPaymentTerms paymentTerms = null;
|
||||
|
||||
|
||||
public ZUGFeRD2PushProvider() {
|
||||
public Invoice() {
|
||||
ZFItems = new ArrayList<IZUGFeRDExportableItem>();
|
||||
setCurrency("EUR");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,7 +54,9 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return documentName;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setDocumentName(String documentName) {
|
||||
public String getContractReferencedDocument() { return contractReferencedDocument; }
|
||||
|
||||
public Invoice setDocumentName(String documentName) {
|
||||
this.documentName = documentName;
|
||||
return this;
|
||||
}
|
||||
@@ -56,27 +66,39 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return documentCode;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setDocumentCode(String documentCode) {
|
||||
public Invoice setDocumentCode(String documentCode) {
|
||||
this.documentCode = documentCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setNumber(String number) {
|
||||
public Invoice setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* switch type to invoice correction and refer to document number
|
||||
* @param number the invoice number to be corrected
|
||||
* @return this object (fluent setter)
|
||||
*/
|
||||
public Invoice setCorrection(String number) {
|
||||
setBuyerOrderReferencedDocumentID(number);
|
||||
documentCode= DocumentCodeTypeConstants.CORRECTEDINVOICE;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationFullPlaintextInfo() {
|
||||
return ownOrganisationFullPlaintextInfo;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
public Invoice setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
this.ownOrganisationFullPlaintextInfo = ownOrganisationFullPlaintextInfo;
|
||||
return this;
|
||||
}
|
||||
@@ -86,7 +108,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return referenceNumber;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setReferenceNumber(String referenceNumber) {
|
||||
public Invoice setReferenceNumber(String referenceNumber) {
|
||||
this.referenceNumber = referenceNumber;
|
||||
return this;
|
||||
}
|
||||
@@ -96,7 +118,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToOrganisationID;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToOrganisationID(String shipToOrganisationID) {
|
||||
public Invoice setShipToOrganisationID(String shipToOrganisationID) {
|
||||
this.shipToOrganisationID = shipToOrganisationID;
|
||||
return this;
|
||||
}
|
||||
@@ -106,7 +128,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToOrganisationName;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToOrganisationName(String shipToOrganisationName) {
|
||||
public Invoice setShipToOrganisationName(String shipToOrganisationName) {
|
||||
this.shipToOrganisationName = shipToOrganisationName;
|
||||
return this;
|
||||
}
|
||||
@@ -116,7 +138,9 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToStreet;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToStreet(String shipToStreet) {
|
||||
|
||||
|
||||
public Invoice setShipToStreet(String shipToStreet) {
|
||||
this.shipToStreet = shipToStreet;
|
||||
return this;
|
||||
}
|
||||
@@ -126,7 +150,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToZIP;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToZIP(String shipToZIP) {
|
||||
public Invoice setShipToZIP(String shipToZIP) {
|
||||
this.shipToZIP = shipToZIP;
|
||||
return this;
|
||||
}
|
||||
@@ -136,7 +160,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToLocation;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToLocation(String shipToLocation) {
|
||||
public Invoice setShipToLocation(String shipToLocation) {
|
||||
this.shipToLocation = shipToLocation;
|
||||
return this;
|
||||
}
|
||||
@@ -146,7 +170,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return shipToCountry;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setShipToCountry(String shipToCountry) {
|
||||
public Invoice setShipToCountry(String shipToCountry) {
|
||||
this.shipToCountry = shipToCountry;
|
||||
return this;
|
||||
}
|
||||
@@ -156,7 +180,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return buyerOrderReferencedDocumentID;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setBuyerOrderReferencedDocumentID(String buyerOrderReferencedDocumentID) {
|
||||
public Invoice setBuyerOrderReferencedDocumentID(String buyerOrderReferencedDocumentID) {
|
||||
this.buyerOrderReferencedDocumentID = buyerOrderReferencedDocumentID;
|
||||
return this;
|
||||
}
|
||||
@@ -166,28 +190,37 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return buyerOrderReferencedDocumentIssueDateTime;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setBuyerOrderReferencedDocumentIssueDateTime(String buyerOrderReferencedDocumentIssueDateTime) {
|
||||
public Invoice setBuyerOrderReferencedDocumentIssueDateTime(String buyerOrderReferencedDocumentIssueDateTime) {
|
||||
this.buyerOrderReferencedDocumentIssueDateTime = buyerOrderReferencedDocumentIssueDateTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return ownTaxID;
|
||||
return getSender().getTaxID();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
|
||||
@Deprecated
|
||||
/***
|
||||
* @deprecated use TradeParty::addTaxID instead
|
||||
*/
|
||||
public Invoice setOwnTaxID(String ownTaxID) {
|
||||
sender.addTaxID(ownTaxID);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnVATID() {
|
||||
return ownVATID;
|
||||
return getSender().getVATID();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
@Deprecated
|
||||
/***
|
||||
* @deprecated use TradeParty::addVATID instead
|
||||
*/
|
||||
public Invoice setOwnVATID(String ownVATID) {
|
||||
sender.addVATID(ownVATID);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -196,7 +229,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return ownForeignOrganisationID;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnForeignOrganisationID(String ownForeignOrganisationID) {
|
||||
public Invoice setOwnForeignOrganisationID(String ownForeignOrganisationID) {
|
||||
this.ownForeignOrganisationID = ownForeignOrganisationID;
|
||||
return this;
|
||||
}
|
||||
@@ -206,55 +239,39 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return ownOrganisationName;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnOrganisationName(String ownOrganisationName) {
|
||||
public Invoice setOwnOrganisationName(String ownOrganisationName) {
|
||||
this.ownOrganisationName = ownOrganisationName;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnStreet() {
|
||||
return ownStreet;
|
||||
return sender.getStreet();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnStreet(String ownStreet) {
|
||||
this.ownStreet = ownStreet;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnZIP() {
|
||||
return ownZIP;
|
||||
return sender.getZIP();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnZIP(String ownZIP) {
|
||||
this.ownZIP = ownZIP;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getOwnLocation() {
|
||||
return ownLocation;
|
||||
return sender.getLocation();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnLocation(String getOwnLocation) {
|
||||
this.ownLocation = getOwnLocation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getOwnCountry() {
|
||||
return ownCountry;
|
||||
return sender.getCountry();
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnCountry(String getOwnCountry) {
|
||||
this.ownCountry = getOwnCountry;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setCurrency(String currency) {
|
||||
public Invoice setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
@@ -264,7 +281,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return paymentTermDescription;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setPaymentTermDescription(String paymentTermDescription) {
|
||||
public Invoice setPaymentTermDescription(String paymentTermDescription) {
|
||||
this.paymentTermDescription = paymentTermDescription;
|
||||
return this;
|
||||
}
|
||||
@@ -274,7 +291,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return issueDate;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setIssueDate(Date issueDate) {
|
||||
public Invoice setIssueDate(Date issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
return this;
|
||||
}
|
||||
@@ -284,7 +301,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return dueDate;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setDueDate(Date dueDate) {
|
||||
public Invoice setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
return this;
|
||||
}
|
||||
@@ -294,7 +311,7 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return deliveryDate;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setDeliveryDate(Date deliveryDate) {
|
||||
public Invoice setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
return this;
|
||||
}
|
||||
@@ -304,86 +321,94 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return totalPrepaidAmount;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setTotalPrepaidAmount(BigDecimal totalPrepaidAmount) {
|
||||
public Invoice setTotalPrepaidAmount(BigDecimal totalPrepaidAmount) {
|
||||
this.totalPrepaidAmount = totalPrepaidAmount;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getOwnContact() {
|
||||
return ownContact;
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setOwnContact(IZUGFeRDExportableContact ownContact) {
|
||||
this.ownContact = ownContact;
|
||||
public Invoice setOwnContact(Contact ownContact) {
|
||||
this.sender.setContact(ownContact);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return recipient;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
public Invoice setRecipient(TradeParty recipient) {
|
||||
this.recipient = recipient;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setSender(TradeParty sender) {
|
||||
this.sender = sender;
|
||||
if ((sender.getBankDetails()!=null)&&(sender.getBankDetails().size()>0)) {
|
||||
// convert bankdetails
|
||||
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFAllowances() {
|
||||
return ZFAllowances;
|
||||
if (Allowances.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setZFAllowances(IZUGFeRDAllowanceCharge[] ZFAllowances) {
|
||||
this.ZFAllowances = ZFAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFCharges() {
|
||||
return ZFCharges;
|
||||
if (Charges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Charges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setZFCharges(IZUGFeRDAllowanceCharge[] ZFCharges) {
|
||||
this.ZFCharges = ZFCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() {
|
||||
return ZFLogisticsServiceCharges;
|
||||
if (LogisticsServiceCharges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return LogisticsServiceCharges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge[] ZFLogisticsServiceCharges) {
|
||||
this.ZFLogisticsServiceCharges = ZFLogisticsServiceCharges;
|
||||
return this;
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlement[] getTradeSettlement() {
|
||||
|
||||
if (getSender()==null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ((TradeParty)getSender()).getAsTradeSettlement();
|
||||
|
||||
}
|
||||
|
||||
public IZUGFeRDTradeSettlement[] getGetTradeSettlement() {
|
||||
return getTradeSettlement;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setGetTradeSettlement(IZUGFeRDTradeSettlement[] getTradeSettlement) {
|
||||
this.getTradeSettlement = getTradeSettlement;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDPaymentTerms getPaymentTerms() {
|
||||
return paymentTerms;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setPaymentTerms(IZUGFeRDPaymentTerms paymentTerms) {
|
||||
public Invoice setPaymentTerms(IZUGFeRDPaymentTerms paymentTerms) {
|
||||
this.paymentTerms = paymentTerms;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getDeliveryAddress() {
|
||||
public TradeParty getDeliveryAddress() {
|
||||
return deliveryAddress;
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider setDeliveryAddress(IZUGFeRDExportableContact deliveryAddress) {
|
||||
public Invoice setDeliveryAddress(TradeParty deliveryAddress) {
|
||||
this.deliveryAddress = deliveryAddress;
|
||||
return this;
|
||||
}
|
||||
@@ -393,14 +418,20 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
return ZFItems.toArray(new IZUGFeRDExportableItem[0]);
|
||||
}
|
||||
|
||||
public ZUGFeRD2PushProvider addItem(IZUGFeRDExportableItem item) {
|
||||
public Invoice addItem(IZUGFeRDExportableItem item) {
|
||||
ZFItems.add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* checks if all required items are set in order to be able to export it
|
||||
* @return true if all required items are set
|
||||
*/
|
||||
public boolean isValid() {
|
||||
return (dueDate != null) && (ownZIP != null) && (ownStreet != null) && (ownLocation != null) && (ownCountry != null) && (ownTaxID != null) && (ownVATID != null) && (recipient != null);
|
||||
return (dueDate != null) && (sender != null) && (sender.getTaxID() != null) && (sender.getVATID() != null) && (recipient != null);
|
||||
//contact
|
||||
// this.phone = phone;
|
||||
// this.email = email;
|
||||
@@ -410,4 +441,55 @@ public class ZUGFeRD2PushProvider implements IZUGFeRDExportableTransaction {
|
||||
// this.country = country;
|
||||
}
|
||||
|
||||
public Invoice addCharge(IZUGFeRDAllowanceCharge izac) {
|
||||
Charges.add(izac);
|
||||
return this;
|
||||
}
|
||||
public Invoice addAllowance(IZUGFeRDAllowanceCharge izac) {
|
||||
Allowances.add(izac);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setContractReferencedDocument(String s) {
|
||||
contractReferencedDocument=s;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setOccurrenceDate(Date occur) {
|
||||
occurrenceDateFrom=occur;
|
||||
occurrenceDateTo=null;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setOccurrencePeriod(Date start, Date end) {
|
||||
occurrenceDateFrom=start;
|
||||
occurrenceDateTo=end;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getOccurrenceDate() {
|
||||
|
||||
return occurrenceDateFrom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getOccurrencePeriodFrom() {
|
||||
if (occurrenceDateTo!=null) {
|
||||
return occurrenceDateFrom;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public Date getOccurrencePeriodTo() {
|
||||
if (occurrenceDateTo!=null) {
|
||||
return occurrenceDateTo;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,17 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Item implements IZUGFeRDExportableItem {
|
||||
protected BigDecimal price, quantity, tax, grossPrice, lineTotalAmount;
|
||||
protected String id;
|
||||
protected Product product;
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
|
||||
Charges = new ArrayList<IZUGFeRDAllowanceCharge>();
|
||||
|
||||
public Item(Product product, BigDecimal price, BigDecimal quantity) {
|
||||
this.price = price;
|
||||
@@ -82,16 +84,32 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemAllowances() {
|
||||
return null;
|
||||
if (Allowances.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Allowances.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDAllowanceCharge[] getItemCharges() {
|
||||
return null;
|
||||
if (Charges.isEmpty()) {
|
||||
return null;
|
||||
} else
|
||||
return Charges.toArray(new IZUGFeRDAllowanceCharge[0]);
|
||||
}
|
||||
|
||||
public Item setProduct(Product product) {
|
||||
this.product = product;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public Item addCharge(IZUGFeRDAllowanceCharge izac) {
|
||||
Charges.add(izac);
|
||||
return this;
|
||||
}
|
||||
public Item addAllowance(IZUGFeRDAllowanceCharge izac) {
|
||||
Allowances.add(izac);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct;
|
||||
|
||||
205
library/src/main/java/org/mustangproject/TradeParty.java
Normal file
205
library/src/main/java/org/mustangproject/TradeParty.java
Normal file
@@ -0,0 +1,205 @@
|
||||
package org.mustangproject;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableContact;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableTradeParty;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDTradeSettlement;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
|
||||
protected String name, zip, street, location, country;
|
||||
protected String taxID = null, vatID = null;
|
||||
protected String additionalAddress = null;
|
||||
protected ArrayList<BankDetails> bankDetails = new ArrayList<BankDetails>();
|
||||
protected Contact contact = null;
|
||||
|
||||
public TradeParty(String name, String street, String zip, String location, String country) {
|
||||
this.name = name;
|
||||
this.street = street;
|
||||
this.zip = zip;
|
||||
this.location = location;
|
||||
this.country = country;
|
||||
|
||||
}
|
||||
|
||||
public TradeParty(NodeList nodes) {
|
||||
/**
|
||||
* <ram:SellerTradeParty>
|
||||
* <ram:ID>LIEF-987654321</ram:ID>
|
||||
* <ram:Name>Max Mustermann IT GmbH</ram:Name>
|
||||
* <ram:DefinedTradeContact>
|
||||
* <ram:PersonName>Herr Treudiener</ram:PersonName>
|
||||
* <ram:TelephoneUniversalCommunication>
|
||||
* <ram:CompleteNumber>+49 1234-98765-12</ram:CompleteNumber>
|
||||
* </ram:TelephoneUniversalCommunication>
|
||||
* <ram:EmailURIUniversalCommunication>
|
||||
* <ram:URIID>treudiener@max-mustermann-it.de</ram:URIID>
|
||||
* </ram:EmailURIUniversalCommunication>
|
||||
* </ram:DefinedTradeContact>
|
||||
* <ram:PostalTradeAddress>
|
||||
* <ram:PostcodeCode>12345</ram:PostcodeCode>
|
||||
* <ram:LineOne>Musterstraße 1</ram:LineOne>
|
||||
* <ram:CityName>Musterstadt</ram:CityName>
|
||||
* <ram:CountryID>DE</ram:CountryID>
|
||||
* </ram:PostalTradeAddress>
|
||||
* <ram:SpecifiedTaxRegistration>
|
||||
* <ram:ID schemeID="VA">DE123456789</ram:ID>
|
||||
* </ram:SpecifiedTaxRegistration>
|
||||
* </ram:SellerTradeParty>
|
||||
*/
|
||||
if (nodes.getLength() > 0) {
|
||||
|
||||
for (int nodeIndex = 0; nodeIndex < nodes.getLength(); nodeIndex++) {
|
||||
//nodes.item(i).getTextContent())) {
|
||||
Node currentItemNode = nodes.item(nodeIndex);
|
||||
NodeList itemChilds = currentItemNode.getChildNodes();
|
||||
for (int itemChildIndex = 0; itemChildIndex < itemChilds.getLength(); itemChildIndex++) {
|
||||
if (itemChilds.item(itemChildIndex).getNodeName().equals("ram:Name")) {
|
||||
setName(itemChilds.item(itemChildIndex).getTextContent());
|
||||
}
|
||||
if (itemChilds.item(itemChildIndex).getNodeName().equals("ram:PostalTradeAddress")) {
|
||||
NodeList postal = itemChilds.item(itemChildIndex).getChildNodes();
|
||||
for (int postalChildIndex = 0; postalChildIndex < postal.getLength(); postalChildIndex++) {
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:LineOne")) {
|
||||
setStreet(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:LineTwo")) {
|
||||
setAdditionalAddress(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:CityName")) {
|
||||
setLocation(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:PostcodeCode")) {
|
||||
setZIP(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:CountryID")) {
|
||||
setCountry(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public TradeParty setContact(Contact c) {
|
||||
this.contact = c;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TradeParty addBankDetails(BankDetails s) {
|
||||
bankDetails.add(s);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArrayList<BankDetails> getBankDetails() {
|
||||
return bankDetails;
|
||||
}
|
||||
|
||||
public TradeParty addTaxID(String taxID) {
|
||||
this.taxID = taxID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TradeParty addVATID(String vatID) {
|
||||
this.vatID = vatID;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVATID() {
|
||||
return vatID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaxID() {
|
||||
return taxID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public TradeParty setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getZIP() {
|
||||
return zip;
|
||||
}
|
||||
|
||||
public TradeParty setZIP(String zip) {
|
||||
this.zip = zip;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStreet() {
|
||||
return street;
|
||||
}
|
||||
|
||||
public TradeParty setStreet(String street) {
|
||||
this.street = street;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public TradeParty setLocation(String location) {
|
||||
this.location = location;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
|
||||
public TradeParty setCountry(String country) {
|
||||
this.country = country;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getVatID() {
|
||||
return vatID;
|
||||
}
|
||||
|
||||
public String getZip() {
|
||||
return zip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getContact() {
|
||||
return contact;
|
||||
}
|
||||
|
||||
public IZUGFeRDTradeSettlement[] getAsTradeSettlement() {
|
||||
if (bankDetails.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return bankDetails.toArray(new IZUGFeRDTradeSettlement[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAdditionalAddress() {
|
||||
return additionalAddress;
|
||||
}
|
||||
|
||||
public TradeParty setAdditionalAddress(String additionalAddress) {
|
||||
this.additionalAddress = additionalAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,9 +18,10 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public class CustomXMLProvider implements IXMLProvider, IProfileProvider {
|
||||
public class CustomXMLProvider implements IXMLProvider {
|
||||
|
||||
protected byte[] zugferdData;
|
||||
protected Profile profile=Profiles.getByName("EN16931");
|
||||
|
||||
@Override
|
||||
public byte[] getXML() {
|
||||
@@ -37,7 +38,7 @@ public class CustomXMLProvider implements IXMLProvider, IProfileProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans) {
|
||||
public void generateXML(IExportableTransaction trans) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
@@ -49,13 +50,11 @@ public class CustomXMLProvider implements IXMLProvider, IProfileProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfile() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
public Profile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfile(ZUGFeRDConformanceLevel level) {
|
||||
// TODO Auto-generated method stub
|
||||
public void setProfile(Profile level) {
|
||||
profile=level;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public interface IProfileProvider {
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public String getProfile();
|
||||
public interface IAbsoluteValueProvider {
|
||||
|
||||
public BigDecimal getValue();
|
||||
|
||||
public void setProfile(ZUGFeRDConformanceLevel level);
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@ import java.util.Date;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
|
||||
|
||||
public interface IZUGFeRDExportableTransaction {
|
||||
public interface IExportableTransaction {
|
||||
|
||||
/**
|
||||
* appears in /rsm:CrossIndustryDocument/rsm:HeaderExchangedDocument/ram:Name
|
||||
@@ -47,7 +47,7 @@ public interface IZUGFeRDExportableTransaction {
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return Code of Document
|
||||
* @return Code number of Document type, e.g. "380" for invoiceF
|
||||
*/
|
||||
default String getDocumentCode() {
|
||||
return DocumentCodeTypeConstants.INVOICE;
|
||||
@@ -95,13 +95,17 @@ public interface IZUGFeRDExportableTransaction {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getContractReferencedDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* who processed the order
|
||||
* the sender of the invoice
|
||||
*
|
||||
* @return the contact person at the supplier side
|
||||
*/
|
||||
default IZUGFeRDExportableContact getOwnContact() {
|
||||
default IZUGFeRDExportableTradeParty getSender() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -133,7 +137,7 @@ public interface IZUGFeRDExportableTransaction {
|
||||
*
|
||||
* @return the recipient of the invoice
|
||||
*/
|
||||
IZUGFeRDExportableContact getRecipient();
|
||||
IZUGFeRDExportableTradeParty getRecipient();
|
||||
|
||||
|
||||
/**
|
||||
@@ -161,7 +165,11 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return Tax ID (not VAT ID) of the sender
|
||||
*/
|
||||
default String getOwnTaxID() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getTaxID();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +179,11 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return VAT ID (Umsatzsteueridentifikationsnummer) of the sender
|
||||
*/
|
||||
default String getOwnVATID() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getVATID();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,7 +203,11 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return the sender's organisation name
|
||||
*/
|
||||
default String getOwnOrganisationName() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getName();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +217,11 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return sender street address
|
||||
*/
|
||||
default String getOwnStreet() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getStreet();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +231,12 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return sender postal code
|
||||
*/
|
||||
default String getOwnZIP() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getZIP();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +246,12 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return the invoice sender's city
|
||||
*/
|
||||
default String getOwnLocation() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getLocation();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +261,12 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* @return the invoice senders two character country iso code
|
||||
*/
|
||||
default String getOwnCountry() {
|
||||
return null;
|
||||
if (getSender()!=null) {
|
||||
return getSender().getCountry();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -242,16 +277,6 @@ public interface IZUGFeRDExportableTransaction {
|
||||
*/
|
||||
Date getDeliveryDate();
|
||||
|
||||
/**
|
||||
* get delivery date in more specific form. If this and getDeliveryDate() are
|
||||
* specified, this value will be taken
|
||||
*
|
||||
* @return instance holding date and format
|
||||
*/
|
||||
default IZUGFeRDDate getZFDeliveryDate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get main invoice currency used on the invoice
|
||||
@@ -276,7 +301,7 @@ public interface IZUGFeRDExportableTransaction {
|
||||
* get payment terms. if set, getPaymentTermDescription() and getDueDate() are
|
||||
* ignored
|
||||
*
|
||||
* @return
|
||||
* @return the IZUGFeRDPaymentTerms of the invoice
|
||||
*/
|
||||
default IZUGFeRDPaymentTerms getPaymentTerms() {
|
||||
return null;
|
||||
@@ -285,7 +310,7 @@ public interface IZUGFeRDExportableTransaction {
|
||||
/**
|
||||
* returns if a rebate agreements exists
|
||||
*
|
||||
* @return
|
||||
* @return true if a agreement exists
|
||||
*/
|
||||
default boolean rebateAgreementExists() {
|
||||
return false;
|
||||
@@ -393,10 +418,23 @@ public interface IZUGFeRDExportableTransaction {
|
||||
|
||||
/***
|
||||
* delivery address, i.e. ram:ShipToTradeParty (only supported for zf2)
|
||||
* @return
|
||||
* @return the IZUGFeRDExportableTradeParty delivery address
|
||||
*/
|
||||
|
||||
default IZUGFeRDExportableContact getDeliveryAddress() {
|
||||
default IZUGFeRDExportableTradeParty getDeliveryAddress() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default Date getOccurrenceDate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default Date getOccurrencePeriodFrom() {
|
||||
return null;
|
||||
}
|
||||
default Date getOccurrencePeriodTo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,11 +18,14 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class ZUGFeRDExporterFromA1Factory extends ZUGFeRDExporterFromA3Factory implements IExporterFactory {
|
||||
public ZUGFeRDExporterFromA1Factory() {
|
||||
ensurePDFisUpgraded = true;
|
||||
public interface IExporter {
|
||||
|
||||
}
|
||||
public IExporter setTransaction(IExportableTransaction trans) throws IOException;
|
||||
public void export(String ZUGFeRDfilename) throws IOException;
|
||||
public void export(OutputStream output) throws IOException;
|
||||
|
||||
}
|
||||
@@ -24,6 +24,11 @@ public interface IXMLProvider {
|
||||
|
||||
public void setTest();
|
||||
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans);
|
||||
public void generateXML(IExportableTransaction trans);
|
||||
|
||||
public void setProfile(Profile p);
|
||||
|
||||
public Profile getProfile();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,8 @@ import java.math.BigDecimal;
|
||||
*/
|
||||
public interface IZUGFeRDAllowanceCharge {
|
||||
|
||||
BigDecimal getTotalAmount();
|
||||
BigDecimal getTotalAmount(IAbsoluteValueProvider trans);
|
||||
default BigDecimal getPercent() {return null;}
|
||||
|
||||
String getReason();
|
||||
|
||||
@@ -34,4 +35,5 @@ public interface IZUGFeRDAllowanceCharge {
|
||||
return TaxCategoryCodeTypeConstants.STANDARDRATE;
|
||||
}
|
||||
|
||||
public boolean isCharge();
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface IZUGFeRDDate {
|
||||
|
||||
Date getDate();
|
||||
|
||||
default ZUGFeRDDateFormat getFormat() {
|
||||
return ZUGFeRDDateFormat.DATE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,24 +38,6 @@ public interface IZUGFeRDExportableContact {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* customer global identification assigned by the seller
|
||||
*
|
||||
* @return customer identification
|
||||
*/
|
||||
default String getGlobalID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* customer global identification scheme
|
||||
*
|
||||
* @return customer identification
|
||||
*/
|
||||
default String getGlobalIDScheme() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* First and last name of the recipient
|
||||
@@ -69,11 +51,15 @@ public interface IZUGFeRDExportableContact {
|
||||
default String getPhone() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
default String getEMail() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getFax() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Postal code of the recipient
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public interface IZUGFeRDExportableItem {
|
||||
public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
|
||||
IZUGFeRDExportableProduct getProduct();
|
||||
|
||||
@@ -46,6 +46,10 @@ public interface IZUGFeRDExportableItem {
|
||||
*/
|
||||
BigDecimal getPrice();
|
||||
|
||||
@Override
|
||||
default BigDecimal getValue() {
|
||||
return getPrice();
|
||||
}
|
||||
/**
|
||||
* how many get billed
|
||||
*
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* 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 org.mustangproject.TradeParty;
|
||||
|
||||
/**
|
||||
* Mustangproject's ZUGFeRD implementation neccessary interface for ZUGFeRD exporter Licensed under the APLv2
|
||||
*
|
||||
* @author jstaerk
|
||||
* @version 2.0.0
|
||||
* dated 2020-09-12
|
||||
*/
|
||||
|
||||
|
||||
public interface IZUGFeRDExportableTradeParty {
|
||||
|
||||
/**
|
||||
* customer identification assigned by the seller
|
||||
*
|
||||
* @return customer identification
|
||||
*/
|
||||
default String getID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* customer global identification assigned by the seller
|
||||
*
|
||||
* @return customer identification
|
||||
*/
|
||||
default String getGlobalID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* customer global identification scheme
|
||||
*
|
||||
* @return customer identification
|
||||
*/
|
||||
default String getGlobalIDScheme() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
default IZUGFeRDExportableContact getContact() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* First and last name of the recipient
|
||||
*
|
||||
* @return First and last name of the recipient
|
||||
*/
|
||||
default String getName() {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Postal code of the recipient
|
||||
*
|
||||
* @return Postal code of the recipient
|
||||
*/
|
||||
default String getZIP() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* VAT ID (Umsatzsteueridentifikationsnummer) of the contact
|
||||
*
|
||||
* @return VAT ID (Umsatzsteueridentifikationsnummer) of the contact
|
||||
*/
|
||||
default String getVATID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* two-letter country code of the contact
|
||||
*
|
||||
* @return two-letter iso country code of the contact
|
||||
*/
|
||||
default String getCountry() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the city of the contact
|
||||
*
|
||||
* @return Returns the city of the recipient
|
||||
*/
|
||||
default String getLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the street address (street+number) of the contact
|
||||
*
|
||||
* @return street address (street+number) of the contact
|
||||
*/
|
||||
default String getStreet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns additional address information which is display in xml tag "LineTwo"
|
||||
*
|
||||
* @return additional address information
|
||||
*/
|
||||
default String getAdditionalAddress() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* obligatory for sender but not for recipient
|
||||
* @return the tax id as string
|
||||
*/
|
||||
default String getTaxID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,10 +18,12 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public interface IExporterFactory {
|
||||
public interface IZUGFeRDExporter extends Closeable, IExporter {
|
||||
/**
|
||||
* factory: loads a PDF file and returns an appropriate exporter
|
||||
*
|
||||
@@ -29,7 +31,7 @@ public interface IExporterFactory {
|
||||
* @return the generated exporter
|
||||
* @throws IOException if anything is wrong with filename
|
||||
*/
|
||||
public ZUGFeRDExporter load(String pdfFilename) throws IOException;
|
||||
public IZUGFeRDExporter load(String pdfFilename) throws IOException;
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
@@ -39,7 +41,7 @@ public interface IExporterFactory {
|
||||
* @return the generated exporter
|
||||
* @throws IOException (should not happen at all)
|
||||
*/
|
||||
public ZUGFeRDExporter load(byte[] pdfBinary) throws IOException;
|
||||
public IZUGFeRDExporter load(byte[] pdfBinary) throws IOException;
|
||||
|
||||
/**
|
||||
* Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on the
|
||||
@@ -49,18 +51,18 @@ public interface IExporterFactory {
|
||||
* @throws IOException if anything is wrong with inputstream
|
||||
* @return the generated ZUGFeRDExporter
|
||||
*/
|
||||
public ZUGFeRDExporter load(InputStream pdfSource) throws IOException;
|
||||
|
||||
public IExporterFactory setCreator(String creator);
|
||||
|
||||
public IExporterFactory setConformanceLevel(PDFAConformanceLevel newLevel);
|
||||
|
||||
public IExporterFactory setProducer(String producer);
|
||||
|
||||
public IExporterFactory setZUGFeRDVersion(int version);
|
||||
|
||||
public IExporterFactory ignorePDFAErrors();
|
||||
|
||||
public IExporterFactory setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zugferdConformanceLevel);
|
||||
public IZUGFeRDExporter load(InputStream pdfSource) throws IOException;
|
||||
public IZUGFeRDExporter setCreator(String creator);
|
||||
public IZUGFeRDExporter setConformanceLevel(PDFAConformanceLevel newLevel);
|
||||
public IZUGFeRDExporter setProducer(String producer);
|
||||
public IZUGFeRDExporter setZUGFeRDVersion(int version);
|
||||
public boolean ensurePDFIsValid(final DataSource dataSource) throws IOException;
|
||||
public IZUGFeRDExporter setXML(byte[] zugferdData) throws IOException;
|
||||
public IZUGFeRDExporter disableFacturX();
|
||||
// public IZUGFeRDExporter setProfile(Profile zugferdConformanceLevel);
|
||||
public String getNamespaceForVersion(int ver);
|
||||
public String getPrefixForVersion(int ver) ;
|
||||
public IZUGFeRDExporter disableAutoClose(boolean disableAutoClose);
|
||||
public IXMLProvider getProvider();
|
||||
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public interface IZUGFeRDPaymentDiscountTerms {
|
||||
|
||||
BigDecimal getCalculationPercentage();
|
||||
|
||||
IZUGFeRDDate getBaseDate();
|
||||
Date getBaseDate();
|
||||
|
||||
int getBasePeriodMeasure();
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public interface IZUGFeRDPaymentTerms {
|
||||
|
||||
String getDescription();
|
||||
|
||||
IZUGFeRDDate getDueDate();
|
||||
Date getDueDate();
|
||||
|
||||
IZUGFeRDPaymentDiscountTerms getDiscountTerms();
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ public interface IZUGFeRDTradeSettlementDebit extends IZUGFeRDTradeSettlement {
|
||||
|
||||
|
||||
|
||||
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>\n" //$NON-NLS-1$
|
||||
+ " <ram:TypeCode>59</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayerPartyDebtorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:IBANID>"+XMLTools.encodeXML(getIBAN())+"</ram:IBANID>\n" //$NON-NLS-1$
|
||||
+ " </ram:PayerPartyDebtorFinancialAccount>\n"; //$NON-NLS-1$
|
||||
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>\n"
|
||||
+ " <ram:TypeCode>59</ram:TypeCode>\n"
|
||||
+ " <ram:PayerPartyDebtorFinancialAccount>\n"
|
||||
+ " <ram:IBANID>"+XMLTools.encodeXML(getIBAN())+"</ram:IBANID>\n"
|
||||
+ " </ram:PayerPartyDebtorFinancialAccount>\n";
|
||||
|
||||
xml = xml + " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
|
||||
xml = xml + " </ram:SpecifiedTradeSettlementPaymentMeans>\n";
|
||||
return xml;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,26 +43,6 @@ public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* BLZ of the sender
|
||||
*
|
||||
* @return the BLZ code of the recipient sender's bank
|
||||
*/
|
||||
default String getOwnBLZ() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bank name of the sender
|
||||
*
|
||||
* @return the name of the sender's bank
|
||||
*/
|
||||
default String getOwnBankName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IBAN of the sender
|
||||
*
|
||||
@@ -73,32 +53,19 @@ public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IBAN of the sender
|
||||
*
|
||||
* @return the Account Number of the invoice sender's bank account
|
||||
*/
|
||||
default String getOwnKto() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getSettlementXML() {
|
||||
String xml = " <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>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (getOwnKto()!=null) {
|
||||
xml+= " <ram:ProprietaryID>" + XMLTools.encodeXML(getOwnKto()) + "</ram:ProprietaryID>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
}
|
||||
xml+= " </ram:PayeePartyCreditorFinancialAccount>\n" //$NON-NLS-1$
|
||||
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " <ram:BICID>" + XMLTools.encodeXML(getOwnBIC()) + "</ram:BICID>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n" //$NON-NLS-1$
|
||||
String xml = " <ram:SpecifiedTradeSettlementPaymentMeans>\n"
|
||||
+ " <ram:TypeCode>42</ram:TypeCode>\n"
|
||||
+ " <ram:Information>Überweisung</ram:Information>\n"
|
||||
+ " <ram:PayeePartyCreditorFinancialAccount>\n"
|
||||
+ " <ram:IBANID>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>\n"; //$NON-NLS-2$
|
||||
xml+= " </ram:PayeePartyCreditorFinancialAccount>\n"
|
||||
+ " <ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
||||
+ " <ram:BICID>" + XMLTools.encodeXML(getOwnBIC()) + "</ram:BICID>\n" //$NON-NLS-2$
|
||||
// + " <ram:Name>"+trans.getOwnBankName()+"</ram:Name>\n"
|
||||
// //$NON-NLS-2$
|
||||
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n"; //$NON-NLS-1$
|
||||
+ " </ram:PayeeSpecifiedCreditorFinancialInstitution>\n"
|
||||
+ " </ram:SpecifiedTradeSettlementPaymentMeans>\n";
|
||||
return xml;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,19 +4,40 @@ import java.math.BigDecimal;
|
||||
|
||||
public class LineCalc {
|
||||
private BigDecimal totalGross;
|
||||
private BigDecimal price;
|
||||
private BigDecimal priceGross;
|
||||
private BigDecimal itemTotalNetAmount;
|
||||
private BigDecimal itemTotalVATAmount;
|
||||
private BigDecimal allowance = new BigDecimal(0);
|
||||
private BigDecimal charge = new BigDecimal(0);
|
||||
|
||||
public LineCalc(IZUGFeRDExportableItem currentItem) {
|
||||
|
||||
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
||||
for (IZUGFeRDAllowanceCharge allowance : currentItem.getItemAllowances()) {
|
||||
addAllowance(allowance.getTotalAmount(currentItem));
|
||||
}
|
||||
}
|
||||
if (currentItem.getItemCharges() != null && currentItem.getItemCharges().length > 0) {
|
||||
for (IZUGFeRDAllowanceCharge charge : currentItem.getItemCharges()) {
|
||||
addCharge(charge.getTotalAmount(currentItem));
|
||||
}
|
||||
}
|
||||
BigDecimal multiplicator = currentItem.getProduct().getVATPercent().divide(new BigDecimal(100))
|
||||
.add(new BigDecimal(1));
|
||||
priceGross = currentItem.getPrice(); // see https://github.com/ZUGFeRD/mustangproject/issues/159
|
||||
totalGross = currentItem.getQuantity().multiply(currentItem.getPrice()).divide(currentItem.getBasisQuantity())
|
||||
price = priceGross.subtract(allowance).add(charge);
|
||||
totalGross = currentItem.getQuantity().multiply(getPrice()).divide(currentItem.getBasisQuantity())
|
||||
.multiply(multiplicator);
|
||||
itemTotalNetAmount = currentItem.getQuantity().multiply(currentItem.getPrice()).divide(currentItem.getBasisQuantity())
|
||||
itemTotalNetAmount = currentItem.getQuantity().multiply(getPrice()).divide(currentItem.getBasisQuantity())
|
||||
.setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
itemTotalVATAmount = totalGross.subtract(itemTotalNetAmount);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public BigDecimal getItemTotalNetAmount() {
|
||||
@@ -28,12 +49,20 @@ public class LineCalc {
|
||||
}
|
||||
|
||||
public BigDecimal getItemTotalGrossAmount() {
|
||||
return itemTotalVATAmount;
|
||||
return itemTotalNetAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPriceGross() {
|
||||
return priceGross;
|
||||
}
|
||||
|
||||
public void addAllowance(BigDecimal b) {
|
||||
allowance = allowance.add(b);
|
||||
}
|
||||
|
||||
public void addCharge(BigDecimal b) {
|
||||
charge = charge.add(b);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
public class Profile {
|
||||
protected String name, id;
|
||||
|
||||
public Profile(String name, String ID) {
|
||||
this.name = name;
|
||||
this.id = ID;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getXMPName() {
|
||||
if (name.equals("BASICWL")) {
|
||||
return "BASIC WL";
|
||||
} else if (name.equals("EN16931")) {
|
||||
return "EN 16931";
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2018 Jochen Staerk
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class Profiles {
|
||||
static Map<String, Profile> zf2Map = Stream.of(new Object[][]{
|
||||
{"MINIMUM", new Profile("MINIMUM", "urn:factur-x.eu:1p0:minimum")},
|
||||
{"BASICWL", new Profile("BASICWL", "urn:factur-x.eu:1p0:basicwl")},
|
||||
{"BASIC", new Profile("BASIC", "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic")},
|
||||
{"EN16931", new Profile("EN16931", "urn:cen.eu:en16931:2017")},
|
||||
{"EXTENDED", new Profile("EXTENDED", "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended")},
|
||||
{"XRECHNUNG", new Profile("XRECHNUNG", "XRECHNUNG")}
|
||||
|
||||
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1]));
|
||||
static Map<String, Profile> zf1Map = Stream.of(new Object[][]{
|
||||
{"BASIC", new Profile("BASIC", "urn:ferd:CrossIndustryDocument:invoice:1p0:basic")},
|
||||
{"COMFORT", new Profile("COMFORT", "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort")},
|
||||
{"EXTENDED", new Profile("EXTENDED", "urn:ferd:CrossIndustryDocument:invoice:1p0:extended")},
|
||||
|
||||
|
||||
}).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1]));
|
||||
|
||||
|
||||
public static Profile getByName(String name, int version) {
|
||||
Profile result=null;
|
||||
if (version==1) {
|
||||
result=zf1Map.get(name.toUpperCase());
|
||||
} else {
|
||||
result=zf2Map.get(name.toUpperCase());
|
||||
}
|
||||
if (result==null) { throw new RuntimeException("Profile not found"); }
|
||||
return result;
|
||||
}
|
||||
public static Profile getByName(String name) {
|
||||
return getByName(name, ZUGFeRDExporterFromA3.DefaultZUGFeRDVersion);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,6 +56,7 @@ public class VATAmount {
|
||||
|
||||
public void setBasis(BigDecimal basis) {
|
||||
this.basis = basis;
|
||||
|
||||
}
|
||||
|
||||
public BigDecimal getCalculated() {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
||||
public String namespace = null;
|
||||
public String prefix = null;
|
||||
|
||||
protected ZUGFeRDExporter exporter;
|
||||
protected IZUGFeRDExporter exporter;
|
||||
|
||||
|
||||
protected void setZUGFeRDVersion(int ver) {
|
||||
@@ -89,14 +89,14 @@ public class XMPSchemaPDFAExtensions extends PDFAExtensionSchema {
|
||||
return li;
|
||||
}
|
||||
|
||||
public XMPSchemaPDFAExtensions(ZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion) {
|
||||
public XMPSchemaPDFAExtensions(IZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion) {
|
||||
super(metadata);
|
||||
exporter=ze;
|
||||
setZUGFeRDVersion(ZFVersion);
|
||||
attachExtensions(metadata, true);
|
||||
}
|
||||
|
||||
public XMPSchemaPDFAExtensions(ZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion, boolean withZF) {
|
||||
public XMPSchemaPDFAExtensions(IZUGFeRDExporter ze, XMPMetadata metadata, int ZFVersion, boolean withZF) {
|
||||
super(metadata);
|
||||
exporter=ze;
|
||||
setZUGFeRDVersion(ZFVersion);
|
||||
|
||||
@@ -41,17 +41,12 @@ public class XMPSchemaZugferd extends XMPSchema {
|
||||
* @param prefix the xml namespace prefix for the XMP, zf for ZUGFeRD, fx for Factur-X
|
||||
* @param filename the filename of the invoice
|
||||
*/
|
||||
public XMPSchemaZugferd(XMPMetadata metadata, int zfVersion, boolean isFacturX, ZUGFeRDConformanceLevel conformanceLevel, String URN, String prefix, String filename) {
|
||||
public XMPSchemaZugferd(XMPMetadata metadata, int zfVersion, boolean isFacturX, Profile conformanceLevel, String URN, String prefix, String filename) {
|
||||
super(metadata, URN, prefix, "ZUGFeRD Schema");
|
||||
|
||||
setAboutAsSimple("");
|
||||
|
||||
String conformanceLevelValue = conformanceLevel.name();
|
||||
if (conformanceLevelValue.equals("BASICWL")) {
|
||||
conformanceLevelValue = "BASIC WL";
|
||||
} else if (conformanceLevelValue.equals("EN16931")) {
|
||||
conformanceLevelValue = "EN 16931";
|
||||
}
|
||||
String conformanceLevelValue = conformanceLevel.getXMPName();
|
||||
setTextPropertyValue("ConformanceLevel", conformanceLevelValue);
|
||||
setTextPropertyValue("DocumentType", "INVOICE");
|
||||
setTextPropertyValue("DocumentFileName", filename);
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2018 Jochen Staerk
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import org.apache.pdfbox.cos.*;
|
||||
import org.apache.pdfbox.io.IOUtils;
|
||||
import org.apache.pdfbox.pdmodel.*;
|
||||
import org.apache.pdfbox.pdmodel.common.PDMetadata;
|
||||
import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification;
|
||||
import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile;
|
||||
import org.apache.pdfbox.preflight.PreflightDocument;
|
||||
import org.apache.pdfbox.preflight.exception.ValidationException;
|
||||
import org.apache.pdfbox.preflight.parser.PreflightParser;
|
||||
import org.apache.pdfbox.preflight.utils.ByteArrayDataSource;
|
||||
import org.apache.xmpbox.XMPMetadata;
|
||||
import org.apache.xmpbox.schema.AdobePDFSchema;
|
||||
import org.apache.xmpbox.schema.DublinCoreSchema;
|
||||
import org.apache.xmpbox.schema.PDFAIdentificationSchema;
|
||||
import org.apache.xmpbox.schema.XMPBasicSchema;
|
||||
import org.apache.xmpbox.type.BadFieldValueException;
|
||||
import org.apache.xmpbox.xml.XmpSerializer;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import javax.activation.FileDataSource;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import java.io.*;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class XRExporter implements IExporter {
|
||||
IXMLProvider xmlProvider;
|
||||
IExportableTransaction trans;
|
||||
|
||||
public XRExporter() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IExporter setTransaction(IExportableTransaction trans) throws IOException {
|
||||
this.trans=trans;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(String ZUGFeRDfilename) throws IOException {
|
||||
export(new FileOutputStream(new File(ZUGFeRDfilename)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void export(OutputStream output) throws IOException {
|
||||
xmlProvider.generateXML(trans);
|
||||
byte[] bytes=xmlProvider.getXML();
|
||||
output.write(bytes, 0, bytes.length);
|
||||
}
|
||||
}
|
||||
@@ -24,33 +24,27 @@ import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.mustangproject.XMLTools;
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
public class ZUGFeRD1PullProvider extends ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
|
||||
|
||||
//// MAIN CLASS
|
||||
|
||||
protected byte[] zugferdData;
|
||||
private IZUGFeRDExportableTransaction trans;
|
||||
private ZUGFeRDConformanceLevel level;
|
||||
private String paymentTermsDescription;
|
||||
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
protected Profile profile=Profiles.getByName("COMFORT",1);
|
||||
|
||||
@Override
|
||||
public void setProfile(ZUGFeRDConformanceLevel level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
/**
|
||||
* enables the flag to indicate a test invoice in the XML structure
|
||||
@@ -74,6 +68,12 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
return XMLTools.nDigitFormat(value, 4);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Profile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getXML() {
|
||||
|
||||
@@ -100,101 +100,14 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
|
||||
}
|
||||
|
||||
private BigDecimal getTotalPrepaid() {
|
||||
if (trans.getTotalPrepaidAmount() == null) {
|
||||
return new BigDecimal(0);
|
||||
} else {
|
||||
return trans.getTotalPrepaidAmount();
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal getTotalGross() {
|
||||
|
||||
BigDecimal res = getTotal();
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap = getVATPercentAmountMap();
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
res = res.add(amount.getCalculated());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private BigDecimal getTotal() {
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
res = res.add(lc.getItemTotalNetAmount());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* which taxes have been used with which amounts in this transaction, 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
|
||||
*/
|
||||
private HashMap<BigDecimal, VATAmount> getVATPercentAmountMap() {
|
||||
HashMap<BigDecimal, VATAmount> hm = new HashMap<>();
|
||||
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
BigDecimal percent = currentItem.getProduct().getVATPercent();
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
VATAmount itemVATAmount = new VATAmount(lc.getItemTotalNetAmount(), lc.getItemTotalVATAmount(),
|
||||
trans.getDocumentCode());
|
||||
VATAmount current = hm.get(percent);
|
||||
if (current == null) {
|
||||
hm.put(percent, itemVATAmount);
|
||||
} else {
|
||||
hm.put(percent, current.add(itemVATAmount));
|
||||
}
|
||||
}
|
||||
return hm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfile() {
|
||||
return "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort";
|
||||
}
|
||||
|
||||
protected String getContactAsXML(IZUGFeRDExportableContact contact) {
|
||||
String xml = " <ram:Name>" + XMLTools.encodeXML(contact.getName()) + "</ram:Name>\n" //$NON-NLS-2$
|
||||
// + " <DefinedTradeContact>\n"
|
||||
// + " <PersonName>xxx</PersonName>\n"
|
||||
// + " </DefinedTradeContact>\n"
|
||||
+ " <ram:PostalTradeAddress>\n"
|
||||
+ " <ram:PostcodeCode>" + XMLTools.encodeXML(contact.getZIP())
|
||||
+ "</ram:PostcodeCode>\n"
|
||||
+ " <ram:LineOne>" + XMLTools.encodeXML(contact.getStreet())
|
||||
+ "</ram:LineOne>\n";
|
||||
if (trans.getRecipient().getAdditionalAddress() != null) {
|
||||
xml += " <ram:LineTwo>" + XMLTools.encodeXML(contact.getAdditionalAddress())
|
||||
+ "</ram:LineTwo>\n";
|
||||
}
|
||||
xml += " <ram:CityName>" + XMLTools.encodeXML(contact.getLocation())
|
||||
+ "</ram:CityName>\n"
|
||||
+ " <ram:CountryID>" + XMLTools.encodeXML(contact.getCountry())
|
||||
+ "</ram:CountryID>\n"
|
||||
+ " </ram:PostalTradeAddress>\n";
|
||||
if (contact.getVATID() != null) {
|
||||
xml += " <ram:SpecifiedTaxRegistration>\n"
|
||||
+ " <ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(contact.getVATID())
|
||||
+ "</ram:ID>\n"
|
||||
+ " </ram:SpecifiedTaxRegistration>\n";
|
||||
}
|
||||
return xml;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans) {
|
||||
public void generateXML(IExportableTransaction trans) {
|
||||
this.trans = trans;
|
||||
|
||||
boolean hasDueDate=false;
|
||||
String taxCategoryCode="";
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
String exemptionReason="";
|
||||
|
||||
if (trans.getPaymentTermDescription()!=null) {
|
||||
@@ -227,8 +140,11 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ XMLTools.encodeXML(trans.getSubjectNote())+ "</ram:Content>\n"
|
||||
+ "</ram:IncludedNote>\n";
|
||||
}
|
||||
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
String typecode="380";
|
||||
if (trans.getDocumentCode()!=null) {
|
||||
typecode=trans.getDocumentCode();
|
||||
}
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
|
||||
|
||||
+ "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\""
|
||||
// + "
|
||||
@@ -241,13 +157,13 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
||||
//
|
||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
||||
+ " <ram:ID>" + getProfile() + "</ram:ID>\n"
|
||||
+ " <ram:ID>" + getProfile().getID() + "</ram:ID>\n"
|
||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
||||
+ " </rsm:SpecifiedExchangedDocumentContext>\n"
|
||||
+ " <rsm:HeaderExchangedDocument>\n"
|
||||
+ " <ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>\n" //$NON-NLS-2$
|
||||
+ " <ram:Name>RECHNUNG</ram:Name>\n"
|
||||
+ " <ram:TypeCode>380</ram:TypeCode>\n"
|
||||
+ " <ram:TypeCode>"+typecode+"</ram:TypeCode>\n"
|
||||
+ " <ram:IssueDateTime><udt:DateTimeString format=\"102\">"
|
||||
+ zugferdDateFormat.format(trans.getIssueDate()) + "</udt:DateTimeString></ram:IssueDateTime>\n" // date
|
||||
// format
|
||||
@@ -269,25 +185,25 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
xml = xml + " <ram:ID>" + XMLTools.encodeXML(trans.getOwnForeignOrganisationID()) + "</ram:ID>\n";
|
||||
}
|
||||
|
||||
if ((trans.getOwnContact()!=null)&&(trans.getOwnContact().getGlobalID()!=null)&&(trans.getOwnContact().getGlobalIDScheme()!=null)) {
|
||||
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(trans.getOwnContact().getGlobalIDScheme()) + "\">"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getGlobalID()) + "</ram:GlobalID>\n";
|
||||
if ((trans.getSender()!=null)&&(trans.getSender().getGlobalID()!=null)&&(trans.getSender().getGlobalIDScheme()!=null)) {
|
||||
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(trans.getSender().getGlobalIDScheme()) + "\">"
|
||||
+ XMLTools.encodeXML(trans.getSender().getGlobalID()) + "</ram:GlobalID>\n";
|
||||
}
|
||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(trans.getOwnOrganisationName()) + "</ram:Name>\n"; //$NON-NLS-2$
|
||||
|
||||
if (trans.getOwnContact() != null) {
|
||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + XMLTools.encodeXML(trans.getOwnContact().getName())
|
||||
if (trans.getSender().getContact() != null) {
|
||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + XMLTools.encodeXML(trans.getSender().getContact().getName())
|
||||
+ "</ram:PersonName>\n";
|
||||
if (trans.getOwnContact().getPhone() != null) {
|
||||
if (trans.getSender().getContact().getPhone() != null) {
|
||||
|
||||
xml = xml + " <ram:TelephoneUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getPhone()) + "</ram:CompleteNumber>\n"
|
||||
+ XMLTools.encodeXML(trans.getSender().getContact().getPhone()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:TelephoneUniversalCommunication>\n";
|
||||
}
|
||||
if (trans.getOwnContact().getEMail() != null) {
|
||||
if (trans.getSender().getContact().getEMail() != null) {
|
||||
|
||||
xml = xml + " <ram:EmailURIUniversalCommunication>\n" + " <ram:URIID>"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getEMail()) + "</ram:URIID>\n"
|
||||
+ XMLTools.encodeXML(trans.getSender().getContact().getEMail()) + "</ram:URIID>\n"
|
||||
+ " </ram:EmailURIUniversalCommunication>\n";
|
||||
}
|
||||
xml = xml + " </ram:DefinedTradeContact>";
|
||||
@@ -309,7 +225,7 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
// + " <ID>GE2020211</ID>\n"
|
||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
||||
|
||||
xml+=getContactAsXML(trans.getRecipient());
|
||||
xml+= getTradePartyAsXML(trans.getRecipient());
|
||||
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
|
||||
xml = xml + " <ram:SpecifiedTaxRegistration>\n" + " <ram:ID schemeID=\"VA\">"
|
||||
+ XMLTools.encodeXML(trans.getOwnVATID()) + "</ram:ID>\n"
|
||||
@@ -328,19 +244,14 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ " <ram:ApplicableSupplyChainTradeDelivery>\n" ;
|
||||
if (this.trans.getDeliveryAddress()!=null) {
|
||||
xml += "<ram:ShipToTradeParty>"+
|
||||
getContactAsXML(this.trans.getDeliveryAddress())+
|
||||
getTradePartyAsXML(this.trans.getDeliveryAddress())+
|
||||
"</ram:ShipToTradeParty>";
|
||||
}
|
||||
|
||||
xml+= " <ram:ActualDeliverySupplyChainEvent>\n"
|
||||
+ " <ram:OccurrenceDateTime>";
|
||||
|
||||
if (trans.getZFDeliveryDate() != null) {
|
||||
ZUGFeRDDateFormat dateFormat = trans.getZFDeliveryDate().getFormat();
|
||||
Date date = trans.getZFDeliveryDate().getDate();
|
||||
xml += "<udt:DateTimeString format=\"" + dateFormat.getDateTimeType() + "\">"
|
||||
+ dateFormat.getFormatter().format(date) + "</udt:DateTimeString>";
|
||||
} else if (trans.getDeliveryDate() != null) {
|
||||
if (trans.getDeliveryDate() != null) {
|
||||
xml += "<udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(trans.getDeliveryDate())
|
||||
+ "</udt:DateTimeString>";
|
||||
} else {
|
||||
@@ -545,12 +456,17 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
} // $NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfile(Profile p) {
|
||||
profile=p;
|
||||
}
|
||||
|
||||
private String buildPaymentTermsXml() {
|
||||
String paymentTermsXml = "<ram:SpecifiedTradePaymentTerms>";
|
||||
|
||||
IZUGFeRDPaymentTerms paymentTerms = trans.getPaymentTerms();
|
||||
IZUGFeRDPaymentDiscountTerms discountTerms = paymentTerms.getDiscountTerms();
|
||||
IZUGFeRDDate dueDate = paymentTerms.getDueDate();
|
||||
Date dueDate = paymentTerms.getDueDate();
|
||||
if (dueDate != null && discountTerms != null && discountTerms.getBaseDate() != null) {
|
||||
throw new IllegalStateException(
|
||||
"if paymentTerms.dueDate is specified, paymentTerms.discountTerms.baseDate has not to be specified");
|
||||
@@ -558,8 +474,8 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
paymentTermsXml += "<ram:Description>" + paymentTerms.getDescription() + "</ram:Description>";
|
||||
if (dueDate != null) {
|
||||
paymentTermsXml += "<ram:DueDateDateTime>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"" + dueDate.getFormat().getDateTimeType() + "\">"
|
||||
+ dueDate.getFormat().getFormatter().format(dueDate.getDate()) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"102\">"
|
||||
+ zugferdDateFormat.format(dueDate.getDate()) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "</ram:DueDateDateTime>";
|
||||
}
|
||||
|
||||
@@ -572,10 +488,9 @@ public class ZUGFeRD1PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ "</ram:CalculationPercent>";
|
||||
|
||||
if (discountTerms.getBaseDate() != null) {
|
||||
Date baseDate = discountTerms.getBaseDate().getDate();
|
||||
ZUGFeRDDateFormat baseDateFormat = discountTerms.getBaseDate().getFormat();
|
||||
Date baseDate = discountTerms.getBaseDate();
|
||||
paymentTermsXml += "<ram:BasisDateTime>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"" + baseDateFormat.getDateTimeType() + "\">" + baseDateFormat.getFormatter().format(baseDate) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(baseDate) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "</ram:BasisDateTime>";
|
||||
|
||||
paymentTermsXml += "<ram:BasisPeriodMeasure unitCode=\"" + discountTerms.getBasePeriodUnitCode() + "\">"
|
||||
|
||||
@@ -1,28 +1,29 @@
|
||||
/** **********************************************************************
|
||||
*
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*********************************************************************** */
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -34,21 +35,18 @@ import org.dom4j.DocumentException;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.XMLTools;
|
||||
|
||||
public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
public class ZUGFeRD2PullProvider implements IXMLProvider, IAbsoluteValueProvider {
|
||||
|
||||
//// MAIN CLASS
|
||||
|
||||
protected SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
protected byte[] zugferdData;
|
||||
private IZUGFeRDExportableTransaction trans;
|
||||
private ZUGFeRDConformanceLevel level;
|
||||
protected IExportableTransaction trans;
|
||||
private String paymentTermsDescription;
|
||||
protected Profile profile = Profiles.getByName("EN16931");
|
||||
|
||||
@Override
|
||||
public void setProfile(ZUGFeRDConformanceLevel level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
/**
|
||||
* enables the flag to indicate a test invoice in the XML structure
|
||||
@@ -99,7 +97,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
|
||||
}
|
||||
|
||||
private BigDecimal getTotalPrepaid() {
|
||||
//move
|
||||
protected BigDecimal getTotalPrepaid() {
|
||||
if (trans.getTotalPrepaidAmount() == null) {
|
||||
return new BigDecimal(0);
|
||||
} else {
|
||||
@@ -107,9 +106,9 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal getTotalGross() {
|
||||
protected BigDecimal getTotalGross() {
|
||||
|
||||
BigDecimal res = getTotal();
|
||||
BigDecimal res = getTaxBasis();
|
||||
HashMap<BigDecimal, VATAmount> VATPercentAmountMap = getVATPercentAmountMap();
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
VATAmount amount = VATPercentAmountMap.get(currentTaxPercent);
|
||||
@@ -118,23 +117,50 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
return res;
|
||||
}
|
||||
|
||||
private BigDecimal getTotal() {
|
||||
protected BigDecimal getCharges() {
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
IZUGFeRDAllowanceCharge[] charges = trans.getZFCharges();
|
||||
if ((charges != null) && (charges.length > 0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentCharge : charges) {
|
||||
res = res.add(currentCharge.getTotalAmount(this));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected BigDecimal getAllowances() {
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
IZUGFeRDAllowanceCharge[] allowances = trans.getZFAllowances();
|
||||
if ((allowances != null) && (allowances.length > 0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentAllowance : allowances) {
|
||||
res = res.add(currentAllowance.getTotalAmount(this));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected BigDecimal getTotal() {
|
||||
BigDecimal res = new BigDecimal(0);
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
LineCalc lc = new LineCalc(currentItem);
|
||||
res = res.add(lc.getItemTotalNetAmount());
|
||||
res = res.add(lc.getItemTotalGrossAmount());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
protected BigDecimal getTaxBasis() {
|
||||
BigDecimal res = getTotal().add(getCharges()).subtract(getAllowances());
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* which taxes have been used with which amounts in this transaction, 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
|
||||
* 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
|
||||
*/
|
||||
private HashMap<BigDecimal, VATAmount> getVATPercentAmountMap() {
|
||||
protected HashMap<BigDecimal, VATAmount> getVATPercentAmountMap() {
|
||||
HashMap<BigDecimal, VATAmount> hm = new HashMap<>();
|
||||
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
@@ -149,61 +175,147 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
hm.put(percent, current.add(itemVATAmount));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IZUGFeRDAllowanceCharge[] charges = trans.getZFCharges();
|
||||
if ((charges != null) && (charges.length > 0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentCharge : charges) {
|
||||
VATAmount theAmount = hm.get(currentCharge.getTaxPercent());
|
||||
if (theAmount == null) {
|
||||
theAmount = new VATAmount(new BigDecimal(0), new BigDecimal(0), "S");
|
||||
}
|
||||
theAmount.setBasis(theAmount.getBasis().add(currentCharge.getTotalAmount(this)));
|
||||
BigDecimal factor = currentCharge.getTaxPercent().divide(new BigDecimal(100));
|
||||
theAmount.setCalculated(theAmount.getBasis().multiply(factor));
|
||||
hm.put(currentCharge.getTaxPercent(), theAmount);
|
||||
}
|
||||
}
|
||||
IZUGFeRDAllowanceCharge[] allowances = trans.getZFAllowances();
|
||||
if ((allowances != null) && (allowances.length > 0)) {
|
||||
for (IZUGFeRDAllowanceCharge currentAllowance : allowances) {
|
||||
VATAmount theAmount = hm.get(currentAllowance.getTaxPercent());
|
||||
if (theAmount == null) {
|
||||
theAmount = new VATAmount(new BigDecimal(0), new BigDecimal(0), "S");
|
||||
}
|
||||
theAmount.setBasis(theAmount.getBasis().subtract(currentAllowance.getTotalAmount(this)));
|
||||
BigDecimal factor = currentAllowance.getTaxPercent().divide(new BigDecimal(100));
|
||||
theAmount.setCalculated(theAmount.getBasis().multiply(factor));
|
||||
|
||||
hm.put(currentAllowance.getTaxPercent(), theAmount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return hm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProfile() {
|
||||
// return "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2";
|
||||
return "urn:cen.eu:en16931:2017";
|
||||
public Profile getProfile() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
protected String getContactAsXML(IZUGFeRDExportableContact contact) {
|
||||
String xml = " <ram:Name>" + XMLTools.encodeXML(contact.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>" + XMLTools.encodeXML(contact.getZIP()) //$NON-NLS-1$
|
||||
+ "</ram:PostcodeCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineOne>" + XMLTools.encodeXML(contact.getStreet()) //$NON-NLS-1$
|
||||
+ "</ram:LineOne>\n"; //$NON-NLS-1$
|
||||
if (trans.getRecipient().getAdditionalAddress() != null) {
|
||||
xml += " <ram:LineTwo>" + XMLTools.encodeXML(contact.getAdditionalAddress()) //$NON-NLS-1$
|
||||
+ "</ram:LineTwo>\n"; //$NON-NLS-1$
|
||||
protected String getTradePartyAsXML(IZUGFeRDExportableTradeParty party) {
|
||||
String xml = "";
|
||||
// According EN16931 either GlobalID or seller assigned ID might be present for BuyerTradeParty
|
||||
// and ShipToTradeParty, but not both. Prefer seller assigned ID for now.
|
||||
if (party.getID() != null) {
|
||||
xml += " <ram:ID>" + XMLTools.encodeXML(party.getID()) + "</ram:ID>\n";
|
||||
} else if ((party.getGlobalIDScheme() != null) && (party.getGlobalID() != null)) {
|
||||
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(party.getGlobalIDScheme()) + "\">"
|
||||
+ XMLTools.encodeXML(party.getGlobalID()) + "</ram:GlobalID>\n";
|
||||
}
|
||||
xml += " <ram:CityName>" + XMLTools.encodeXML(contact.getLocation()) //$NON-NLS-1$
|
||||
+ "</ram:CityName>\n" //$NON-NLS-1$
|
||||
+ " <ram:CountryID>" + XMLTools.encodeXML(contact.getCountry()) //$NON-NLS-1$
|
||||
+ "</ram:CountryID>\n" //$NON-NLS-1$
|
||||
+ " </ram:PostalTradeAddress>\n"; //$NON-NLS-1$
|
||||
if (contact.getVATID() != null) {
|
||||
xml += " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(contact.getVATID()) //$NON-NLS-1$
|
||||
+ "</ram:ID>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTaxRegistration>\n"; //$NON-NLS-1$
|
||||
xml += " <ram:Name>" + XMLTools.encodeXML(party.getName()) + "</ram:Name>\n"; //$NON-NLS-2$
|
||||
|
||||
if (party.getContact() != null) {
|
||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + XMLTools.encodeXML(party.getContact().getName())
|
||||
+ "</ram:PersonName>\n";
|
||||
if (party.getContact().getPhone() != null) {
|
||||
|
||||
xml = xml + " <ram:TelephoneUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
||||
+ XMLTools.encodeXML(party.getContact().getPhone()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:TelephoneUniversalCommunication>\n";
|
||||
}
|
||||
|
||||
if (party.getContact().getFax() != null) {
|
||||
|
||||
xml = xml + " <ram:FaxUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
||||
+ XMLTools.encodeXML(party.getContact().getFax()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:FaxUniversalCommunication>\n";
|
||||
}
|
||||
if (party.getContact().getEMail() != null) {
|
||||
|
||||
xml = xml + " <ram:EmailURIUniversalCommunication>\n" + " <ram:URIID>"
|
||||
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>\n"
|
||||
+ " </ram:EmailURIUniversalCommunication>\n";
|
||||
}
|
||||
|
||||
xml = xml + " </ram:DefinedTradeContact>";
|
||||
|
||||
}
|
||||
xml += " <ram:PostalTradeAddress>\n"
|
||||
+ " <ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
|
||||
+ "</ram:PostcodeCode>\n"
|
||||
+ " <ram:LineOne>" + XMLTools.encodeXML(party.getStreet())
|
||||
+ "</ram:LineOne>\n";
|
||||
if (party.getAdditionalAddress() != null) {
|
||||
xml += " <ram:LineTwo>" + XMLTools.encodeXML(party.getAdditionalAddress())
|
||||
+ "</ram:LineTwo>\n";
|
||||
}
|
||||
xml += " <ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
||||
+ "</ram:CityName>\n"
|
||||
+ " <ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
||||
+ "</ram:CountryID>\n"
|
||||
+ " </ram:PostalTradeAddress>\n";
|
||||
if (party.getVATID() != null) {
|
||||
xml += " <ram:SpecifiedTaxRegistration>\n"
|
||||
+ " <ram:ID schemeID=\"VA\">" + XMLTools.encodeXML(party.getVATID())
|
||||
+ "</ram:ID>\n"
|
||||
+ " </ram:SpecifiedTaxRegistration>\n";
|
||||
}
|
||||
if (party.getTaxID() != null) {
|
||||
xml += " <ram:SpecifiedTaxRegistration>\n"
|
||||
+ " <ram:ID schemeID=\"FC\">" + XMLTools.encodeXML(party.getTaxID())
|
||||
+ "</ram:ID>\n"
|
||||
+ " </ram:SpecifiedTaxRegistration>\n";
|
||||
|
||||
}
|
||||
return xml;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(IZUGFeRDExportableTransaction trans) {
|
||||
this.trans = trans;
|
||||
|
||||
boolean hasDueDate=false;
|
||||
String taxCategoryCode="";
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
|
||||
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
|
||||
String exemptionReason="";
|
||||
|
||||
if (trans.getPaymentTermDescription()!=null) {
|
||||
paymentTermsDescription=trans.getPaymentTermDescription();
|
||||
protected String getAllowanceChargeStr(IZUGFeRDAllowanceCharge allowance, IAbsoluteValueProvider item) {
|
||||
String percentage = "";
|
||||
String chargeIndicator = "false";
|
||||
if (allowance.getPercent() != null) {
|
||||
percentage = "<ram:CalculationPercent>" + allowance.getPercent() + "</ram:CalculationPercent>";
|
||||
percentage += "<ram:BasisAmount>" + item.getValue() + "</ram:BasisAmount>";
|
||||
}
|
||||
if (allowance.isCharge()) {
|
||||
chargeIndicator = "true";
|
||||
}
|
||||
|
||||
if (paymentTermsDescription==null) {
|
||||
paymentTermsDescription= "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
|
||||
|
||||
String allowanceChargeStr = "<ram:AppliedTradeAllowanceCharge><ram:ChargeIndicator><udt:Indicator>" + chargeIndicator + "</udt:Indicator></ram:ChargeIndicator>" + percentage + "<ram:ActualAmount>" + priceFormat(allowance.getTotalAmount(item)) + "</ram:ActualAmount></ram:AppliedTradeAllowanceCharge>";
|
||||
return allowanceChargeStr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateXML(IExportableTransaction trans) {
|
||||
this.trans = trans;
|
||||
|
||||
boolean hasDueDate = false;
|
||||
String taxCategoryCode = "";
|
||||
SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
|
||||
|
||||
String exemptionReason = "";
|
||||
|
||||
if (trans.getPaymentTermDescription() != null) {
|
||||
paymentTermsDescription = trans.getPaymentTermDescription();
|
||||
}
|
||||
|
||||
if (paymentTermsDescription == null) {
|
||||
paymentTermsDescription = "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
|
||||
|
||||
}
|
||||
|
||||
String senderReg = "";
|
||||
@@ -222,202 +334,178 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
}
|
||||
|
||||
String subjectNote = "";
|
||||
if (trans.getSubjectNote()!=null) {
|
||||
if (trans.getSubjectNote() != null) {
|
||||
subjectNote = "<ram:IncludedNote>\n" + " <ram:Content>"
|
||||
+ XMLTools.encodeXML(trans.getSubjectNote())+ "</ram:Content>\n"
|
||||
+ XMLTools.encodeXML(trans.getSubjectNote()) + "</ram:Content>\n"
|
||||
+ "</ram:IncludedNote>\n";
|
||||
}
|
||||
|
||||
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" //$NON-NLS-1$
|
||||
String typecode = "380";
|
||||
if (trans.getDocumentCode() != null) {
|
||||
typecode = trans.getDocumentCode();
|
||||
}
|
||||
String xml = "<?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\""
|
||||
// + "
|
||||
// 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:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100\">\n"
|
||||
+ " <rsm:ExchangedDocumentContext>\n"
|
||||
// + "
|
||||
// <ram:TestIndicator><udt:Indicator>"+testBooleanStr+"</udt:Indicator></ram:TestIndicator>\n"
|
||||
// //$NON-NLS-1$
|
||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID>" + getProfile() + "</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>" + XMLTools.encodeXML(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\">" //$NON-NLS-1$
|
||||
+ zugferdDateFormat.format(trans.getIssueDate()) + "</udt:DateTimeString></ram:IssueDateTime>\n" // date //$NON-NLS-1$
|
||||
// format
|
||||
// was
|
||||
// 20130605
|
||||
//
|
||||
+ " <ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
||||
+ " <ram:ID>" + getProfile().getID() + "</ram:ID>\n"
|
||||
+ " </ram:GuidelineSpecifiedDocumentContextParameter>\n"
|
||||
+ " </rsm:ExchangedDocumentContext>\n"
|
||||
+ " <rsm:ExchangedDocument>\n"
|
||||
+ " <ram:ID>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:ID>\n" //$NON-NLS-2$
|
||||
// + " <ram:Name>RECHNUNG</ram:Name>\n"
|
||||
// + " <ram:TypeCode>380</ram:TypeCode>\n"
|
||||
+ " <ram:TypeCode>" + typecode + "</ram:TypeCode>\n"
|
||||
+ " <ram:IssueDateTime><udt:DateTimeString format=\"102\">"
|
||||
+ zugferdDateFormat.format(trans.getIssueDate()) + "</udt:DateTimeString></ram:IssueDateTime>\n" // date
|
||||
// format
|
||||
// was
|
||||
// 20130605
|
||||
+ subjectNote
|
||||
+ rebateAgreement
|
||||
+ senderReg
|
||||
|
||||
+ " </rsm:ExchangedDocument>\n" //$NON-NLS-1$
|
||||
+ " <rsm:SupplyChainTradeTransaction>\n"; //$NON-NLS-1$
|
||||
+ " </rsm:ExchangedDocument>\n"
|
||||
+ " <rsm:SupplyChainTradeTransaction>\n";
|
||||
int lineID = 0;
|
||||
for (IZUGFeRDExportableItem currentItem : trans.getZFItems()) {
|
||||
lineID++;
|
||||
taxCategoryCode=currentItem.getProduct().getTaxCategoryCode();
|
||||
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
||||
exemptionReason="<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
||||
taxCategoryCode = currentItem.getProduct().getTaxCategoryCode();
|
||||
if (currentItem.getProduct().getTaxExemptionReason() != null) {
|
||||
exemptionReason = "<ram:ExemptionReason>" + XMLTools.encodeXML(currentItem.getProduct().getTaxExemptionReason()) + "</ram:ExemptionReason>";
|
||||
}
|
||||
|
||||
|
||||
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"
|
||||
xml = xml + " <ram:IncludedSupplyChainTradeLineItem>\n" +
|
||||
" <ram:AssociatedDocumentLineDocument>\n"
|
||||
+ " <ram:LineID>" + lineID + "</ram:LineID>\n" //$NON-NLS-2$
|
||||
+ " </ram:AssociatedDocumentLineDocument>\n"
|
||||
+ " <ram:SpecifiedTradeProduct>\n";
|
||||
// + " <GlobalID schemeID=\"0160\">4012345001235</GlobalID>\n"
|
||||
if (currentItem.getProduct().getSellerAssignedID() != null) {
|
||||
xml = xml + " <ram:SellerAssignedID>"
|
||||
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>\n";
|
||||
xml = xml + " <ram:SellerAssignedID>"
|
||||
+ XMLTools.encodeXML(currentItem.getProduct().getSellerAssignedID()) + "</ram:SellerAssignedID>\n";
|
||||
}
|
||||
if (currentItem.getProduct().getBuyerAssignedID() != null) {
|
||||
xml = xml + " <ram:BuyerAssignedID>"
|
||||
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>\n";
|
||||
xml = xml + " <ram:BuyerAssignedID>"
|
||||
+ XMLTools.encodeXML(currentItem.getProduct().getBuyerAssignedID()) + "</ram:BuyerAssignedID>\n";
|
||||
}
|
||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription()) //$NON-NLS-1$
|
||||
+ "</ram:Description>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedTradeProduct>\n" //$NON-NLS-1$
|
||||
String allowanceChargeStr = "";
|
||||
if (currentItem.getItemAllowances() != null && currentItem.getItemAllowances().length > 0) {
|
||||
for (IZUGFeRDAllowanceCharge allowance : currentItem.getItemAllowances()) {
|
||||
allowanceChargeStr += getAllowanceChargeStr(allowance, currentItem);
|
||||
}
|
||||
}
|
||||
if (currentItem.getItemCharges() != null && currentItem.getItemCharges().length > 0) {
|
||||
for (IZUGFeRDAllowanceCharge charge : currentItem.getItemCharges()) {
|
||||
allowanceChargeStr += getAllowanceChargeStr(charge, currentItem);
|
||||
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:GrossPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " <ram:ChargeAmount>" + priceFormat(lc.getPriceGross()) //$NON-NLS-1$
|
||||
+ "</ram:ChargeAmount>\n" //$NON-NLS-1$ //currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) //$NON-NLS-1$
|
||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) +"</ram:BasisQuantity>\n" //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(currentItem.getProduct().getName()) + "</ram:Name>\n" //$NON-NLS-2$
|
||||
+ " <ram:Description>" + XMLTools.encodeXML(currentItem.getProduct().getDescription())
|
||||
+ "</ram:Description>\n"
|
||||
+ " </ram:SpecifiedTradeProduct>\n"
|
||||
|
||||
+ " <ram:SpecifiedLineTradeAgreement>\n"
|
||||
+ " <ram:GrossPriceProductTradePrice>\n"
|
||||
+ " <ram:ChargeAmount>" + priceFormat(lc.getPriceGross())
|
||||
+ "</ram:ChargeAmount>\n" //currencyID=\"EUR\"
|
||||
+ "<ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
||||
+ allowanceChargeStr
|
||||
// + " <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()) //$NON-NLS-1$
|
||||
+ "</ram:ChargeAmount>\n" //$NON-NLS-1$ // currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) //$NON-NLS-1$
|
||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) +"</ram:BasisQuantity>\n" //$NON-NLS-1$
|
||||
+ " </ram:NetPriceProductTradePrice>\n" //$NON-NLS-1$
|
||||
+ " </ram:SpecifiedLineTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " </ram:GrossPriceProductTradePrice>\n"
|
||||
+ " <ram:NetPriceProductTradePrice>\n"
|
||||
+ " <ram:ChargeAmount>" + priceFormat(lc.getPrice())
|
||||
+ "</ram:ChargeAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:BasisQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit())
|
||||
+ "\">" + quantityFormat(currentItem.getBasisQuantity()) + "</ram:BasisQuantity>\n"
|
||||
+ " </ram:NetPriceProductTradePrice>\n"
|
||||
+ " </ram:SpecifiedLineTradeAgreement>\n"
|
||||
|
||||
+ " <ram:SpecifiedLineTradeDelivery>\n" //$NON-NLS-1$
|
||||
+ " <ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>\n" //$NON-NLS-1$
|
||||
+ " </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:SpecifiedLineTradeDelivery>\n"
|
||||
+ " <ram:BilledQuantity unitCode=\"" + XMLTools.encodeXML(currentItem.getProduct().getUnit()) + "\">" //$NON-NLS-2$
|
||||
+ quantityFormat(currentItem.getQuantity()) + "</ram:BilledQuantity>\n"
|
||||
+ " </ram:SpecifiedLineTradeDelivery>\n"
|
||||
+ " <ram:SpecifiedLineTradeSettlement>\n"
|
||||
+ " <ram:ApplicableTradeTax>\n"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||
+ exemptionReason
|
||||
+ " <ram:CategoryCode>"+currentItem.getProduct().getTaxCategoryCode()+"</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
|
||||
+ " <ram:RateApplicablePercent>" //$NON-NLS-1$
|
||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n" //$NON-NLS-1$
|
||||
+ " </ram:ApplicableTradeTax>\n" //$NON-NLS-1$
|
||||
+ " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n" //$NON-NLS-1$
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount()) //$NON-NLS-1$
|
||||
+ "</ram:LineTotalAmount>\n" //$NON-NLS-1$ // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n"; //$NON-NLS-1$
|
||||
if (currentItem.getAdditionalReferencedDocumentID()!=null) {
|
||||
xml=xml + " <ram:AdditionalReferencedDocument><ram:IssuerAssignedID>"+currentItem.getAdditionalReferencedDocumentID()+"</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
xml=xml + " </ram:SpecifiedLineTradeSettlement>\n" //$NON-NLS-1$
|
||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n"; //$NON-NLS-1$
|
||||
+ " <ram:CategoryCode>" + currentItem.getProduct().getTaxCategoryCode() + "</ram:CategoryCode>\n"
|
||||
|
||||
+ " <ram:RateApplicablePercent>"
|
||||
+ vatFormat(currentItem.getProduct().getVATPercent()) + "</ram:RateApplicablePercent>\n"
|
||||
+ " </ram:ApplicableTradeTax>\n"
|
||||
+ " <ram:SpecifiedTradeSettlementLineMonetarySummation>\n"
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(lc.getItemTotalNetAmount())
|
||||
+ "</ram:LineTotalAmount>\n" // currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementLineMonetarySummation>\n";
|
||||
if (currentItem.getAdditionalReferencedDocumentID() != null) {
|
||||
xml = xml + " <ram:AdditionalReferencedDocument><ram:IssuerAssignedID>" + currentItem.getAdditionalReferencedDocumentID() + "</ram:IssuerAssignedID><ram:TypeCode>130</ram:TypeCode></ram:AdditionalReferencedDocument>\n";
|
||||
|
||||
}
|
||||
xml = xml + " </ram:SpecifiedLineTradeSettlement>\n"
|
||||
+ " </ram:IncludedSupplyChainTradeLineItem>\n";
|
||||
|
||||
}
|
||||
|
||||
xml = xml + " <ram:ApplicableHeaderTradeAgreement>\n"; //$NON-NLS-1$
|
||||
xml = xml + " <ram:ApplicableHeaderTradeAgreement>\n";
|
||||
if (trans.getReferenceNumber() != null) {
|
||||
xml = xml + " <ram:BuyerReference>" + XMLTools.encodeXML(trans.getReferenceNumber()) + "</ram:BuyerReference>\n";
|
||||
|
||||
}
|
||||
xml = xml + " <ram:SellerTradeParty>\n"; //$NON-NLS-1$
|
||||
if (trans.getOwnForeignOrganisationID()!=null) {
|
||||
xml = xml + " <ram:ID>" + XMLTools.encodeXML(trans.getOwnForeignOrganisationID()) + "</ram:ID>\n";
|
||||
}
|
||||
|
||||
if ((trans.getOwnContact()!=null)&&(trans.getOwnContact().getGlobalID()!=null)&&(trans.getOwnContact().getGlobalIDScheme()!=null)) {
|
||||
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(trans.getOwnContact().getGlobalIDScheme()) + "\">"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getGlobalID()) + "</ram:GlobalID>\n";
|
||||
}
|
||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(trans.getOwnOrganisationName()) + "</ram:Name>\n"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
xml = xml + " <ram:SellerTradeParty>\n"
|
||||
+ getTradePartyAsXML(trans.getSender())
|
||||
+ " </ram:SellerTradeParty>\n"
|
||||
+ " <ram:BuyerTradeParty>\n";
|
||||
// + " <ID>GE2020211</ID>\n"
|
||||
// + " <GlobalID schemeID=\"0088\">4000001987658</GlobalID>\n"
|
||||
|
||||
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
|
||||
|
||||
xml = xml + " <ram:SpecifiedLegalOrganization>\n" + " <ram:ID>"
|
||||
+ XMLTools.encodeXML(trans.getOwnVATID()) + "</ram:ID>\n" + " <ram:TradingBusinessName>"
|
||||
+ XMLTools.encodeXML(trans.getOwnOrganisationName()) + "</ram:TradingBusinessName>\n"
|
||||
+ " </ram:SpecifiedLegalOrganization>";
|
||||
xml += getTradePartyAsXML(trans.getRecipient());
|
||||
xml += " </ram:BuyerTradeParty>\n";
|
||||
|
||||
if (trans.getBuyerOrderReferencedDocumentID() != null) {
|
||||
xml = xml + " <ram:BuyerOrderReferencedDocument>\n"
|
||||
+ " <ram:IssuerAssignedID>"
|
||||
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n"
|
||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
||||
}
|
||||
if (trans.getContractReferencedDocument() != null) {
|
||||
xml = xml + " <ram:ContractReferencedDocument>\n"
|
||||
+ " <ram:IssuerAssignedID>"
|
||||
+ XMLTools.encodeXML(trans.getContractReferencedDocument()) + "</ram:IssuerAssignedID>\n"
|
||||
+ " </ram:ContractReferencedDocument>\n";
|
||||
}
|
||||
|
||||
if (trans.getOwnContact() != null) {
|
||||
xml = xml + "<ram:DefinedTradeContact>\n" + " <ram:PersonName>" + XMLTools.encodeXML(trans.getOwnContact().getName())
|
||||
+ "</ram:PersonName>\n";
|
||||
if (trans.getOwnContact().getPhone() != null) {
|
||||
|
||||
xml = xml + " <ram:TelephoneUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getPhone()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:TelephoneUniversalCommunication>\n";
|
||||
}
|
||||
if (trans.getOwnContact().getEMail() != null) {
|
||||
|
||||
xml = xml + " <ram:EmailURIUniversalCommunication>\n" + " <ram:URIID>"
|
||||
+ XMLTools.encodeXML(trans.getOwnContact().getEMail()) + "</ram:URIID>\n"
|
||||
+ " </ram:EmailURIUniversalCommunication>\n";
|
||||
}
|
||||
xml = xml + " </ram:DefinedTradeContact>";
|
||||
|
||||
xml = xml + " </ram:ApplicableHeaderTradeAgreement>\n"
|
||||
+ " <ram:ApplicableHeaderTradeDelivery>\n";
|
||||
if (this.trans.getDeliveryAddress() != null) {
|
||||
xml += "<ram:ShipToTradeParty>" +
|
||||
getTradePartyAsXML(this.trans.getDeliveryAddress()) +
|
||||
"</ram:ShipToTradeParty>";
|
||||
}
|
||||
|
||||
xml = xml + " <ram:PostalTradeAddress>\n" + " <ram:PostcodeCode>"
|
||||
+ XMLTools.encodeXML(trans.getOwnZIP()) + "</ram:PostcodeCode>\n" + " <ram:LineOne>"
|
||||
+ XMLTools.encodeXML(trans.getOwnStreet()) + "</ram:LineOne>\n" + " <ram:CityName>" + XMLTools.encodeXML(trans.getOwnLocation())
|
||||
+ "</ram:CityName>\n" + " <ram:CountryID>" + XMLTools.encodeXML(trans.getOwnCountry())
|
||||
+ "</ram:CountryID>\n" + " </ram:PostalTradeAddress>\n"
|
||||
+ " <ram:SpecifiedTaxRegistration>\n" //$NON-NLS-1$
|
||||
+ " <ram:ID schemeID=\"FC\">" + XMLTools.encodeXML(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\">" + XMLTools.encodeXML(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"
|
||||
|
||||
xml+=getContactAsXML(trans.getRecipient());
|
||||
xml += " </ram:BuyerTradeParty>\n"; //$NON-NLS-1$
|
||||
|
||||
if (trans.getBuyerOrderReferencedDocumentID()!=null) {
|
||||
xml = xml + " <ram:BuyerOrderReferencedDocument>\n" //$NON-NLS-1$
|
||||
+ " <ram:IssuerAssignedID>" //$NON-NLS-1$
|
||||
+ XMLTools.encodeXML(trans.getBuyerOrderReferencedDocumentID()) + "</ram:IssuerAssignedID>\n" //$NON-NLS-1$
|
||||
+ " </ram:BuyerOrderReferencedDocument>\n";
|
||||
}
|
||||
xml = xml + " </ram:ApplicableHeaderTradeAgreement>\n" //$NON-NLS-1$
|
||||
+ " <ram:ApplicableHeaderTradeDelivery>\n" ;
|
||||
if (this.trans.getDeliveryAddress()!=null) {
|
||||
xml += "<ram:ShipToTradeParty>"+
|
||||
getContactAsXML(this.trans.getDeliveryAddress())+
|
||||
"</ram:ShipToTradeParty>";
|
||||
}
|
||||
|
||||
xml+= " <ram:ActualDeliverySupplyChainEvent>\n"
|
||||
xml += " <ram:ActualDeliverySupplyChainEvent>\n"
|
||||
+ " <ram:OccurrenceDateTime>";
|
||||
|
||||
if (trans.getZFDeliveryDate() != null) {
|
||||
ZUGFeRDDateFormat dateFormat = trans.getZFDeliveryDate().getFormat();
|
||||
Date date = trans.getZFDeliveryDate().getDate();
|
||||
xml += "<udt:DateTimeString format=\"" + dateFormat.getDateTimeType() + "\">"
|
||||
+ dateFormat.getFormatter().format(date) + "</udt:DateTimeString>";
|
||||
} else if (trans.getDeliveryDate() != null) {
|
||||
if (trans.getDeliveryDate() != null) {
|
||||
xml += "<udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(trans.getDeliveryDate())
|
||||
+ "</udt:DateTimeString>";
|
||||
} else {
|
||||
@@ -432,24 +520,24 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
* " </DeliveryNoteReferencedDocument>\n"
|
||||
*/
|
||||
+ " </ram:ApplicableHeaderTradeDelivery>\n" + " <ram:ApplicableHeaderTradeSettlement>\n" //$NON-NLS-2$
|
||||
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n"; //$NON-NLS-1$
|
||||
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n" //$NON-NLS-2$
|
||||
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n";
|
||||
|
||||
if (trans.getTradeSettlementPayment()!=null) {
|
||||
if (trans.getTradeSettlementPayment() != null) {
|
||||
for (IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
|
||||
if(payment!=null) {
|
||||
hasDueDate=true;
|
||||
xml+=payment.getSettlementXML();
|
||||
if (payment != null) {
|
||||
hasDueDate = true;
|
||||
xml += payment.getSettlementXML();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trans.getTradeSettlement()!=null) {
|
||||
if (trans.getTradeSettlement() != null) {
|
||||
for (IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
||||
if(payment!=null) {
|
||||
if (payment != null) {
|
||||
if (payment instanceof IZUGFeRDTradeSettlementPayment) {
|
||||
hasDueDate=true;
|
||||
hasDueDate = true;
|
||||
}
|
||||
xml+=payment.getSettlementXML();
|
||||
xml += payment.getSettlementXML();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -458,21 +546,67 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
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()) //$NON-NLS-1$
|
||||
+ "</ram:CalculatedAmount>\n" //$NON-NLS-1$ //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n" //$NON-NLS-1$
|
||||
xml += " <ram:ApplicableTradeTax>\n"
|
||||
+ " <ram:CalculatedAmount>" + currencyFormat(amount.getCalculated())
|
||||
+ "</ram:CalculatedAmount>\n" //currencyID=\"EUR\"
|
||||
+ " <ram:TypeCode>VAT</ram:TypeCode>\n"
|
||||
+ exemptionReason
|
||||
+ " <ram:BasisAmount>" + currencyFormat(amount.getBasis()) + "</ram:BasisAmount>\n" // currencyID=\"EUR\"
|
||||
+ " <ram:CategoryCode>"+taxCategoryCode+"</ram:CategoryCode>\n" //$NON-NLS-1$
|
||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent) //$NON-NLS-1$
|
||||
+ " <ram:CategoryCode>" + taxCategoryCode + "</ram:CategoryCode>\n"
|
||||
+ " <ram:RateApplicablePercent>" + vatFormat(currentTaxPercent)
|
||||
+ "</ram:RateApplicablePercent>\n" + " </ram:ApplicableTradeTax>\n"; //$NON-NLS-2$
|
||||
|
||||
}
|
||||
}
|
||||
if ((trans.getOccurrencePeriodFrom() != null) || (trans.getOccurrencePeriodTo() != null)) {
|
||||
xml = xml + "<ram:BillingSpecifiedPeriod>";
|
||||
if (trans.getOccurrencePeriodFrom() != null) {
|
||||
xml = xml + "<ram:StartDateTime><udt:DateTimeString format='102'>" + zugferdDateFormat.format(trans.getOccurrencePeriodFrom()) + "</udt:DateTimeString></ram:StartDateTime>";
|
||||
}
|
||||
if (trans.getOccurrencePeriodTo() != null) {
|
||||
xml = xml + "<ram:EndDateTime><udt:DateTimeString format='102'>" + zugferdDateFormat.format(trans.getOccurrencePeriodTo()) + "</udt:DateTimeString></ram:EndDateTime>";
|
||||
}
|
||||
xml = xml + "</ram:BillingSpecifiedPeriod>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ((trans.getZFCharges() != null) && (trans.getZFCharges().length > 0)) {
|
||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
||||
" <ram:ChargeIndicator>\n" +
|
||||
" <udt:Indicator>true</udt:Indicator>\n" +
|
||||
" </ram:ChargeIndicator>\n" +
|
||||
" <ram:ActualAmount>" + currencyFormat(getCharges()) + "</ram:ActualAmount>\n" +
|
||||
" <ram:Reason>Charge</ram:Reason>\n" +
|
||||
" <ram:CategoryTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:CategoryTradeTax>\n" +
|
||||
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
||||
" <ram:ChargeIndicator>\n" +
|
||||
" <udt:Indicator>false</udt:Indicator>\n" +
|
||||
" </ram:ChargeIndicator>\n" +
|
||||
" <ram:ActualAmount>" + currencyFormat(getAllowances()) + "</ram:ActualAmount>\n" +
|
||||
" <ram:Reason>Allowance</ram:Reason>\n" +
|
||||
" <ram:CategoryTradeTax>\n" +
|
||||
" <ram:TypeCode>VAT</ram:TypeCode>\n" +
|
||||
" <ram:CategoryCode>S</ram:CategoryCode>\n" +
|
||||
" <ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>\n" +
|
||||
" </ram:CategoryTradeTax>\n" +
|
||||
" </ram:SpecifiedTradeAllowanceCharge> \n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (trans.getPaymentTerms() == null) {
|
||||
xml = xml + " <ram:SpecifiedTradePaymentTerms>\n" //$NON-NLS-1$
|
||||
xml = xml + " <ram:SpecifiedTradePaymentTerms>\n"
|
||||
+ " <ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
||||
|
||||
if (trans.getTradeSettlement() != null) {
|
||||
@@ -483,39 +617,40 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDueDate && (trans.getDueDate()!=null)) {
|
||||
if (hasDueDate && (trans.getDueDate() != null)) {
|
||||
xml = xml + " <ram:DueDateDateTime><udt:DateTimeString format=\"102\">" // $NON-NLS-2$
|
||||
+ zugferdDateFormat.format(trans.getDueDate())
|
||||
+ "</udt:DateTimeString></ram:DueDateDateTime>\n";// 20130704 //$NON-NLS-1$
|
||||
+ "</udt:DateTimeString></ram:DueDateDateTime>\n";// 20130704
|
||||
|
||||
}
|
||||
xml = xml + " </ram:SpecifiedTradePaymentTerms>\n"; //$NON-NLS-1$
|
||||
xml = xml + " </ram:SpecifiedTradePaymentTerms>\n";
|
||||
} else {
|
||||
xml = xml + buildPaymentTermsXml();
|
||||
}
|
||||
|
||||
xml = xml + " <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=\"" + trans.getCurrency() + "\">" //$NON-NLS-1$
|
||||
+ currencyFormat(getTotalGross().subtract(getTotal())) + "</ram:TaxTotalAmount>\n" //$NON-NLS-1$
|
||||
+ " <ram:GrandTotalAmount>" + currencyFormat(getTotalGross()) + "</ram:GrandTotalAmount>\n" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// //
|
||||
// currencyID=\"EUR\"
|
||||
|
||||
String allowanceTotalLine = "<ram:AllowanceTotalAmount>" + currencyFormat(getAllowances()) + "</ram:AllowanceTotalAmount>";
|
||||
|
||||
String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(getCharges()) + "</ram:ChargeTotalAmount>";
|
||||
|
||||
xml = xml + " <ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
||||
+ " <ram:LineTotalAmount>" + currencyFormat(getTotal()) + "</ram:LineTotalAmount>\n" //$NON-NLS-2$
|
||||
+ chargesTotalLine
|
||||
+ allowanceTotalLine
|
||||
+ " <ram:TaxBasisTotalAmount>" + currencyFormat(getTaxBasis()) + "</ram:TaxBasisTotalAmount>\n" //$NON-NLS-2$
|
||||
// //
|
||||
// currencyID=\"EUR\"
|
||||
+ " <ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
|
||||
+ currencyFormat(getTotalGross().subtract(getTaxBasis())) + "</ram:TaxTotalAmount>\n"
|
||||
+ " <ram:GrandTotalAmount>" + currencyFormat(getTotalGross()) + "</ram:GrandTotalAmount>\n" //$NON-NLS-2$
|
||||
// //
|
||||
// currencyID=\"EUR\"
|
||||
+ " <ram:TotalPrepaidAmount>" + currencyFormat(getTotalPrepaid()) + "</ram:TotalPrepaidAmount>\n"
|
||||
+ " <ram:DuePayableAmount>" + currencyFormat(getTotalGross().subtract(getTotalPrepaid())) + "</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().subtract(getTotalPrepaid())) + "</ram:DuePayableAmount>\n" //$NON-NLS-2$
|
||||
// //
|
||||
// currencyID=\"EUR\"
|
||||
+ " </ram:SpecifiedTradeSettlementHeaderMonetarySummation>\n"
|
||||
+ " </ram:ApplicableHeaderTradeSettlement>\n";
|
||||
// + " <IncludedSupplyChainTradeLineItem>\n"
|
||||
// + " <AssociatedDocumentLineDocument>\n"
|
||||
// + " <IncludedNote>\n"
|
||||
@@ -525,8 +660,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
// + " </AssociatedDocumentLineDocument>\n"
|
||||
// + " </IncludedSupplyChainTradeLineItem>\n";
|
||||
|
||||
xml = xml + " </rsm:SupplyChainTradeTransaction>\n" //$NON-NLS-1$
|
||||
+ "</rsm:CrossIndustryInvoice>"; //$NON-NLS-1$
|
||||
xml = xml + " </rsm:SupplyChainTradeTransaction>\n"
|
||||
+ "</rsm:CrossIndustryInvoice>";
|
||||
|
||||
byte[] zugferdRaw;
|
||||
try {
|
||||
@@ -544,12 +679,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
} // $NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfile(Profile p) {
|
||||
profile = p;
|
||||
}
|
||||
|
||||
private String buildPaymentTermsXml() {
|
||||
String paymentTermsXml = "<ram:SpecifiedTradePaymentTerms>";
|
||||
|
||||
IZUGFeRDPaymentTerms paymentTerms = trans.getPaymentTerms();
|
||||
IZUGFeRDPaymentDiscountTerms discountTerms = paymentTerms.getDiscountTerms();
|
||||
IZUGFeRDDate dueDate = paymentTerms.getDueDate();
|
||||
Date dueDate = paymentTerms.getDueDate();
|
||||
if (dueDate != null && discountTerms != null && discountTerms.getBaseDate() != null) {
|
||||
throw new IllegalStateException(
|
||||
"if paymentTerms.dueDate is specified, paymentTerms.discountTerms.baseDate has not to be specified");
|
||||
@@ -557,8 +697,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
paymentTermsXml += "<ram:Description>" + paymentTerms.getDescription() + "</ram:Description>";
|
||||
if (dueDate != null) {
|
||||
paymentTermsXml += "<ram:DueDateDateTime>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"" + dueDate.getFormat().getDateTimeType() + "\">"
|
||||
+ dueDate.getFormat().getFormatter().format(dueDate.getDate()) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"102\">"
|
||||
+ zugferdDateFormat.format(dueDate) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "</ram:DueDateDateTime>";
|
||||
}
|
||||
|
||||
@@ -571,12 +711,11 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
+ "</ram:CalculationPercent>";
|
||||
|
||||
if (discountTerms.getBaseDate() != null) {
|
||||
Date baseDate = discountTerms.getBaseDate().getDate();
|
||||
ZUGFeRDDateFormat baseDateFormat = discountTerms.getBaseDate().getFormat();
|
||||
Date baseDate = discountTerms.getBaseDate();
|
||||
paymentTermsXml += "<ram:BasisDateTime>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"" + baseDateFormat.getDateTimeType() + "\">" + baseDateFormat.getFormatter().format(baseDate) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "<udt:DateTimeString format=\"102\">" + zugferdDateFormat.format(baseDate) + "</udt:DateTimeString>";
|
||||
paymentTermsXml += "</ram:BasisDateTime>";
|
||||
|
||||
|
||||
paymentTermsXml += "<ram:BasisPeriodMeasure unitCode=\"" + discountTerms.getBasePeriodUnitCode() + "\">"
|
||||
+ discountTerms.getBasePeriodMeasure() + "</ram:BasisPeriodMeasure>";
|
||||
}
|
||||
@@ -588,4 +727,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
||||
return paymentTermsXml;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getValue() {
|
||||
return getTotal();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* 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;
|
||||
|
||||
public enum ZUGFeRDConformanceLevel {
|
||||
BASIC, COMFORT, EXTENDED, EN16931/*=Comfort*/, MINIMUM, BASICWL /*basic without lines, less than basic*/, CIUS, XRECHNUNG
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* 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 org.apache.pdfbox.preflight.PreflightDocument;
|
||||
import org.apache.pdfbox.preflight.exception.ValidationException;
|
||||
import org.apache.pdfbox.preflight.parser.PreflightParser;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class ZUGFeRDExporterFromA1 extends ZUGFeRDExporterFromA3 implements IZUGFeRDExporter {
|
||||
protected boolean ignorePDFAErrors = false;
|
||||
|
||||
public ZUGFeRDExporterFromA1 ignorePDFAErrors() {
|
||||
this.ignorePDFAErrors = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
private static boolean isValidA1(DataSource dataSource) throws IOException {
|
||||
return getPDFAParserValidationResult(new PreflightParser(dataSource));
|
||||
}
|
||||
|
||||
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
|
||||
/*
|
||||
* Parse the PDF file with PreflightParser that inherits from the
|
||||
* NonSequentialParser. Some additional controls are present to check a set of
|
||||
* PDF/A requirements. (Stream length consistency, EOL after some Keyword...)
|
||||
*/
|
||||
parser.parse();// might add a Format.PDF_A1A as parameter and iterate through A1 and A3
|
||||
|
||||
try (PreflightDocument document = parser.getPreflightDocument()) {
|
||||
/*
|
||||
* Once the syntax validation is done, the parser can provide a
|
||||
* PreflightDocument (that inherits from PDDocument) This document process the
|
||||
* end of PDF/A validation.
|
||||
*/
|
||||
|
||||
document.validate();
|
||||
|
||||
// Get validation result
|
||||
return document.getResult().isValid();
|
||||
} catch (ValidationException e) {
|
||||
/*
|
||||
* the parse method can throw a SyntaxValidationException if the PDF file can't
|
||||
* be parsed. In this case, the exception contains an instance of
|
||||
* ValidationResult
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ZUGFeRDExporterFromA1 setProfile(Profile p) {
|
||||
return (ZUGFeRDExporterFromA1)super.setProfile(p);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setProfile(String profileName) {
|
||||
return (ZUGFeRDExporterFromA1)super.setProfile(profileName);
|
||||
}
|
||||
|
||||
public boolean ensurePDFIsValid(final DataSource dataSource) throws IOException {
|
||||
if (!ignorePDFAErrors && !isValidA1(dataSource)) {
|
||||
throw new IOException("File is not a valid PDF/A input file");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA1() {
|
||||
ensurePDFisUpgraded = true;
|
||||
setZUGFeRDVersion(ZUGFeRDExporterFromA3.DefaultZUGFeRDVersion);
|
||||
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA1 load(String pdfFilename) throws IOException {
|
||||
return (ZUGFeRDExporterFromA1) super.load(pdfFilename);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 load(byte[] pdfBinary) throws IOException {
|
||||
return (ZUGFeRDExporterFromA1) super.load(pdfBinary);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 load(InputStream pdfSource) throws IOException{
|
||||
return (ZUGFeRDExporterFromA1) super.load(pdfSource);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setCreator(String creator) {
|
||||
return (ZUGFeRDExporterFromA1) super.setCreator(creator);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setConformanceLevel(PDFAConformanceLevel newLevel) {
|
||||
return (ZUGFeRDExporterFromA1) super.setConformanceLevel(newLevel);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setProducer(String producer){
|
||||
return (ZUGFeRDExporterFromA1) super.setProducer(producer);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setZUGFeRDVersion(int version){
|
||||
return (ZUGFeRDExporterFromA1) super.setZUGFeRDVersion(version);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setXML(byte[] zugferdData) throws IOException{
|
||||
return (ZUGFeRDExporterFromA1) super.setXML(zugferdData);
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA1 disableAutoClose(boolean disableAutoClose){
|
||||
return (ZUGFeRDExporterFromA1) super.disableAutoClose(disableAutoClose);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 convertOnly() {
|
||||
setAttachZUGFeRDHeaders(false);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,43 +1,35 @@
|
||||
|
||||
/** **********************************************************************
|
||||
*
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*********************************************************************** */
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
/*
|
||||
* Mustangproject's ZUGFeRD implementation ZUGFeRD exporter Licensed under the
|
||||
* APLv2
|
||||
*
|
||||
* @date 2014-07-12
|
||||
* @version 1.2.0
|
||||
* @author jstaerk
|
||||
*
|
||||
*/
|
||||
|
||||
import org.apache.pdfbox.cos.COSArray;
|
||||
import org.apache.pdfbox.cos.COSBase;
|
||||
import org.apache.pdfbox.cos.COSDictionary;
|
||||
import org.apache.pdfbox.cos.COSName;
|
||||
import org.apache.pdfbox.cos.COSObject;
|
||||
import org.apache.pdfbox.cos.*;
|
||||
import org.apache.pdfbox.io.IOUtils;
|
||||
import org.apache.pdfbox.pdmodel.*;
|
||||
import org.apache.pdfbox.pdmodel.common.PDMetadata;
|
||||
import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification;
|
||||
import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile;
|
||||
import org.apache.pdfbox.preflight.PreflightDocument;
|
||||
import org.apache.pdfbox.preflight.exception.ValidationException;
|
||||
import org.apache.pdfbox.preflight.parser.PreflightParser;
|
||||
import org.apache.pdfbox.preflight.utils.ByteArrayDataSource;
|
||||
import org.apache.xmpbox.XMPMetadata;
|
||||
import org.apache.xmpbox.schema.AdobePDFSchema;
|
||||
import org.apache.xmpbox.schema.DublinCoreSchema;
|
||||
@@ -45,42 +37,32 @@ import org.apache.xmpbox.schema.PDFAIdentificationSchema;
|
||||
import org.apache.xmpbox.schema.XMPBasicSchema;
|
||||
import org.apache.xmpbox.type.BadFieldValueException;
|
||||
import org.apache.xmpbox.xml.XmpSerializer;
|
||||
import org.mustangproject.FileAttachment;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import javax.activation.FileDataSource;
|
||||
import javax.xml.transform.TransformerException;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ZUGFeRDExporter implements Closeable {
|
||||
public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporter, IExporter, Closeable {
|
||||
private boolean isFacturX = true;
|
||||
|
||||
public static final int DefaultZUGFeRDVersion = 2;
|
||||
|
||||
private boolean isFacturX = true;
|
||||
protected PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
|
||||
protected ArrayList<FileAttachment> fileAttachments = new ArrayList<FileAttachment>();
|
||||
|
||||
/**
|
||||
* To use the ZUGFeRD exporter, implement IZUGFeRDExportableTransaction in
|
||||
* yourTransaction (which will require you to implement Product, Item and
|
||||
* Contact) then call doc = PDDocument.load(PDFfilename); // automatically add
|
||||
* Zugferd to all outgoing invoices ZUGFeRDExporter ze = new ZUGFeRDExporter();
|
||||
* ze.PDFmakeA3compliant(doc, "Your application name",
|
||||
* System.getProperty("user.name"), true); ze.PDFattachZugferdFile(doc,
|
||||
* yourTransaction);
|
||||
* <p/>
|
||||
* doc.save(PDFfilename);
|
||||
*
|
||||
* @author jstaerk
|
||||
* @deprecated Use the factory methods {@link #createFromPDFA3(String)},
|
||||
* {@link #createFromPDFA3(InputStream)} or the
|
||||
* {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
*/
|
||||
// // MAIN CLASS
|
||||
@Deprecated
|
||||
private PDFAConformanceLevel conformanceLevel = PDFAConformanceLevel.UNICODE;
|
||||
protected boolean ensurePDFisUpgraded = true;
|
||||
|
||||
// BASIC, COMFORT etc - may be set from outside.
|
||||
@Deprecated
|
||||
private ZUGFeRDConformanceLevel profile = ZUGFeRDConformanceLevel.EN16931;
|
||||
|
||||
private boolean disableAutoClose;
|
||||
private boolean fileAttached = false;
|
||||
private Profile profile = null;
|
||||
private boolean documentPrepared = false;
|
||||
|
||||
/**
|
||||
* Data (XML invoice) to be added to the ZUGFeRD PDF. It may be externally set,
|
||||
@@ -88,7 +70,6 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
* default it is null meaning the caller needs to pass a
|
||||
* IZUGFeRDExportableTransaction for the XML to be populated.
|
||||
*/
|
||||
IXMLProvider xmlProvider;
|
||||
protected PDMetadata metadata = null;
|
||||
protected PDFAIdentificationSchema pdfaid = null;
|
||||
protected XMPMetadata xmp = null;
|
||||
@@ -105,39 +86,52 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
*/
|
||||
protected String creatorTool = "mustangproject";
|
||||
|
||||
@Deprecated
|
||||
private boolean ignoreA1Errors;
|
||||
protected boolean ensurePDFisUpgraded = true;
|
||||
private PDDocument doc;
|
||||
int ZFVersion;
|
||||
|
||||
private HashMap<String, byte[]> additionalFiles = new HashMap<String, byte[]>();
|
||||
private HashMap<String, byte[]> additionalXMLs = new HashMap<String, byte[]>();
|
||||
|
||||
|
||||
private boolean disableAutoClose;
|
||||
|
||||
private boolean fileAttached = false;
|
||||
protected boolean attachZUGFeRDHeaders = true;
|
||||
|
||||
private boolean documentPrepared = false;
|
||||
|
||||
public ZUGFeRDExporter() {
|
||||
init();
|
||||
}
|
||||
|
||||
public ZUGFeRDExporter(PDDocument doc2) {
|
||||
doc = doc2;
|
||||
init();
|
||||
}
|
||||
protected int ZFVersion = DefaultZUGFeRDVersion;
|
||||
private boolean attachZUGFeRDHeaders = true;
|
||||
|
||||
/**
|
||||
* Adds additional file attachments into the ZF
|
||||
* @param filename the name of the attachment
|
||||
* @param filecontent the bytearray with the file contents
|
||||
* 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
|
||||
*/
|
||||
public void addAdditionalFile(String filename, byte[] filecontent) {
|
||||
additionalFiles.put(filename, filecontent);
|
||||
public ZUGFeRDExporterFromA3 load(String pdfFilename) throws IOException {
|
||||
|
||||
ensurePDFIsValid(new FileDataSource(pdfFilename));
|
||||
try (FileInputStream pdf = new FileInputStream(pdfFilename)) {
|
||||
return load(readAllBytes(pdf));
|
||||
}
|
||||
}
|
||||
|
||||
public IXMLProvider getProvider() {
|
||||
return xmlProvider;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 setProfile(Profile p) {
|
||||
this.profile=p;
|
||||
if (xmlProvider!=null) {
|
||||
xmlProvider.setProfile(p);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 setProfile(String profilename) {
|
||||
this.profile=Profiles.getByName(profilename);
|
||||
|
||||
if (xmlProvider!=null) {
|
||||
xmlProvider.setProfile(this.profile);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 addAdditionalFile(String name, byte[] content) {
|
||||
fileAttachments.add(new FileAttachment(name, "text/xml", "Supplement", content).setDescription("ZUGFeRD extension/additional data"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -147,12 +141,12 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
*/
|
||||
public String getNamespaceForVersion(int ver) {
|
||||
if (isFacturX) {
|
||||
return "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
|
||||
return "urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#";
|
||||
} else if (ver == 1) {
|
||||
return "urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0#";
|
||||
} else if (ver == 2) {
|
||||
return "urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#";
|
||||
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException("Version not supported");
|
||||
}
|
||||
@@ -174,241 +168,70 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
/***
|
||||
* internal helper: return the name of the file attachment for the given zf/fx version
|
||||
* @param ver the zf/fx version
|
||||
* @param profile which profile to be used, e.g. Profiles.getByName("EN16931")
|
||||
* @return the filename of the file to be embedded
|
||||
*/
|
||||
public String getFilenameForVersion(int ver) {
|
||||
public String getFilenameForVersion(int ver, Profile profile) {
|
||||
if (isFacturX) {
|
||||
return "factur-x.xml";
|
||||
} else {
|
||||
if (ver==1) {
|
||||
return "ZUGFeRD-invoice.xml";
|
||||
if (ver == 1) {
|
||||
return "ZUGFeRD-invoice.xml";
|
||||
} else {
|
||||
return "zugferd-invoice.xml";
|
||||
if (profile.getName().equals("XRECHNUNG")) {
|
||||
return "xrechnung.xml";
|
||||
} else {
|
||||
return "zugferd-invoice.xml";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setZUGFeRDVersion(int ver) {
|
||||
if (ver == 1) {
|
||||
ZUGFeRD1PullProvider z1p = new ZUGFeRD1PullProvider();
|
||||
disableFacturX();
|
||||
this.xmlProvider = z1p;
|
||||
} else if (ver == 2) {
|
||||
ZUGFeRD2PullProvider z2p = new ZUGFeRD2PullProvider();
|
||||
this.xmlProvider = z2p;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Version not supported");
|
||||
}
|
||||
ZFVersion = ver;
|
||||
}
|
||||
|
||||
public IXMLProvider getProvider() {
|
||||
return xmlProvider;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
setZUGFeRDVersion(DefaultZUGFeRDVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Factur-X is now set by default since ZF 2.1, you have to disable it if you dont wont it
|
||||
* Generate ZF2.1 files with filename factur-x.xml
|
||||
*
|
||||
* @deprecated
|
||||
* */
|
||||
public void setFacturX() {
|
||||
* @return this (fluent setter)
|
||||
*/
|
||||
public ZUGFeRDExporterFromA3 setFacturX() {
|
||||
isFacturX = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/***
|
||||
* Generate ZF2.0/2.1 files with filename zugferd-invoice.xml instead of factur-x.xml
|
||||
*/
|
||||
public void disableFacturX() {
|
||||
public IZUGFeRDExporter disableFacturX() {
|
||||
isFacturX = false;
|
||||
}
|
||||
/**
|
||||
* All files are PDF/A-3, setConformance refers to the level conformance.
|
||||
*
|
||||
* PDF/A-3 has three conformance 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 :-)
|
||||
* @param newLevel "A", "U" or "B"
|
||||
*
|
||||
* @deprecated Use {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setConformanceLevel(PDFAConformanceLevel newLevel) {
|
||||
if (newLevel == null) {
|
||||
throw new NullPointerException("pdf conformance level");
|
||||
}
|
||||
conformanceLevel = newLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* All files are PDF/A-3, setConformance refers to the level conformance.
|
||||
* <p>
|
||||
* PDF/A-3 has three conformance 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 :-)
|
||||
*
|
||||
* @param newLevel "A", "U" or "B"
|
||||
* @deprecated Use
|
||||
* {@link #setConformanceLevel(org.mustangproject.ZUGFeRD.PDFAConformanceLevel)}
|
||||
* instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setConformanceLevel(String newLevel) {
|
||||
conformanceLevel = PDFAConformanceLevel.findByLetter(newLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* enables the flag to indicate a test invoice in the XML structure
|
||||
*/
|
||||
public void setTest() {
|
||||
xmlProvider.setTest();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void ignoreA1Errors() {
|
||||
ignoreA1Errors = true;
|
||||
}
|
||||
|
||||
/***
|
||||
* load from a pdf which is already A/3
|
||||
* @param filename the PDF
|
||||
* @throws IOException if anything is wrong with filename
|
||||
* @deprecated Use the factory method {@link #createFromPDFA3(String)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void loadPDFA3(String filename) throws IOException {
|
||||
doc = PDDocument.load(new File(filename));
|
||||
}
|
||||
|
||||
/***
|
||||
* factory create a ZUGFeRD exporter for a PDF/A-3 pdf file
|
||||
* @param filename of the pdf
|
||||
* @return the created ZUGFeRDExporter
|
||||
* @throws IOException if something is wrong with filename
|
||||
*/
|
||||
public static ZUGFeRDExporter createFromPDFA3(String filename) throws IOException {
|
||||
return new ZUGFeRDExporter(PDDocument.load(new File(filename)));
|
||||
}
|
||||
|
||||
/**
|
||||
* load from a pdf which is already A/3 from filestream
|
||||
* @param file InputStream to load pdf from
|
||||
* @deprecated Use the factory method {@link #createFromPDFA3(InputStream)} instead
|
||||
* @throws IOException in case anything is wrong with file
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public void loadPDFA3(InputStream file) throws IOException {
|
||||
doc = PDDocument.load(file);
|
||||
}
|
||||
|
||||
/***
|
||||
* factory create a ZUGFeRD exporter for a PDF/A-3 inputstream
|
||||
* @param pdfSource the InputStream of the pdf
|
||||
* @return the created ZUGFeRDExporter
|
||||
* @throws IOException (should not happen)
|
||||
*/
|
||||
public static ZUGFeRDExporter createFromPDFA3(InputStream pdfSource) throws IOException {
|
||||
return new ZUGFeRDExporter(PDDocument.load(pdfSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 filename the pdf
|
||||
* @param producer the name of the xmp producer (app)
|
||||
* @param creator the name of the xmp creator (user)
|
||||
* @param attachZugferdHeaders whether to attach XMP ZUGFeRD headers
|
||||
* @return the created PDFbox PDDocumentCatalog
|
||||
* @throws IOException if anything is wrong with file
|
||||
* @throws TransformerException in case of xml (XMP) parsing issues
|
||||
* @deprecated use the {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public PDDocumentCatalog PDFmakeA3compliant(String filename, String producer, String creator,
|
||||
boolean attachZugferdHeaders) throws IOException, TransformerException {
|
||||
|
||||
doc = createPDFA1Factory().setProducer(producer).setCreator(creator).load(filename).doc;
|
||||
|
||||
return doc.getDocumentCatalog();
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* 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 file the InputStream of the pdf
|
||||
* @param producer the name of the xmp producer (app)
|
||||
* @param creator the name of the xmp creator (user)
|
||||
* @param attachZugferdHeaders whether to attach XMP ZUGFeRD headers
|
||||
* @return the created PDFbox PDDocumentCatalog
|
||||
* @throws IOException if anything is wrong with file
|
||||
* @throws TransformerException in case of xml (XMP) parsing issues
|
||||
* @deprecated use the {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public PDDocumentCatalog PDFmakeA3compliant(InputStream file, String producer, String creator,
|
||||
boolean attachZugferdHeaders) throws IOException, TransformerException {
|
||||
|
||||
doc = createPDFA1Factory().setProducer(producer).setCreator(creator).load(file).doc;
|
||||
|
||||
return doc.getDocumentCatalog();
|
||||
}
|
||||
|
||||
|
||||
private IExporterFactory createPDFA1Factory() {
|
||||
ZUGFeRDExporterFromA1Factory factory = new ZUGFeRDExporterFromA1Factory();
|
||||
if (ignoreA1Errors) {
|
||||
factory.ignorePDFAErrors();
|
||||
}
|
||||
return factory.setZUGFeRDConformanceLevel(profile).setConformanceLevel(conformanceLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (doc != null) {
|
||||
doc.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Embeds the Zugferd XML structure in a file named ZUGFeRD-invoice.xml.
|
||||
*
|
||||
* @param trans a IZUGFeRDExportableTransaction that provides the data-model to
|
||||
* populate the XML. This parameter may be null, if so the XML data
|
||||
* should hav ebeen set via
|
||||
* <code>setZUGFeRDXMLData(byte[] zugferdData)</code>
|
||||
* @throws IOException if anything is wrong with already loaded PDF
|
||||
* @param pdfBinary binary of a PDF/A1 compliant document
|
||||
*/
|
||||
public void PDFattachZugferdFile(IZUGFeRDExportableTransaction trans) throws IOException {
|
||||
prepareDocument();
|
||||
((IProfileProvider) xmlProvider).setProfile(profile);
|
||||
xmlProvider.generateXML(trans);
|
||||
String filename = getFilenameForVersion(ZFVersion);
|
||||
PDFAttachGenericFile(doc, filename, "Alternative",
|
||||
"Invoice metadata conforming to ZUGFeRD standard (http://www.ferd-net.de/front_content.php?idcat=231&lang=4)",
|
||||
"text/xml", xmlProvider.getXML());
|
||||
for (String filenameAdditional : additionalFiles.keySet()) {
|
||||
PDFAttachGenericFile(doc, filenameAdditional, "Supplement", "ZUGFeRD extension/additional data", "text/xml", additionalFiles.get(filenameAdditional));
|
||||
}
|
||||
public ZUGFeRDExporterFromA3 load(byte[] pdfBinary) throws IOException {
|
||||
ensurePDFIsValid(new ByteArrayDataSource(new ByteArrayInputStream(pdfBinary)));
|
||||
doc = PDDocument.load(pdfBinary);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3() {
|
||||
super();
|
||||
ensurePDFisUpgraded = false;
|
||||
}
|
||||
|
||||
public void attachFile(FileAttachment file) {
|
||||
fileAttachments.add(file);
|
||||
}
|
||||
public void attachFile(String filename, byte[] data, String mimetype, String relation) {
|
||||
FileAttachment fa=new FileAttachment(filename, mimetype, relation, data);
|
||||
fileAttachments.add(fa);
|
||||
}
|
||||
|
||||
/***
|
||||
@@ -422,7 +245,7 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
}
|
||||
if ((!fileAttached) && (attachZUGFeRDHeaders)) {
|
||||
throw new IOException(
|
||||
"File must be attached (usually with PDFattachZugferdFile) before perfoming this operation");
|
||||
"File must be attached (usually with setTransaction) before perfoming this operation");
|
||||
}
|
||||
doc.save(ZUGFeRDfilename);
|
||||
if (!disableAutoClose) {
|
||||
@@ -430,6 +253,13 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
if (doc != null) {
|
||||
doc.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* Perform the final export to a now ZUGFeRD-enriched PDF file as OutputStream
|
||||
@@ -442,7 +272,7 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
}
|
||||
if ((!fileAttached) && (attachZUGFeRDHeaders)) {
|
||||
throw new IOException(
|
||||
"File must be attached (usually with PDFattachZugferdFile) before perfoming this operation");
|
||||
"File must be attached (usually with setTransaction) before perfoming this operation");
|
||||
}
|
||||
doc.save(output);
|
||||
if (!disableAutoClose) {
|
||||
@@ -512,27 +342,23 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
doc.getDocumentCatalog().setNames(names);
|
||||
|
||||
// AF entry (Array) in catalog with the FileSpec
|
||||
COSBase AFEntry = (COSBase)doc.getDocumentCatalog().getCOSObject().getItem("AF");
|
||||
if ((AFEntry == null))
|
||||
{
|
||||
COSArray cosArray = new COSArray();
|
||||
cosArray.add(fs);
|
||||
doc.getDocumentCatalog().getCOSObject().setItem("AF", cosArray);
|
||||
} else if (AFEntry instanceof COSArray)
|
||||
{
|
||||
COSArray cosArray = (COSArray)AFEntry;
|
||||
cosArray.add(fs);
|
||||
doc.getDocumentCatalog().getCOSObject().setItem("AF", cosArray);
|
||||
} else if ((AFEntry instanceof COSObject) &&
|
||||
((COSObject)AFEntry).getObject() instanceof COSArray)
|
||||
{
|
||||
COSArray cosArray = (COSArray)((COSObject)AFEntry).getObject();
|
||||
cosArray.add(fs);
|
||||
} else
|
||||
{
|
||||
throw new IOException("Unexpected object type for PDFDocument/Catalog/COSDictionary/Item(AF)");
|
||||
}
|
||||
}
|
||||
COSBase AFEntry = (COSBase) doc.getDocumentCatalog().getCOSObject().getItem("AF");
|
||||
if ((AFEntry == null)) {
|
||||
COSArray cosArray = new COSArray();
|
||||
cosArray.add(fs);
|
||||
doc.getDocumentCatalog().getCOSObject().setItem("AF", cosArray);
|
||||
} else if (AFEntry instanceof COSArray) {
|
||||
COSArray cosArray = (COSArray) AFEntry;
|
||||
cosArray.add(fs);
|
||||
doc.getDocumentCatalog().getCOSObject().setItem("AF", cosArray);
|
||||
} else if ((AFEntry instanceof COSObject) &&
|
||||
((COSObject) AFEntry).getObject() instanceof COSArray) {
|
||||
COSArray cosArray = (COSArray) ((COSObject) AFEntry).getObject();
|
||||
cosArray.add(fs);
|
||||
} else {
|
||||
throw new IOException("Unexpected object type for PDFDocument/Catalog/COSDictionary/Item(AF)");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ZUGFeRD XML data to be attached as a single byte array. This is
|
||||
@@ -542,49 +368,75 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
* @param zugferdData XML data to be set as a byte array (XML file in raw form).
|
||||
* @throws IOException (should not happen)
|
||||
*/
|
||||
public void setZUGFeRDXMLData(byte[] zugferdData) throws IOException {
|
||||
public ZUGFeRDExporterFromA3 setXML(byte[] zugferdData) throws IOException {
|
||||
CustomXMLProvider cus = new CustomXMLProvider();
|
||||
cus.setXML(zugferdData);
|
||||
this.xmlProvider = cus;
|
||||
PDFattachZugferdFile(null);
|
||||
|
||||
this.setXMLProvider(cus);
|
||||
prepare();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the ZUGFeRD profile.
|
||||
* 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 zUGFeRDConformanceLevel the new conformance level
|
||||
* @deprecated Use {@link ZUGFeRDExporterFromA1Factory} instead
|
||||
* @param pdfSource source to read a PDF/A1 compliant document from
|
||||
*/
|
||||
@Deprecated
|
||||
public void setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zUGFeRDConformanceLevel) {
|
||||
if (zUGFeRDConformanceLevel == null) {
|
||||
throw new NullPointerException("ZUGFeRD conformance level");
|
||||
}
|
||||
this.profile = zUGFeRDConformanceLevel;
|
||||
public ZUGFeRDExporterFromA3 load(InputStream pdfSource) throws IOException {
|
||||
return load(readAllBytes(pdfSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ZUGFeRD profile.
|
||||
*
|
||||
* @param zUGFeRDConformanceLevel the new conformance level
|
||||
* @deprecated Use {@link #setConformanceLevel(PDFAConformanceLevel)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setZUGFeRDConformanceLevel(String zUGFeRDConformanceLevel) {
|
||||
this.profile = ZUGFeRDConformanceLevel.valueOf(zUGFeRDConformanceLevel);
|
||||
public boolean ensurePDFIsValid(final DataSource dataSource) throws IOException {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* *
|
||||
* Returns the PDFBox PDF Document
|
||||
*
|
||||
* @return PDDocument the PDFBox PDF
|
||||
*/
|
||||
public PDDocument getDoc() {
|
||||
return doc;
|
||||
private static byte[] readAllBytes(InputStream in) throws IOException {
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
IOUtils.copy(in, buffer);
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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 ZUGFeRDExporterFromA3 setConformanceLevel(PDFAConformanceLevel newLevel) {
|
||||
conformanceLevel = newLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ZUGFeRDExporterFromA3 setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 setCreatorTool(String creatorTool) {
|
||||
this.creatorTool = creatorTool;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 setProducer(String producer) {
|
||||
this.producer = producer;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected ZUGFeRDExporterFromA3 setAttachZUGFeRDHeaders(boolean attachHeaders) {
|
||||
this.attachZUGFeRDHeaders = attachHeaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This will add both the RDF-indication which embedded file is Zugferd and the
|
||||
* neccessary PDF/A schema extension description to be able to add this
|
||||
@@ -595,9 +447,9 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
protected void addXMP(XMPMetadata metadata) {
|
||||
|
||||
if (attachZUGFeRDHeaders) {
|
||||
XMPSchemaZugferd zf = new XMPSchemaZugferd(metadata, ZFVersion, isFacturX, profile,
|
||||
XMPSchemaZugferd zf = new XMPSchemaZugferd(metadata, ZFVersion, isFacturX, xmlProvider.getProfile(),
|
||||
getNamespaceForVersion(ZFVersion), getPrefixForVersion(ZFVersion),
|
||||
getFilenameForVersion(ZFVersion));
|
||||
getFilenameForVersion(ZFVersion, xmlProvider.getProfile()));
|
||||
|
||||
metadata.addSchema(zf);
|
||||
}
|
||||
@@ -607,27 +459,6 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
metadata.addSchema(pdfaex);
|
||||
}
|
||||
|
||||
protected byte[] serializeXmpMetadata(XMPMetadata xmpMetadata) throws TransformerException {
|
||||
XmpSerializer serializer = new XmpSerializer();
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
|
||||
String prefix = "<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>";
|
||||
String suffix = "<?xpacket end=\"w\"?>";
|
||||
|
||||
try {
|
||||
buffer.write(prefix.getBytes("UTF-8")); // see https://github.com/ZUGFeRD/mustangproject/issues/44
|
||||
serializer.serialize(xmpMetadata, buffer, false);
|
||||
buffer.write(suffix.getBytes("UTF-8"));
|
||||
} catch (UnsupportedEncodingException e)
|
||||
{
|
||||
throw new TransformerException(e);
|
||||
} catch (IOException e)
|
||||
{
|
||||
throw new TransformerException(e);
|
||||
}
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
protected void prepareDocument() throws IOException {
|
||||
String fullProducer = producer + " (via mustangproject.org " + org.mustangproject.ZUGFeRD.Version.VERSION + ")";
|
||||
|
||||
@@ -659,7 +490,7 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
pdf.setProducer(fullProducer);
|
||||
if (ensurePDFisUpgraded) {
|
||||
try {
|
||||
pdfaid.setConformance(conformanceLevel.getLetter());// $NON-NLS-1$ //$NON-NLS-1$
|
||||
pdfaid.setConformance(conformanceLevel.getLetter());// $NON-NLS-1$
|
||||
} catch (BadFieldValueException ex) {
|
||||
// This should be impossible, because it would occur only if an illegal
|
||||
// conformance level is supplied,
|
||||
@@ -670,9 +501,9 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
pdfaid.setPart(3);
|
||||
}
|
||||
addXMP(xmp); /*
|
||||
* this is the only line where we do something Zugferd-specific, i.e. add PDF
|
||||
* metadata specifically for Zugferd, not generically for a embedded file
|
||||
*/
|
||||
* this is the only line where we do something Zugferd-specific, i.e. add PDF
|
||||
* metadata specifically for Zugferd, not generically for a embedded file
|
||||
*/
|
||||
|
||||
|
||||
try {
|
||||
@@ -684,6 +515,55 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
documentPrepared = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Embeds the Zugferd XML structure in a file named ZUGFeRD-invoice.xml.
|
||||
*
|
||||
* @param trans a IZUGFeRDExportableTransaction that provides the data-model to
|
||||
* populate the XML. This parameter may be null, if so the XML data
|
||||
* should hav ebeen set via
|
||||
* <code>setZUGFeRDXMLData(byte[] zugferdData)</code>
|
||||
* @throws IOException if anything is wrong with already loaded PDF
|
||||
*/
|
||||
public IExporter setTransaction(IExportableTransaction trans) throws IOException {
|
||||
this.trans = trans;
|
||||
return prepare();
|
||||
}
|
||||
|
||||
public IExporter prepare() throws IOException{
|
||||
prepareDocument();
|
||||
xmlProvider.generateXML(trans);
|
||||
String filename = getFilenameForVersion(ZFVersion, xmlProvider.getProfile());
|
||||
PDFAttachGenericFile(doc, filename, "Alternative",
|
||||
"Invoice metadata conforming to ZUGFeRD standard (http://www.ferd-net.de/front_content.php?idcat=231&lang=4)",
|
||||
"text/xml", xmlProvider.getXML());
|
||||
|
||||
for (FileAttachment attachment: fileAttachments) {
|
||||
PDFAttachGenericFile(doc, attachment.getFilename(), attachment.getRelation(), attachment.getDescription(), attachment.getMimetype(), attachment.getData());
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
protected byte[] serializeXmpMetadata(XMPMetadata xmpMetadata) throws TransformerException {
|
||||
XmpSerializer serializer = new XmpSerializer();
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
|
||||
String prefix = "<?xpacket begin=\"\uFEFF\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?>";
|
||||
String suffix = "<?xpacket end=\"w\"?>";
|
||||
|
||||
try {
|
||||
buffer.write(prefix.getBytes("UTF-8")); // see https://github.com/ZUGFeRD/mustangproject/issues/44
|
||||
serializer.serialize(xmpMetadata, buffer, false);
|
||||
buffer.write(suffix.getBytes("UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new TransformerException(e);
|
||||
} catch (IOException e) {
|
||||
throw new TransformerException(e);
|
||||
}
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return if pdf file will be automatically closed after adding ZF
|
||||
*/
|
||||
@@ -694,64 +574,31 @@ public class ZUGFeRDExporter implements Closeable {
|
||||
/**
|
||||
* @param disableAutoClose prevent PDF file from being closed after adding ZF
|
||||
*/
|
||||
public void disableAutoClose(boolean disableAutoClose) {
|
||||
public ZUGFeRDExporterFromA3 disableAutoClose(boolean disableAutoClose) {
|
||||
this.disableAutoClose = disableAutoClose;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* the human author (use factory method instead)
|
||||
*
|
||||
* @param creator the (human) name who created the PDF
|
||||
*/
|
||||
@Deprecated
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
protected void setXMLProvider(IXMLProvider p) {
|
||||
this.xmlProvider = p;
|
||||
if (profile!=null) {
|
||||
xmlProvider.setProfile(profile);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public ZUGFeRDExporterFromA3 setZUGFeRDVersion(int version) {
|
||||
this.ZFVersion = version;
|
||||
if (version == 1) {
|
||||
ZUGFeRD1PullProvider z1p = new ZUGFeRD1PullProvider();
|
||||
disableFacturX();
|
||||
setXMLProvider(z1p);
|
||||
} else if (version == 2) {
|
||||
ZUGFeRD2PullProvider z2p = new ZUGFeRD2PullProvider();
|
||||
setXMLProvider(z2p);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Version not supported");
|
||||
}
|
||||
|
||||
/**
|
||||
* the CreatorTool attribute for the PDF
|
||||
*
|
||||
* @param creatorTool the application which created the PDF
|
||||
*/
|
||||
protected void setCreatorTool(String creatorTool) {
|
||||
this.creatorTool = creatorTool;
|
||||
}
|
||||
|
||||
/**
|
||||
* the authoring software (use factory method instead)
|
||||
*
|
||||
* @param producer the authoring software
|
||||
*/
|
||||
@Deprecated
|
||||
public void setProducer(String producer) {
|
||||
this.producer = producer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ensurePDFisUpgraded if not set the PDF/A won't be relabelled A/3, e.g. if it already is one
|
||||
*/
|
||||
public void setPDFA3(boolean ensurePDFisUpgraded) {
|
||||
this.ensurePDFisUpgraded = ensurePDFisUpgraded;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param attachZUGFeRDHeaders if false the ZUGFeRD XMP metadata won't be added, e.g. if it's not the first file
|
||||
*/
|
||||
public void setAttachZUGFeRDHeaders(boolean attachZUGFeRDHeaders) {
|
||||
this.attachZUGFeRDHeaders = attachZUGFeRDHeaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* encapsulate the deprecated setters
|
||||
* @param zfVersion 1 or 2
|
||||
* @param zugferdConformanceLevel BASIC, COMFORT, EN16931, etc.
|
||||
* @param creator PDF creator
|
||||
* @param producer PDF producer
|
||||
*/
|
||||
public void configure(int zfVersion, ZUGFeRDConformanceLevel zugferdConformanceLevel, String creator, String producer) {
|
||||
setZUGFeRDVersion(zfVersion);
|
||||
setZUGFeRDConformanceLevel(zugferdConformanceLevel);
|
||||
setCreator(creator);
|
||||
setProducer(producer);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2018 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* 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 org.apache.pdfbox.io.IOUtils;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.preflight.PreflightDocument;
|
||||
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
|
||||
*/
|
||||
protected String producer = "mustangproject";
|
||||
/**
|
||||
* Human creator (attribute for PDF)
|
||||
*/
|
||||
protected String creator = "mustangproject";
|
||||
/**
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public ZUGFeRDExporter load(String pdfFilename) throws IOException {
|
||||
|
||||
ensurePDFIsValidPDFA(new FileDataSource(pdfFilename));
|
||||
try (FileInputStream pdf = new FileInputStream(pdfFilename)) {
|
||||
return load(readAllBytes(pdf));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
public ZUGFeRDExporter load(byte[] pdfBinary) throws IOException {
|
||||
ensurePDFIsValidPDFA(new ByteArrayDataSource(new ByteArrayInputStream(pdfBinary)));
|
||||
PDDocument doc = PDDocument.load(pdfBinary);
|
||||
ZUGFeRDExporter zugFeRDExporter = new ZUGFeRDExporter(doc);
|
||||
zugFeRDExporter.configure(ZFVersion, zugferdConformanceLevel, creator, producer);
|
||||
zugFeRDExporter.setAttachZUGFeRDHeaders(attachZUGFeRDHeaders);
|
||||
zugFeRDExporter.setPDFA3(ensurePDFisUpgraded);
|
||||
|
||||
return zugFeRDExporter;
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3Factory() {
|
||||
|
||||
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
|
||||
*/
|
||||
public ZUGFeRDExporter load(InputStream pdfSource) throws IOException {
|
||||
return load(readAllBytes(pdfSource));
|
||||
}
|
||||
|
||||
private void ensurePDFIsValidPDFA(final DataSource dataSource) throws IOException {
|
||||
if (!ignorePDFAErrors && !isValidA1(dataSource)) {
|
||||
throw new IOException("File is not a valid PDF/A input file");
|
||||
}
|
||||
}
|
||||
|
||||
private static byte[] readAllBytes(InputStream in) throws IOException {
|
||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
||||
IOUtils.copy(in, buffer);
|
||||
return buffer.toByteArray();
|
||||
}
|
||||
|
||||
private static boolean isValidA1(DataSource dataSource) throws IOException {
|
||||
return getPDFAParserValidationResult(new PreflightParser(dataSource));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ZUGFeRD conformance level (override).
|
||||
*
|
||||
* @param zugferdConformanceLevel the new conformance level
|
||||
*/
|
||||
public IExporterFactory setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel zugferdConformanceLevel) {
|
||||
this.zugferdConformanceLevel = zugferdConformanceLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
private static boolean getPDFAParserValidationResult(PreflightParser parser) throws IOException {
|
||||
/*
|
||||
* Parse the PDF file with PreflightParser that inherits from the
|
||||
* NonSequentialParser. Some additional controls are present to check a set of
|
||||
* PDF/A requirements. (Stream length consistency, EOL after some Keyword...)
|
||||
*/
|
||||
parser.parse();// might add a Format.PDF_A1A as parameter and iterate through A1 and A3
|
||||
|
||||
try (PreflightDocument document = parser.getPreflightDocument()) {
|
||||
/*
|
||||
* Once the syntax validation is done, the parser can provide a
|
||||
* PreflightDocument (that inherits from PDDocument) This document process the
|
||||
* end of PDF/A validation.
|
||||
*/
|
||||
|
||||
document.validate();
|
||||
|
||||
// Get validation result
|
||||
return document.getResult().isValid();
|
||||
} catch (ValidationException e) {
|
||||
/*
|
||||
* the parse method can throw a SyntaxValidationException if the PDF file can't
|
||||
* be parsed. In this case, the exception contains an instance of
|
||||
* ValidationResult
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IExporterFactory ignorePDFAErrors() {
|
||||
this.ignorePDFAErrors = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public IExporterFactory setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IExporterFactory setCreatorTool(String creatorTool) {
|
||||
this.creatorTool = creatorTool;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IExporterFactory setProducer(String producer) {
|
||||
this.producer = producer;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IExporterFactory setAttachZUGFeRDHeaders(boolean attachHeaders) {
|
||||
this.attachZUGFeRDHeaders = attachHeaders;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IExporterFactory setZUGFeRDVersion(int version) {
|
||||
this.ZFVersion = version;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.xpath.*;
|
||||
|
||||
import org.mustangproject.Item;
|
||||
import org.mustangproject.Product;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.pdmodel.PDDocumentNameDictionary;
|
||||
import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode;
|
||||
@@ -135,7 +137,7 @@ public class ZUGFeRDImporter {
|
||||
/**
|
||||
* filenames for invoice data (ZUGFeRD v1 and v2, Factur-X)
|
||||
*/
|
||||
if ((filename.equals("ZUGFeRD-invoice.xml") || (filename.equals("zugferd-invoice.xml")) || filename.equals("factur-x.xml"))) { //$NON-NLS-1$
|
||||
if ((filename.equals("ZUGFeRD-invoice.xml") || (filename.equals("zugferd-invoice.xml")) || filename.equals("factur-x.xml")) || filename.equals("xrechnung.xml") || filename.equals("order-x.xml")) {
|
||||
containsMeta = true;
|
||||
|
||||
PDEmbeddedFile embeddedFile = fileSpec.getEmbeddedFile();
|
||||
@@ -231,9 +233,9 @@ public class ZUGFeRDImporter {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper for protected method exracteString
|
||||
/***
|
||||
* Wrapper for protected method extractString
|
||||
* @param xpathStr the xpath expression to be evaluated
|
||||
* @return the extracted String for the specific path in the document
|
||||
*/
|
||||
public String wExtractString(String xpathStr) {
|
||||
@@ -252,6 +254,250 @@ public class ZUGFeRDImporter {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ZUGFeRD Profile
|
||||
*/
|
||||
public String getZUGFeRDProfil() {
|
||||
switch (extractString("//GuidelineSpecifiedDocumentContextParameter//ID")) {
|
||||
case "urn:cen.eu:en16931:2017":
|
||||
case "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort":
|
||||
return "COMFORT";
|
||||
case "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic":
|
||||
case "urn:ferd:CrossIndustryDocument:invoice:1p0:basic":
|
||||
return "BASIC";
|
||||
case "urn:factur-x.eu:1p0:basicwl":
|
||||
return "BASIC WL";
|
||||
case "urn:factur-x.eu:1p0:minimum":
|
||||
return "MINIMUM";
|
||||
case "urn:ferd:CrossIndustryDocument:invoice:1p0:extended":
|
||||
case "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended":
|
||||
return "EXTENDED";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Invoice Currency Code
|
||||
*/
|
||||
public String getInvoiceCurrencyCode() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//ApplicableSupplyChainTradeSettlement//InvoiceCurrencyCode");
|
||||
} else {
|
||||
return extractString("//ApplicableHeaderTradeSettlement//InvoiceCurrencyCode");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the IssuerAssigned ID
|
||||
*/
|
||||
public String getIssuerAssignedID() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//BuyerOrderReferencedDocument//ID");
|
||||
} else {
|
||||
return extractString("//BuyerOrderReferencedDocument//IssuerAssignedID");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the BuyerTradeParty ID
|
||||
*/
|
||||
public String getBuyerTradePartyID() {
|
||||
return extractString("//BuyerTradeParty//ID");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Issue Date()
|
||||
*/
|
||||
public String getIssueDate() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//HeaderExchangedDocument//IssueDateTime//DateTimeString");
|
||||
} else {
|
||||
return extractString("//ExchangedDocument//IssueDateTime//DateTimeString");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the TaxBasisTotalAmount
|
||||
*/
|
||||
public String getTaxBasisTotalAmount() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//SpecifiedTradeSettlementMonetarySummation//TaxBasisTotalAmount");
|
||||
} else {
|
||||
return extractString("//SpecifiedTradeSettlementHeaderMonetarySummation//TaxBasisTotalAmount");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the TaxTotalAmount
|
||||
*/
|
||||
public String getTaxTotalAmount() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//SpecifiedTradeSettlementMonetarySummation//TaxTotalAmount");
|
||||
} else {
|
||||
return extractString("//SpecifiedTradeSettlementHeaderMonetarySummation//TaxTotalAmount");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the RoundingAmount
|
||||
*/
|
||||
public String getRoundingAmount() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//SpecifiedTradeSettlementMonetarySummation//RoundingAmount");
|
||||
} else {
|
||||
return extractString("//SpecifiedTradeSettlementHeaderMonetarySummation//RoundingAmount");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the TotalPrepaidAmount
|
||||
*/
|
||||
public String getPaidAmount() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//SpecifiedTradeSettlementMonetarySummation//TotalPrepaidAmount");
|
||||
} else {
|
||||
return extractString("//SpecifiedTradeSettlementHeaderMonetarySummation//TotalPrepaidAmount");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SellerTradeParty GlobalID
|
||||
*/
|
||||
public String getSellerTradePartyGlobalID() {
|
||||
return extractString("//SellerTradeParty//GlobalID");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the BuyerTradeParty GlobalID
|
||||
*/
|
||||
public String getBuyerTradePartyGlobalID() {
|
||||
return extractString("//BuyerTradeParty//GlobalID");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the BuyerTradeParty SpecifiedTaxRegistration ID
|
||||
*/
|
||||
public String getBuyertradePartySpecifiedTaxRegistrationID() {
|
||||
return extractString("//BuyerTradeParty//SpecifiedTaxRegistration//ID");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the IncludedNote
|
||||
*/
|
||||
public String getIncludedNote() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//HeaderExchangedDocument//IncludedNote");
|
||||
} else {
|
||||
return extractString("//ExchangedDocument//IncludedNote");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the BuyerTradeParty Name
|
||||
*/
|
||||
public String getBuyerTradePartyName() {
|
||||
return extractString("//BuyerTradeParty//Name");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the line Total Amount
|
||||
*/
|
||||
public String getLineTotalAmount() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//SpecifiedTradeSettlementMonetarySummation//LineTotalAmount");
|
||||
} else {
|
||||
return extractString("//SpecifiedTradeSettlementHeaderMonetarySummation//LineTotalAmount");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Payment Terms
|
||||
*/
|
||||
public String getPaymentTerms() {
|
||||
return extractString("//SpecifiedTradePaymentTerms//Description");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Taxpoint Date
|
||||
*/
|
||||
public String getTaxPointDate() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//ActualDeliverySupplyChainEvent//OccurrenceDateTime//DateTimeString");
|
||||
} else {
|
||||
return extractString("//ActualDeliverySupplyChainEvent//OccurrenceDateTime//DateTimeString");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Invoice ID
|
||||
*/
|
||||
public String getInvoiceID() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//HeaderExchangedDocument//ID");
|
||||
} else {
|
||||
return extractString("//ExchangedDocument//ID");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the document code
|
||||
@@ -442,7 +688,7 @@ public class ZUGFeRDImporter {
|
||||
// SpecifiedExchangedDocumentContext is in the schema, so a relatively good
|
||||
// indication if zugferd is present - better than just invoice
|
||||
String meta = getMeta();
|
||||
return (meta != null) && (meta.length() > 0) && ((meta.contains("SpecifiedExchangedDocumentContext") //$NON-NLS-1$
|
||||
return (meta != null) && (meta.length() > 0) && ((meta.contains("SpecifiedExchangedDocumentContext")
|
||||
/* ZF1 */ || meta.contains("ExchangedDocumentContext") /* ZF2 */));
|
||||
}
|
||||
|
||||
@@ -454,6 +700,28 @@ public class ZUGFeRDImporter {
|
||||
return s.hasNext() ? s.next() : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an instance of PostalTradeAddress for SellerTradeParty section
|
||||
* @return an instance of PostalTradeAddress
|
||||
*/
|
||||
public PostalTradeAddress getBuyerTradePartyAddress() {
|
||||
|
||||
NodeList nl = null;
|
||||
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
nl = getNodeListByPath("//CrossIndustryDocument//SpecifiedSupplyChainTradeTransaction//ApplicableSupplyChainTradeAgreement//BuyerTradeParty//PostalTradeAddress");
|
||||
} else {
|
||||
nl = getNodeListByPath("//CrossIndustryInvoice//SupplyChainTradeTransaction//ApplicableHeaderTradeAgreement//BuyerTradeParty//PostalTradeAddress");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
return getAddressFromNodeList(nl);
|
||||
}
|
||||
|
||||
/**
|
||||
* returns an instance of PostalTradeAddress for SellerTradeParty section
|
||||
* @return an instance of PostalTradeAddress
|
||||
@@ -471,9 +739,15 @@ public class ZUGFeRDImporter {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return address;
|
||||
return null;
|
||||
}
|
||||
|
||||
return getAddressFromNodeList(nl);
|
||||
}
|
||||
|
||||
private PostalTradeAddress getAddressFromNodeList(NodeList nl) {
|
||||
PostalTradeAddress address = new PostalTradeAddress();
|
||||
|
||||
if (nl != null) {
|
||||
for (int i = 0; i < nl.getLength(); i++) {
|
||||
Node n = nl.item(i);
|
||||
@@ -484,25 +758,46 @@ public class ZUGFeRDImporter {
|
||||
if (nodeType==Node.ELEMENT_NODE){
|
||||
switch (n.getNodeName()) {
|
||||
case "ram:PostcodeCode":
|
||||
address.setPostCodeCode(n.getFirstChild().getNodeValue());
|
||||
address.setPostCodeCode("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setPostCodeCode(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:LineOne":
|
||||
address.setLineOne(n.getFirstChild().getNodeValue());
|
||||
address.setLineOne("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setLineOne(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:LineTwo":
|
||||
address.setLineTwo(n.getFirstChild().getNodeValue());
|
||||
address.setLineTwo("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setLineTwo(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:LineThree":
|
||||
address.setLineThree(n.getFirstChild().getNodeValue());
|
||||
address.setLineThree("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setLineThree(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:CityName":
|
||||
address.setCityName(n.getFirstChild().getNodeValue());
|
||||
address.setCityName("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setCityName(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:CountryID":
|
||||
address.setCountryID(n.getFirstChild().getNodeValue());
|
||||
address.setCountryID("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setCountryID(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
case "ram:CountrySubDivisionName":
|
||||
address.setCountrySubDivisionName(n.getFirstChild().getNodeValue());
|
||||
address.setCountrySubDivisionName("");
|
||||
if (n.getFirstChild() != null) {
|
||||
address.setCountrySubDivisionName(n.getFirstChild().getNodeValue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -512,7 +807,6 @@ public class ZUGFeRDImporter {
|
||||
return address;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* returns a list of LineItems
|
||||
* @return a List of LineItem instances
|
||||
@@ -556,16 +850,16 @@ public class ZUGFeRDImporter {
|
||||
case "ram:SpecifiedTradeProduct":
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:SellerAssignedID");
|
||||
lineItem.product.setSellerAssignedID(getNodeValue(node));
|
||||
lineItem.getProduct().setSellerAssignedID(getNodeValue(node));
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:BuyerAssignedID");
|
||||
lineItem.product.setBuyerAssignedID(getNodeValue(node));
|
||||
lineItem.getProduct().setBuyerAssignedID(getNodeValue(node));
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:Name");
|
||||
lineItem.product.setName(getNodeValue(node));
|
||||
lineItem.getProduct().setName(getNodeValue(node));
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:Description");
|
||||
lineItem.product.setDescription(getNodeValue(node));
|
||||
lineItem.getProduct().setDescription(getNodeValue(node));
|
||||
break;
|
||||
|
||||
case "ram:SpecifiedLineTradeDelivery":
|
||||
@@ -579,7 +873,7 @@ public class ZUGFeRDImporter {
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:ApplicableTradeTax");
|
||||
if (node != null) {
|
||||
node = getNodeByName(node.getChildNodes(), "ram:RateApplicablePercent");
|
||||
lineItem.product.setVATPercent(tryBigDecimal(getNodeValue(node)));
|
||||
lineItem.getProduct().setVATPercent(tryBigDecimal(getNodeValue(node)));
|
||||
}
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:ApplicableTradeTax");
|
||||
@@ -600,7 +894,7 @@ public class ZUGFeRDImporter {
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:ApplicableTradeTax");
|
||||
if (node != null) {
|
||||
node = getNodeByName(node.getChildNodes(), "ram:ApplicablePercent");
|
||||
lineItem.product.setVATPercent(tryBigDecimal(getNodeValue(node)));
|
||||
lineItem.getProduct().setVATPercent(tryBigDecimal(getNodeValue(node)));
|
||||
}
|
||||
|
||||
node = getNodeByName(nn.getChildNodes(), "ram:ApplicableTradeTax");
|
||||
|
||||
@@ -1,64 +1,83 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.mustangproject.*;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.xml.xpath.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class ZUGFeRDInvoiceImporter extends ZUGFeRDImporter {
|
||||
public ZUGFeRDInvoiceImporter(String filename) {
|
||||
super(filename);
|
||||
}
|
||||
public ZUGFeRD2PushProvider extractInvoice() {
|
||||
|
||||
String number="AB123";
|
||||
ZUGFeRD2PushProvider zpp=new ZUGFeRD2PushProvider().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number);
|
||||
//.addItem(new Item(new Product("Testprodukt","","C62",new BigDecimal(0)),amount,new BigDecimal(1.0)))
|
||||
zpp.setOwnOrganisationName(extractString("//SellerTradeParty/Name"));
|
||||
public Invoice extractInvoice() {
|
||||
|
||||
String number = "AB123";
|
||||
/**
|
||||
* dummywerte sind derzeit noch setDueDate setIssueDate setDeliveryDate setSender setRecipient setnumber
|
||||
* bspw. due date //ExchangedDocument//IssueDateTime//DateTimeString : due date optional
|
||||
*/
|
||||
XPathFactory xpathFact = XPathFactory.newInstance();
|
||||
XPath xpath = xpathFact.newXPath();
|
||||
Invoice zpp = null;
|
||||
try {
|
||||
|
||||
XPathExpression xpr = xpath.compile(
|
||||
"//SellerTradeParty");
|
||||
NodeList SellerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
xpr = xpath.compile(
|
||||
"//BuyerTradeParty");
|
||||
NodeList BuyerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
zpp= new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(SellerNodes)).setRecipient(new TradeParty(BuyerNodes)).setNumber(number);
|
||||
//.addItem(new Item(new Product("Testprodukt","","C62",new BigDecimal(0)),amount,new BigDecimal(1.0)))
|
||||
zpp.setOwnOrganisationName(extractString("//SellerTradeParty/Name"));
|
||||
|
||||
xpr = xpath.compile(
|
||||
"//*[local-name()=\"IncludedSupplyChainTradeLineItem\"]");
|
||||
NodeList nodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
if (nodes.getLength() == 0) {
|
||||
} else {
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
//nodes.item(i).getTextContent())) {
|
||||
Node currentItemNode=nodes.item(i);
|
||||
NodeList itemChilds=currentItemNode.getChildNodes();
|
||||
String price="0";
|
||||
for (int itemChildIndex = 0; itemChildIndex < itemChilds.getLength(); itemChildIndex++) {
|
||||
if (itemChilds.item(itemChildIndex).getNodeName().equals("ram:SpecifiedLineTradeAgreement")) {
|
||||
NodeList tradeLineChilds = itemChilds.item(itemChildIndex).getChildNodes();
|
||||
for (int tradeLineChildIndex = 0; tradeLineChildIndex < tradeLineChilds.getLength(); tradeLineChildIndex++) {
|
||||
if (tradeLineChilds.item(tradeLineChildIndex).getNodeName().equals("ram:NetPriceProductTradePrice")) {
|
||||
NodeList netChilds = tradeLineChilds.item(tradeLineChildIndex).getChildNodes();
|
||||
for (int netIndex = 0; netIndex < netChilds.getLength(); netIndex++) {
|
||||
if (netChilds.item(netIndex).getNodeName().equals("ram:ChargeAmount")) {
|
||||
price = netChilds.item(netIndex).getTextContent();//ram:ChargeAmount
|
||||
if (nodes.getLength() == 0) {
|
||||
} else {
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
//nodes.item(i).getTextContent())) {
|
||||
Node currentItemNode = nodes.item(i);
|
||||
NodeList itemChilds = currentItemNode.getChildNodes();
|
||||
String price = "0";
|
||||
String quantity = "0";
|
||||
for (int itemChildIndex = 0; itemChildIndex < itemChilds.getLength(); itemChildIndex++) {
|
||||
if (itemChilds.item(itemChildIndex).getNodeName().equals("ram:SpecifiedLineTradeAgreement")) {
|
||||
NodeList tradeLineChilds = itemChilds.item(itemChildIndex).getChildNodes();
|
||||
for (int tradeLineChildIndex = 0; tradeLineChildIndex < tradeLineChilds.getLength(); tradeLineChildIndex++) {
|
||||
if (tradeLineChilds.item(tradeLineChildIndex).getNodeName().equals("ram:NetPriceProductTradePrice")) {
|
||||
NodeList netChilds = tradeLineChilds.item(tradeLineChildIndex).getChildNodes();
|
||||
for (int netIndex = 0; netIndex < netChilds.getLength(); netIndex++) {
|
||||
if (netChilds.item(netIndex).getNodeName().equals("ram:ChargeAmount")) {
|
||||
price = netChilds.item(netIndex).getTextContent();//ram:ChargeAmount
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemChilds.item(itemChildIndex).getNodeName().equals("ram:SpecifiedLineTradeDelivery")) {
|
||||
NodeList tradeLineChilds = itemChilds.item(itemChildIndex).getChildNodes();
|
||||
for (int tradeLineChildIndex = 0; tradeLineChildIndex < tradeLineChilds.getLength(); tradeLineChildIndex++) {
|
||||
if (tradeLineChilds.item(tradeLineChildIndex).getNodeName().equals("ram:BilledQuantity")) {
|
||||
quantity = tradeLineChilds.item(tradeLineChildIndex).getTextContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Logger.getLogger(ZUGFeRDInvoiceImporter.class.getName()).log(Level.INFO, "deb "+price);
|
||||
// dummywerte sind derzeit noch produkname, beschreibung, unit, VAT percent, menge
|
||||
zpp.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), new BigDecimal(price), new BigDecimal(quantity)));
|
||||
}
|
||||
|
||||
zpp.addItem(new Item(new Product("Testprodukt","","C62",new BigDecimal(0)),new BigDecimal(price),new BigDecimal(1.0)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (XPathExpressionException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -32,12 +32,12 @@ import java.util.logging.Logger;
|
||||
public class ZUGFeRDVisualizer {
|
||||
|
||||
static final ClassLoader CLASS_LOADER = ZUGFeRDVisualizer.class.getClassLoader();
|
||||
private static final String RESOURCE_PATH = ""; //$NON-NLS-1$
|
||||
private static final String RESOURCE_PATH = "";
|
||||
private static final Logger LOG = Logger.getLogger(ZUGFeRDVisualizer.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$
|
||||
// File result = File.createTempFile("ZUV_", suffix);
|
||||
// result.deleteOnExit();
|
||||
//
|
||||
// try (FileOutputStream fos = new FileOutputStream(result)) {
|
||||
|
||||
@@ -21,5 +21,6 @@ package org.mustangproject.ZUGFeRD.model;
|
||||
public class DocumentCodeTypeConstants {
|
||||
public static final String INVOICE = "380";
|
||||
public static final String DEBITNOTE = "84";
|
||||
public static final String CORRECTEDINVOICE = "384";
|
||||
public static final String CREDITNOTE = "389";
|
||||
}
|
||||
|
||||
30
library/src/main/resources/logback.xml
Normal file
30
library/src/main/resources/logback.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<configuration>
|
||||
|
||||
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<target>System.err</target>
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- Daily rollover -->
|
||||
<fileNamePattern>log/ZUV-%d{yyyy-MM}.log</fileNamePattern>
|
||||
|
||||
<!-- Keep 5 years worth of history -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- Configure so that it outputs to both console and log file -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="STDERR" />
|
||||
</root>
|
||||
</configuration>
|
||||
3008
library/src/main/resources/stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt
Normal file
3008
library/src/main/resources/stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt
Normal file
File diff suppressed because it is too large
Load Diff
2202
library/src/main/resources/stylesheets/cii-xr.xsl
Normal file
2202
library/src/main/resources/stylesheets/cii-xr.xsl
Normal file
File diff suppressed because it is too large
Load Diff
1184
library/src/main/resources/stylesheets/xrechnung-html.xsl
Normal file
1184
library/src/main/resources/stylesheets/xrechnung-html.xsl
Normal file
File diff suppressed because it is too large
Load Diff
917
library/src/main/resources/xrechnung-viewer.css
Normal file
917
library/src/main/resources/xrechnung-viewer.css
Normal file
@@ -0,0 +1,917 @@
|
||||
/* Grundformatierung ********************************************/
|
||||
|
||||
*,
|
||||
*:after,
|
||||
*:before
|
||||
{
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
}
|
||||
|
||||
.clear:after
|
||||
{
|
||||
content: ".";
|
||||
clear: both;
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body
|
||||
{
|
||||
height: 100%;
|
||||
min-width: 320px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #000;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
body
|
||||
{
|
||||
overflow-y: scroll;
|
||||
background-color: rgba(4, 101, 161, 0.08);
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
color: inherit;
|
||||
font-size: inherit;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
|
||||
/* Grundaufbau *************************************************/
|
||||
|
||||
.menue
|
||||
{
|
||||
position: relative;
|
||||
z-index: 2000;
|
||||
background-color: #000;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.innen
|
||||
{
|
||||
max-width: 1080px;
|
||||
margin: 0 auto;
|
||||
padding: 0 2%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Formatierungen *************************************************/
|
||||
|
||||
.color2
|
||||
{
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.schwarz
|
||||
{
|
||||
color: #555 !important;
|
||||
}
|
||||
|
||||
.normal
|
||||
{
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.bold
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.abstandUnten
|
||||
{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.abstandUntenKlein
|
||||
{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.noPaddingTop
|
||||
{
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
|
||||
.ausrichtungRechts
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Menü ********************************************************/
|
||||
|
||||
button
|
||||
{
|
||||
position: relative;
|
||||
font-family: serif;
|
||||
padding-top: 15px;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
margin-right: 2%;
|
||||
}
|
||||
|
||||
.btnAktiv
|
||||
{
|
||||
font-size: 22px;
|
||||
color: #ffb619;
|
||||
height: 50px;
|
||||
outline: none;
|
||||
border: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
.btnAktiv:after
|
||||
{
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
left: 50%;
|
||||
z-index: 10;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
height: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
transform: translateX(-50%);
|
||||
border: 15px solid #000;
|
||||
border-right-color: transparent;
|
||||
border-bottom-color: transparent;
|
||||
border-left-color: transparent;
|
||||
}
|
||||
|
||||
.btnInaktiv,
|
||||
.tab
|
||||
{
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
height: 50px;
|
||||
z-index: 0;
|
||||
outline: none;
|
||||
border: none;
|
||||
background: none;
|
||||
transition: color 0.3s ease;
|
||||
}
|
||||
|
||||
.btnInaktiv:hover,
|
||||
.tab:hover
|
||||
{
|
||||
color: #ffb619;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.divHide
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Content *********************************************************************/
|
||||
|
||||
.inhalt
|
||||
{
|
||||
font-family: sans-serif;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.haftungausschluss
|
||||
{
|
||||
color: #000;
|
||||
text-align: center;
|
||||
padding: 7px;
|
||||
margin-bottom: 30px;
|
||||
width: 100%;
|
||||
border: 1px solid #ffb619;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.box
|
||||
{
|
||||
position: relative;
|
||||
display: table-cell;
|
||||
padding: 0;
|
||||
border: 1px solid rgba(4, 101, 161, 0.2);
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.subBox
|
||||
{
|
||||
border-top: none;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.subBox:last-child
|
||||
{
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.first > .boxzeile > .subBox
|
||||
{
|
||||
border-top: 1px solid rgba(4, 101, 161, 0.2) !important;
|
||||
}
|
||||
|
||||
.boxtitel
|
||||
{
|
||||
display: inline-block;
|
||||
background-color: #0465A1;
|
||||
padding: 7px 10px;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.boxBorderTop
|
||||
{
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.boxBorderLeft
|
||||
{
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.boxtitelSub
|
||||
{
|
||||
color: #000;
|
||||
background-color: rgba(4, 101, 161, 0.1);
|
||||
border-right: 1px solid rgba(4, 101, 161, 0.2);
|
||||
border-bottom: 1px solid rgba(4, 101, 161, 0.2);
|
||||
}
|
||||
|
||||
.boxinhalt
|
||||
{
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.boxtabelle
|
||||
{
|
||||
display: table;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.borderSpacing
|
||||
{
|
||||
border-spacing: 0 5px;
|
||||
}
|
||||
|
||||
.boxabstandtop
|
||||
{
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.boxzeile
|
||||
{
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.boxzeile .box:last-child
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.boxdaten
|
||||
{
|
||||
display: table-cell;
|
||||
padding: 5px 0;
|
||||
vertical-align: middle;
|
||||
height: 38px;
|
||||
/*
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-all;
|
||||
word-break: break-word;
|
||||
-webkit-hyphens: auto;
|
||||
-moz-hyphens: auto;
|
||||
hyphens: auto;
|
||||
*/
|
||||
}
|
||||
|
||||
.boxdaten.wert
|
||||
{
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.boxcell
|
||||
{
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.boxdatenBlock
|
||||
{
|
||||
display: block;
|
||||
padding: 3px 0;
|
||||
/*
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-all;
|
||||
word-break: break-word;
|
||||
-webkit-hyphens: auto;
|
||||
-moz-hyphens: auto;
|
||||
hyphens: auto;
|
||||
*/
|
||||
}
|
||||
|
||||
.noBreak
|
||||
{
|
||||
-ms-word-break: keep-all;
|
||||
word-break: keep-all;
|
||||
word-break: keep-all;
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
.boxabstand
|
||||
{
|
||||
display: table-cell;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
.legende
|
||||
{
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
width: 170px;
|
||||
font-size: 13px;
|
||||
line-height: 16px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.wert
|
||||
{
|
||||
background-color: rgba(4, 101, 161, 0.03);
|
||||
}
|
||||
|
||||
.boxtabelleEinspaltig
|
||||
{
|
||||
width: 49%;
|
||||
}
|
||||
|
||||
.boxtabelleZweispaltig,
|
||||
.boxtabelleDreispaltig
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.box5050
|
||||
{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.boxEinspaltig
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.boxZweispaltig
|
||||
{
|
||||
width: 48.5%;
|
||||
}
|
||||
|
||||
.boxSpalte1 {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.boxSpalte2 {
|
||||
width: 50%;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.paddingLeft {
|
||||
padding-left: 0.1em;
|
||||
}
|
||||
|
||||
.noPadding {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.rechnungsZeile
|
||||
{
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.rechnungsZeile .boxdaten
|
||||
{
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.rechnungSp1
|
||||
{
|
||||
width: 65%;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.rechnungSp2
|
||||
{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.rechnungSp3
|
||||
{
|
||||
width: 25%;
|
||||
font-size: 16px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.detailSp1,
|
||||
.detailSp2
|
||||
{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.detailSp2
|
||||
{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.line1Bottom
|
||||
{
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
|
||||
.line1BottomLight
|
||||
{
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.line2Bottom
|
||||
{
|
||||
border-bottom: 2px solid #000;
|
||||
}
|
||||
|
||||
.paddingTop
|
||||
{
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.paddingBottom
|
||||
{
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.grund
|
||||
{
|
||||
font-size: 16px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0 20px 15px 20px;
|
||||
}
|
||||
|
||||
.grundDetail
|
||||
{
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0 20px 15px 20px;
|
||||
}
|
||||
|
||||
/* Übersichtformatierungen */
|
||||
#uebersichtLastschrift.box,
|
||||
#uebersichtUeberweisung.box
|
||||
{
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#uebersichtUeberweisung.box
|
||||
{
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
|
||||
/* Formatierungen Detailseite */
|
||||
|
||||
.detailsSpalte1,
|
||||
.detailsSpalte2
|
||||
{
|
||||
width: 30%;
|
||||
float: left;
|
||||
font-size: 90%;
|
||||
line-height: 115%;
|
||||
margin-right: 5%;
|
||||
}
|
||||
|
||||
.detailsSpalte3
|
||||
{
|
||||
width: 30%;
|
||||
float: left;
|
||||
font-size: 90%;
|
||||
line-height: 115%;
|
||||
}
|
||||
|
||||
.detailsSpalte1 .legende,
|
||||
.detailsSpalte2 .legende,
|
||||
.detailsSpalte3 .legende
|
||||
{
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.titelPosition
|
||||
{
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/* Laufzettelformatierungen */
|
||||
#laufzettelHistorie .boxtabelle:not(:nth-child(2))
|
||||
{
|
||||
border-top: 1px solid rgba(4, 101, 161, 0.2);
|
||||
padding-top: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* 1023px und kleiner ************************************************/
|
||||
|
||||
@media screen and (max-width : 1023px) {
|
||||
|
||||
.box
|
||||
{
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.boxabstandtop
|
||||
{
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.subBox:first-child
|
||||
{
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.subBox:last-child
|
||||
{
|
||||
border-left: 1px solid rgba(4, 101, 161, 0.2);
|
||||
}
|
||||
|
||||
.first > .boxzeile > .subBox
|
||||
{
|
||||
border-top: none !important;
|
||||
}
|
||||
|
||||
.first > .boxzeile > .subBox:first-child
|
||||
{
|
||||
border-top: 1px solid rgba(4, 101, 161, 0.2) !important;
|
||||
}
|
||||
|
||||
.first > .boxzeile
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#uebersichtUeberweisung.box
|
||||
{
|
||||
border-left: 1px solid rgba(4, 101, 161, 0.2);
|
||||
}
|
||||
|
||||
#uebersichtLastschrift.box
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.boxzeile
|
||||
{
|
||||
display: block;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.boxzeile:after
|
||||
{
|
||||
visibility: hidden;
|
||||
display: block;
|
||||
font-size: 0;
|
||||
content: " ";
|
||||
clear: both;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
#details > .boxtabelle > .boxzeile
|
||||
{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.boxcell
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.boxcell:last-child
|
||||
{
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.boxZweispaltig
|
||||
{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.legende
|
||||
{
|
||||
display: block;
|
||||
float: left;
|
||||
width: 170px;
|
||||
padding: 5px 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wert
|
||||
{
|
||||
display: block;
|
||||
float: left;
|
||||
width: calc(100% - 170px);
|
||||
padding: 11px 10px !important;
|
||||
line-height: 1.3;
|
||||
min-height: 38px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.boxdaten .legende
|
||||
{
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.rechnungsZeile .boxdaten
|
||||
{
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.boxabstand
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.boxtabelleEinspaltig {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.boxSpalte1 {
|
||||
display: block;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.boxSpalte2 {
|
||||
display: block;
|
||||
width: auto;
|
||||
padding-left: 0px;
|
||||
margin-top: 1.2rem;
|
||||
}
|
||||
|
||||
.detailsSpalte1,
|
||||
.detailsSpalte2,
|
||||
.detailsSpalte3
|
||||
{
|
||||
width: 100%;
|
||||
float: none;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.detailsSpalte2,
|
||||
.detailsSpalte3
|
||||
{
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.detailsSpalte2,
|
||||
.detailsSpalte3
|
||||
{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.tableNumberAlignRight
|
||||
{
|
||||
display: block;
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 800px und kleiner ************************************************/
|
||||
|
||||
@media screen and (max-width : 800px) {
|
||||
|
||||
button
|
||||
{
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.btnAktiv,
|
||||
.btnInaktiv,
|
||||
.tab
|
||||
{
|
||||
font-size: 20px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.btnAktiv:after
|
||||
{
|
||||
top: 40px;
|
||||
}
|
||||
|
||||
.rechnungSp1
|
||||
{
|
||||
width: 55%;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.rechnungSp2
|
||||
{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.rechnungSp3
|
||||
{
|
||||
width: 35%;
|
||||
text-align: right;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.grund
|
||||
{
|
||||
font-size: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 450px und kleiner ************************************************/
|
||||
|
||||
@media screen and (max-width : 450px)
|
||||
{
|
||||
|
||||
html,
|
||||
body
|
||||
{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.menue
|
||||
{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
button
|
||||
{
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.btnAktiv,
|
||||
.btnInaktiv,
|
||||
.tab
|
||||
{
|
||||
font-size: 17px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.btnAktiv:after
|
||||
{
|
||||
top: 35px;
|
||||
}
|
||||
|
||||
.legende
|
||||
{
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wert
|
||||
{
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
width: 100%;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
|
||||
.boxzeile
|
||||
{
|
||||
margin-bottom: 0px
|
||||
}
|
||||
|
||||
.boxdaten
|
||||
{
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.haftungausschluss
|
||||
{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.boxinhalt
|
||||
{
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.boxabstandtop
|
||||
{
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.boxtitel
|
||||
{
|
||||
padding: 7px 8px;
|
||||
}
|
||||
|
||||
.box
|
||||
{
|
||||
margin-bottom: 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.boxabstandtop
|
||||
{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.boxdaten,
|
||||
.boxdatenBlock
|
||||
{
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.rechnungSp1
|
||||
{
|
||||
width: 50%;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.rechnungSp2
|
||||
{
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.rechnungSp3
|
||||
{
|
||||
width: 35%;
|
||||
font-size: inherit;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.grund
|
||||
{
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.titelPosition
|
||||
{
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.abstandUnten
|
||||
{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.detailsSpalte1,
|
||||
.detailsSpalte2,
|
||||
.detailsSpalte3
|
||||
{
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
/* 380px und kleiner ************************************************/
|
||||
|
||||
@media screen and (max-width : 380px) {
|
||||
|
||||
html,
|
||||
body
|
||||
{
|
||||
font-size: 11px;
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
.btnAktiv,
|
||||
.btnInaktiv,
|
||||
.tab
|
||||
{
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.boxdaten
|
||||
.boxdatenBlock
|
||||
{
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.boxinhalt
|
||||
{
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.boxtitel
|
||||
{
|
||||
padding: 5px 7px;
|
||||
}
|
||||
}
|
||||
145
library/src/main/resources/xrechnung-viewer.js
Normal file
145
library/src/main/resources/xrechnung-viewer.js
Normal file
@@ -0,0 +1,145 @@
|
||||
|
||||
/* Tab-Container aufbauen **************************************************/
|
||||
|
||||
var a = new Array("uebersicht", "details", "zusaetze", "anlagen", "laufzettel");
|
||||
var b = new Array("menueUebersicht", "menueDetails", "menueZusaetze", "menueAnlagen", "menueLaufzettel");
|
||||
|
||||
function show(e) {
|
||||
var i = 0;
|
||||
var j = 1;
|
||||
for (var t = 0; t < b.length; t++) {
|
||||
if (b[t] === e.id) {
|
||||
i = t;
|
||||
if (i > 0) {
|
||||
j = 0;
|
||||
} else {
|
||||
j = i + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
e.setAttribute("class", "btnAktiv");
|
||||
for (var k = 0; k < b.length; k++) {
|
||||
if (k === i && (document.getElementById(a[k]) != null)) {
|
||||
document.getElementById(a[k]).style.display = "block";
|
||||
if (i === j)
|
||||
j = i + 1;
|
||||
} else {
|
||||
if (document.getElementById(a[k]) != null) {
|
||||
document.getElementById(a[j]).style.display = "none";
|
||||
document.getElementById(b[j]).setAttribute("class", "btnInaktiv");
|
||||
j += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
window.onload = function () {
|
||||
document.getElementById(b[0]).setAttribute("class", "btnAktiv");
|
||||
}
|
||||
|
||||
/* Eingebettete Binaerdaten runterladen ************************************/
|
||||
|
||||
|
||||
function base64_to_binary (data) {
|
||||
var chars = atob(data);
|
||||
var bytes = new Array(chars.length);
|
||||
for (var i = 0; i < chars.length; i++) {
|
||||
bytes[i] = chars.charCodeAt(i);
|
||||
}
|
||||
return new Uint8Array(bytes);
|
||||
}
|
||||
|
||||
function downloadData (element_id) {
|
||||
var data_element = document.getElementById(element_id);
|
||||
var mimetype = data_element.getAttribute('mimeType');
|
||||
var filename = data_element.getAttribute('filename');
|
||||
var text = data_element.innerHTML;
|
||||
var binary = base64_to_binary(text);
|
||||
var blob = new Blob([binary], {
|
||||
type: mimetype, size: binary.length
|
||||
});
|
||||
|
||||
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
// IE
|
||||
window.navigator.msSaveOrOpenBlob(blob, filename);
|
||||
} else {
|
||||
// Non-IE
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
window.open(url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Polyfill IE atob/btoa ************************************/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([], function () {
|
||||
factory(root);
|
||||
});
|
||||
} else factory(root);
|
||||
// node.js has always supported base64 conversions, while browsers that support
|
||||
// web workers support base64 too, but you may never know.
|
||||
})(typeof exports !== "undefined" ? exports: this, function (root) {
|
||||
if (root.atob) {
|
||||
// Some browsers' implementation of atob doesn't support whitespaces
|
||||
// in the encoded string (notably, IE). This wraps the native atob
|
||||
// in a function that strips the whitespaces.
|
||||
// The original function can be retrieved in atob.original
|
||||
try {
|
||||
root.atob(" ");
|
||||
}
|
||||
catch (e) {
|
||||
root.atob = (function (atob) {
|
||||
var func = function (string) {
|
||||
return atob(String(string).replace(/[\t\n\f\r ]+/g, ""));
|
||||
};
|
||||
func.original = atob;
|
||||
return func;
|
||||
})(root.atob);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// base64 character set, plus padding character (=)
|
||||
var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
||||
// Regular expression to check formal correctness of base64 encoded strings
|
||||
b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
||||
|
||||
root.btoa = function (string) {
|
||||
string = String(string);
|
||||
var bitmap, a, b, c,
|
||||
result = "", i = 0,
|
||||
rest = string.length % 3; // To determine the final padding
|
||||
|
||||
for (; i < string.length;) {
|
||||
if ((a = string.charCodeAt(i++)) > 255 || (b = string.charCodeAt(i++)) > 255 || (c = string.charCodeAt(i++)) > 255)
|
||||
throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");
|
||||
|
||||
bitmap = (a << 16) | (b << 8) | c;
|
||||
result += b64.charAt(bitmap >> 18 & 63) + b64.charAt(bitmap >> 12 & 63) + b64.charAt(bitmap >> 6 & 63) + b64.charAt(bitmap & 63);
|
||||
}
|
||||
|
||||
// If there's need of padding, replace the last 'A's with equal signs
|
||||
return rest ? result.slice(0, rest - 3) + "===".substring(rest): result;
|
||||
};
|
||||
|
||||
root.atob = function (string) {
|
||||
// atob can work with strings with whitespaces, even inside the encoded part,
|
||||
// but only \t, \n, \f, \r and ' ', which can be stripped.
|
||||
string = String(string).replace(/[\t\n\f\r ]+/g, "");
|
||||
if (! b64re.test(string))
|
||||
throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");
|
||||
|
||||
// Adding the padding if missing, for semplicity
|
||||
string += "==".slice(2 - (string.length & 3));
|
||||
var bitmap, result = "", r1, r2, i = 0;
|
||||
for (; i < string.length;) {
|
||||
bitmap = b64.indexOf(string.charAt(i++)) << 18 | b64.indexOf(string.charAt(i++)) << 12 | (r1 = b64.indexOf(string.charAt(i++))) << 6 | (r2 = b64.indexOf(string.charAt(i++)));
|
||||
|
||||
result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255): r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255): String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
});
|
||||
@@ -27,6 +27,7 @@ import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.mustangproject.TradeParty;
|
||||
|
||||
/***
|
||||
* This is a test to confirm the minimum steps to implement a interface are still sufficient
|
||||
@@ -34,7 +35,7 @@ import junit.framework.TestCase;
|
||||
* @author jstaerk
|
||||
*
|
||||
*/
|
||||
public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExportableTransaction{
|
||||
public class BackwardCompatibilityTest extends TestCase implements IExportableTransaction {
|
||||
|
||||
final String TARGET_PDF_ZF1 = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506zf1.pdf";
|
||||
final String TARGET_PDF_ZF2 = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506zf2.pdf";
|
||||
@@ -55,9 +56,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(1).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(1).setProfile("EN16931").load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_ZF1);
|
||||
|
||||
@@ -95,9 +96,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("EN16931").load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_ZF2);
|
||||
|
||||
@@ -133,10 +134,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("EN16931").load(SOURCE_PDF)) {
|
||||
|
||||
ze.setFacturX();
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_FX);
|
||||
|
||||
@@ -199,11 +199,6 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
return "bla";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBankName() {
|
||||
return "bla";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return "bla";
|
||||
@@ -307,11 +302,16 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new Contact();
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return new TradeParty("name","street","zip","city","DE");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return new TradeParty("Bei Spiel GmbH","street","zip","city","DE");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTransaction {
|
||||
public class IExportableTransactionImpl implements IExportableTransaction {
|
||||
|
||||
private String number;
|
||||
private Date issueDate;
|
||||
@@ -30,9 +30,8 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
|
||||
private IZUGFeRDAllowanceCharge[] zFCharges;
|
||||
private IZUGFeRDAllowanceCharge[] zFLogisticsServiceCharges;
|
||||
private IZUGFeRDExportableItem[] zFItems;
|
||||
private IZUGFeRDExportableContact recipient;
|
||||
private IZUGFeRDExportableTradeParty recipient;
|
||||
private IZUGFeRDTradeSettlementPayment[] settlementPayments;
|
||||
private IZUGFeRDDate zfDeliveryDate;
|
||||
private String ownTaxID;
|
||||
private String ownVATID;
|
||||
private String ownOrganisationName;
|
||||
@@ -44,6 +43,7 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
|
||||
private String currency;
|
||||
private String paymentTermDescription;
|
||||
private String referenceNumber;
|
||||
private Profile profile;
|
||||
|
||||
@Override
|
||||
public String getNumber() {
|
||||
@@ -86,15 +86,10 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return recipient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||
return settlementPayments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnTaxID() {
|
||||
return ownTaxID;
|
||||
@@ -150,117 +145,107 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
|
||||
return referenceNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDDate getZFDeliveryDate() {
|
||||
return zfDeliveryDate;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setNumber(String number) {
|
||||
public IExportableTransactionImpl setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
public IExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
public IExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
this.ownOrganisationFullPlaintextInfo = ownOrganisationFullPlaintextInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
public IExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
public IExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
this.zFAllowances = zFAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
public IExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
this.zFCharges = zFCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
public IExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
this.zFLogisticsServiceCharges = zFLogisticsServiceCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
public IExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
this.zFItems = zFItems;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
public IExportableTransactionImpl setRecipient(IZUGFeRDExportableTradeParty recipient) {
|
||||
this.recipient = recipient;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
public IExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
public IExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
public IExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
this.ownOrganisationName = ownOrganisationName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
public IExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
this.ownStreet = ownStreet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
public IExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
this.ownZIP = ownZIP;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
public IExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
this.ownLocation = ownLocation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
public IExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
this.ownCountry = ownCountry;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
public IExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZfDeliveryDate(IZUGFeRDDate zfDeliveryDate) {
|
||||
this.zfDeliveryDate = zfDeliveryDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setCurrency(String currency) {
|
||||
|
||||
public IExportableTransactionImpl setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
public IExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
this.paymentTermDescription = paymentTermDescription;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
public IExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
this.referenceNumber = referenceNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setTradeSettlementPayment(IZUGFeRDTradeSettlementPayment... settlementPayments) {
|
||||
public IExportableTransactionImpl setTradeSettlementPayment(IZUGFeRDTradeSettlementPayment... settlementPayments) {
|
||||
this.settlementPayments = settlementPayments;
|
||||
return this;
|
||||
}
|
||||
@@ -24,9 +24,10 @@ public class IZUGFeRDAllowanceChargeImpl implements IZUGFeRDAllowanceCharge {
|
||||
private BigDecimal totalAmount;
|
||||
private String reason;
|
||||
private BigDecimal taxPercent;
|
||||
boolean isCharge=true;
|
||||
|
||||
@Override
|
||||
public BigDecimal getTotalAmount() {
|
||||
public BigDecimal getTotalAmount(IAbsoluteValueProvider currentItem) {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
@@ -40,6 +41,16 @@ public class IZUGFeRDAllowanceChargeImpl implements IZUGFeRDAllowanceCharge {
|
||||
return taxPercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCharge() {
|
||||
return isCharge;
|
||||
}
|
||||
|
||||
public IZUGFeRDAllowanceChargeImpl setAllowance() {
|
||||
isCharge = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDAllowanceChargeImpl setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
return this;
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class IZUGFeRDDateImpl implements IZUGFeRDDate {
|
||||
|
||||
private Date date;
|
||||
private ZUGFeRDDateFormat format = ZUGFeRDDateFormat.DATE;
|
||||
|
||||
public IZUGFeRDDateImpl setDate(Date date) {
|
||||
this.date = date;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDDateImpl setFormat(ZUGFeRDDateFormat format) {
|
||||
this.format = format;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZUGFeRDDateFormat getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,26 +27,11 @@ public class IZUGFeRDTradeSettlementPaymentImpl implements IZUGFeRDTradeSettleme
|
||||
private String ownIBAN;
|
||||
private String ownPaymentInfoText;
|
||||
|
||||
@Override
|
||||
public String getOwnKto() {
|
||||
return ownKto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBLZ() {
|
||||
return ownBLZ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBIC() {
|
||||
return ownBIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnBankName() {
|
||||
return ownBankName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnIBAN() {
|
||||
return ownIBAN;
|
||||
|
||||
@@ -22,9 +22,7 @@ import junit.framework.TestCase;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRDExportableTransaction {
|
||||
public abstract class MustangReaderTestCase extends TestCase implements IExportableTransaction {
|
||||
|
||||
public MustangReaderTestCase(String testName) {
|
||||
super(testName);
|
||||
@@ -32,7 +30,7 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||
public IZUGFeRDTradeSettlement[] getTradeSettlement() {
|
||||
Payment[] payments = new Payment[1];
|
||||
payments[0] = new Payment();
|
||||
return payments;
|
||||
@@ -40,26 +38,11 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
|
||||
protected class Payment implements IZUGFeRDTradeSettlementPayment {
|
||||
|
||||
@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 getOwnPaymentInfoText() {
|
||||
return "Überweisung";
|
||||
@@ -71,7 +54,7 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
}
|
||||
}
|
||||
|
||||
protected class RecipientContact implements IZUGFeRDExportableContact {
|
||||
protected class RecipientTradeParty implements IZUGFeRDExportableTradeParty {
|
||||
|
||||
@Override
|
||||
public String getCountry() {
|
||||
@@ -103,7 +86,7 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
return "88802";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected class SenderContact implements IZUGFeRDExportableContact {
|
||||
|
||||
|
||||
@@ -125,6 +108,41 @@ public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRD
|
||||
|
||||
}
|
||||
|
||||
protected class SenderTradeParty implements IZUGFeRDExportableTradeParty {
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Bei Spiel GmbH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getZIP() {
|
||||
return "12345";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCountry() {
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocation() {
|
||||
return "Stadthausen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getStreet() {
|
||||
return "Ecke 12";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTaxID() {
|
||||
return "0815";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected class Item implements IZUGFeRDExportableItem {
|
||||
|
||||
public Item(BigDecimal price, BigDecimal quantity, IZUGFeRDExportableProduct product) {
|
||||
|
||||
@@ -31,13 +31,13 @@ import java.nio.charset.StandardCharsets;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
* @param testName name of the test case
|
||||
*/
|
||||
public MustangReaderWriterCustomXMLTest(String testName) {
|
||||
|
||||
super(testName);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
try {
|
||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator("Test").setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931)
|
||||
IZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1().setProducer("My Application").setCreator("Test").setProfile(Profiles.getByName("EN16931"))
|
||||
.load(SOURCE_PDF);
|
||||
|
||||
final byte[] UTF8ByteOrderMark = new byte[]{(byte) 0xef, (byte) 0xbb, (byte) 0xbf};
|
||||
@@ -256,7 +256,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
" </ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" </rsm:SupplyChainTradeTransaction>\n" +
|
||||
"</rsm:CrossIndustryInvoice>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
@@ -297,11 +297,11 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
try {
|
||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory()
|
||||
IZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1()
|
||||
.setProducer("My Application")
|
||||
.setCreator("Test")
|
||||
.setZUGFeRDVersion(1)
|
||||
.setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.BASIC)
|
||||
.setProfile(Profiles.getByName("BASIC",1))
|
||||
.load(SOURCE_PDF);
|
||||
/* 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 = "<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\">\n"
|
||||
@@ -437,7 +437,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
+ "<ram:Name>Heiße Luft pro Liter</ram:Name>\n" + "<ram:Description/>\n"
|
||||
+ "</ram:SpecifiedTradeProduct>\n" + "</ram:IncludedSupplyChainTradeLineItem>\n"
|
||||
+ "</rsm:SpecifiedSupplyChainTradeTransaction>\n" + "</rsm:CrossIndustryDocument>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
|
||||
@@ -76,8 +76,8 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getOwnContact() {
|
||||
return new SenderContact();
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return new SenderTradeParty();
|
||||
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new RecipientContact();
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return new RecipientTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -150,6 +150,7 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
return "AB321";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create the test case
|
||||
*
|
||||
@@ -180,8 +181,8 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getIBAN(), getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
assertEquals(zi.getBIC(), "COBADEFFXXX");
|
||||
assertEquals(zi.getIBAN(), "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getDueDate(), "20170530");
|
||||
assertEquals(zi.getForeignReference(), getNumber());
|
||||
@@ -202,19 +203,19 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
|
||||
try (InputStream SOURCE_PDF =
|
||||
this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory()
|
||||
) {
|
||||
ZUGFeRDExporterFromA3 ze = new ZUGFeRDExporterFromA3()
|
||||
.setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name"))
|
||||
.setZUGFeRDVersion(1)
|
||||
.ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
.load(SOURCE_PDF);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryDocument"));
|
||||
ze.export(TARGET_PDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen in testEdgeExport");
|
||||
e.printStackTrace();
|
||||
fail("IOException should not happen in testEdgeExport ");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
@@ -222,8 +223,8 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("571.04", zi.getAmount());
|
||||
assertEquals(getTradeSettlementPayment()[0].getOwnBIC(), zi.getBIC());
|
||||
assertEquals(getTradeSettlementPayment()[0].getOwnIBAN(), zi.getIBAN());
|
||||
assertEquals("COBADEFFXXX", zi.getBIC());
|
||||
assertEquals("DE88 2008 0000 0970 3757 00", zi.getIBAN());
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getForeignReference(), getNumber());
|
||||
try {
|
||||
|
||||
@@ -100,13 +100,13 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new RecipientContact();
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return new RecipientTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getOwnContact() {
|
||||
return new SenderContact();
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return new SenderTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -196,8 +196,8 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getIBAN(),getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
assertEquals(zi.getBIC(), "COBADEFFXXX");
|
||||
assertEquals(zi.getIBAN(), "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getForeignReference(), "RE-20170509/505");
|
||||
assertEquals(zi.getBankName(), "Commerzbank");
|
||||
@@ -304,7 +304,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
|
||||
File tempFile = File.createTempFile("ZUGFeRD-", "-test");
|
||||
ze.export(tempFile.getAbsolutePath());
|
||||
@@ -317,7 +317,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
|
||||
File tempFile = File.createTempFile("ZUGFeRD-", "-test");
|
||||
tempFile.deleteOnExit();
|
||||
@@ -358,9 +358,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.getByName("EN16931")).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -383,9 +383,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getBIC(), "COBADEFFXXX");
|
||||
assertEquals(zi.getReference(), getReferenceNumber());
|
||||
assertEquals(zi.getIBAN(), getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
assertEquals(zi.getIBAN(), "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getForeignReference(), getNumber());
|
||||
}
|
||||
@@ -402,9 +402,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(1).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.COMFORT).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(1).setProfile(Profiles.getByName("COMFORT",1)).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -430,9 +430,17 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
ze.setFacturX();
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.getByName("EN16931")).load(SOURCE_PDF)) {
|
||||
ByteArrayOutputStream result = new ByteArrayOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int length;
|
||||
while ((length = SOURCE_PDF.read(buffer)) != -1) {
|
||||
result.write(buffer, 0, length);
|
||||
}
|
||||
|
||||
ze.addAdditionalFile("test.pdf", result.toByteArray());
|
||||
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -451,11 +459,11 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getIBAN(), getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getForeignReference(), getNumber());
|
||||
assertEquals("571.04", zi.getAmount());
|
||||
assertEquals("COBADEFFXXX", zi.getBIC());
|
||||
assertEquals("DE88 2008 0000 0970 3757 00", zi.getIBAN());
|
||||
assertEquals(getOwnOrganisationName(), zi.getHolder());
|
||||
assertEquals(getNumber(), zi.getForeignReference());
|
||||
}
|
||||
|
||||
public void testExceptionOnPDF14() {
|
||||
@@ -467,9 +475,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDF14.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
118
library/src/test/java/org/mustangproject/ZUGFeRD/UXTest.java
Normal file
118
library/src/test/java/org/mustangproject/ZUGFeRD/UXTest.java
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
/** **********************************************************************
|
||||
*
|
||||
* Copyright 2019 Jochen Staerk
|
||||
*
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* 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 junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.TestSuite;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.Contact;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.Item;
|
||||
import org.mustangproject.Product;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class UXTest extends TestCase {
|
||||
final String TARGET_PDF = "./target/testout-UX.pdf";
|
||||
public void testShortExport() {
|
||||
|
||||
// the writing part
|
||||
/*
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf"))
|
||||
{
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName("My company").setOwnStreet("teststr").setOwnZIP("12345").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber("INV/123").addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), new BigDecimal(1.0), new BigDecimal(1.0)));
|
||||
new ZUGFeRDExporterFromA1().load("source.pdf").setTransaction(i).export(TARGET_PDF);
|
||||
} catch (Exception e) {
|
||||
fail("Exception should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
|
||||
|
||||
assertTrue(zi.getUTF8().contains("<ram:DueDateDateTime>"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getInvoiceID(), "RE-20170509/505");
|
||||
assertEquals(zi.getZUGFeRDProfil(), "COMFORT");
|
||||
assertEquals(zi.getInvoiceCurrencyCode(), "EUR");
|
||||
assertEquals(zi.getIssuerAssignedID(),"");
|
||||
assertEquals(zi.getIssueDate(), "20170509");
|
||||
assertEquals(zi.getTaxPointDate(), "20170507");
|
||||
assertEquals(zi.getPaymentTerms(), "Zahlbar ohne Abzug bis zum 30.05.2017");
|
||||
assertEquals(zi.getLineTotalAmount(), "496.00");
|
||||
assertEquals(zi.getTaxBasisTotalAmount(), "496.00");
|
||||
assertEquals(zi.getTaxTotalAmount(),"75.04");
|
||||
assertEquals(zi.getRoundingAmount(), "");
|
||||
assertEquals(zi.getPaidAmount(), "0.00");
|
||||
assertEquals(zi.getBuyerTradePartyName(), "Theodor Est");
|
||||
assertEquals(zi.getBuyerTradePartyGlobalID(), "");
|
||||
assertEquals(zi.getSellerTradePartyGlobalID(), "");
|
||||
assertEquals(zi.getBuyerTradePartyID(), "DE999999999");
|
||||
assertEquals(zi.getBuyertradePartySpecifiedTaxRegistrationID(), "DE999999999");
|
||||
assertEquals(zi.getIncludedNote(), "");
|
||||
assertEquals(zi.getDocumentCode(),"380");
|
||||
assertEquals(zi.getReference(),"AB321");
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getPostcodeCode(), "88802");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineOne(), "Bahnstr. 42");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineTwo(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineThree(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCountrySubDivisionName(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCountryID(), "DE");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCityName(), "Spielkreis");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getPostcodeCode(), "12345");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getLineOne(), "Ecke 12");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getLineTwo(), null);
|
||||
assertEquals(zi.getSellerTradePartyAddress().getLineThree(), null);
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCountrySubDivisionName(), null);
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCountryID(), "DE");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCityName(), "Stadthausen");
|
||||
|
||||
List<org.mustangproject.Item> li = zi.getLineItemList();
|
||||
assertEquals(zi.getLineItemList().get(0).getId().toString(), "1");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getBuyerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getSellerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getLineTotalAmount().toString(), "160.00");
|
||||
assertEquals(zi.getLineItemList().get(0).getQuantity().toString(), "1.0000");
|
||||
assertEquals(zi.getLineItemList().get(0).getGrossPrice().toString(), "160.0000");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getVATPercent().toString(), "7.00");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getName(), "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getDescription(), "");
|
||||
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
67
library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java
Normal file
67
library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2019 Jochen Staerk
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* 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.
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import org.mustangproject.*;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRD2PullProvider;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import static org.xmlunit.assertj.XmlAssert.assertThat;
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class XRTest extends TestCase {
|
||||
|
||||
public void testPushExport() {
|
||||
|
||||
// the writing part
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "1.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname,"teststr","55232","teststadt","DE")).setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), amount, new BigDecimal(1.0)));
|
||||
|
||||
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
|
||||
zf2p.generateXML(i);
|
||||
String theXML = new String(zf2p.getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
assertThat(theXML).valueByXPath("count(//*[local-name()='IncludedSupplyChainTradeLineItem'])")
|
||||
.asInt()
|
||||
.isEqualTo(1); //2 errors are OK because there is a known bug
|
||||
|
||||
|
||||
assertThat(theXML).valueByXPath("//*[local-name()='DuePayableAmount']")
|
||||
.asDouble()
|
||||
.isEqualTo(1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,13 +30,12 @@ import java.util.GregorianCalendar;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExportableTransaction {
|
||||
public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTransaction {
|
||||
final String TARGET_PDF = "./target/testout-ZF2newEdge.pdf";
|
||||
|
||||
protected class EdgeProduct implements IZUGFeRDExportableProduct {
|
||||
@@ -101,11 +100,6 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlementPayment[] getTradeSettlementPayment() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDTradeSettlement[] getTradeSettlement() {
|
||||
IZUGFeRDTradeSettlement[] payments = new DebitPayment[1];
|
||||
@@ -154,8 +148,8 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getOwnContact() {
|
||||
return new SenderContact();
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return new SenderTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,13 +168,13 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new RecipientContact();
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return new RecipientTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getDeliveryAddress() {
|
||||
return new RecipientContact();
|
||||
public IZUGFeRDExportableTradeParty getDeliveryAddress() {
|
||||
return new RecipientTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -266,12 +260,12 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
// the writing part
|
||||
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
@@ -316,10 +310,10 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA3().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).disableFacturX()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(bos);
|
||||
|
||||
@@ -1,64 +1,73 @@
|
||||
|
||||
/** **********************************************************************
|
||||
*
|
||||
/**
|
||||
* *********************************************************************
|
||||
* <p>
|
||||
* Copyright 2019 Jochen Staerk
|
||||
*
|
||||
* <p>
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* 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.
|
||||
*
|
||||
* <p>
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*********************************************************************** */
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.mustangproject.*;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class ZF2PushTest extends TestCase {
|
||||
public class ZF2PushTest extends TestCase {
|
||||
final String TARGET_PDF = "./target/testout-ZF2Push.pdf";
|
||||
final String TARGET_CORRECTIONPDF = "./target/testout-ZF2PushCorrection.pdf";
|
||||
final String TARGET_ITEMCHARGESALLOWANCESPDF = "./target/testout-ZF2PushItemChargesAllowances.pdf";
|
||||
final String TARGET_CHARGESALLOWANCESPDF = "./target/testout-ZF2PushChargesAllowances.pdf";
|
||||
final String TARGET_RELATIVECHARGESALLOWANCESPDF = "./target/testout-ZF2PushRelativeChargesAllowances.pdf";
|
||||
final String TARGET_ATTACHMENTSPDF = "./target/testout-ZF2PushAttachments.pdf";
|
||||
|
||||
public void testPushExport() {
|
||||
|
||||
// the writing part
|
||||
|
||||
String orgname="Test company";
|
||||
String number="123";
|
||||
String amountStr="1.00";
|
||||
BigDecimal amount=new BigDecimal(amountStr);
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "1.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
String occurenceFrom = "20201001";
|
||||
String occurenceTo = "20201005";
|
||||
String contractID = "376zreurzu0983";
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
try {
|
||||
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setContractReferencedDocument(contractID).setOccurrencePeriod(new SimpleDateFormat("yyyyMMdd").parse(occurenceFrom), new SimpleDateFormat("yyyyMMdd").parse(occurenceTo)).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addBankDetails(new BankDetails("777666555", "DE4321"))).setOwnTaxID("4711").setOwnVATID("DE19990815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setAdditionalAddress("Hinterhaus 3").setContact(new Contact("nameRep", "phoneRep", "emailRep@test.com"))).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0))));
|
||||
} catch (ParseException ex) {
|
||||
throw new RuntimeException("Parse exception");
|
||||
}
|
||||
|
||||
ze.PDFattachZugferdFile(new ZUGFeRD2PushProvider().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number).addItem(new Item(new Product("Testprodukt","","C62",new BigDecimal(0)),amount,new BigDecimal(1.0))));
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
@@ -66,11 +75,19 @@ public class ZF2PushTest extends TestCase {
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
|
||||
assertTrue(zi.getUTF8().contains("777666555")); //the iban
|
||||
|
||||
assertFalse(zi.getUTF8().contains("EUR"));
|
||||
assertTrue(zi.getUTF8().contains("<rsm:CrossIndustryInvoice"));
|
||||
|
||||
assertTrue(zi.getUTF8().contains("EUR")); //default invoice currency
|
||||
assertTrue(zi.getUTF8().contains(occurenceFrom));
|
||||
assertTrue(zi.getUTF8().contains(occurenceTo));
|
||||
assertTrue(zi.getUTF8().contains(contractID));
|
||||
assertTrue(zi.getUTF8().contains("Hinterhaus")); // lineTwo/additionalAddress
|
||||
assertTrue(zi.getUTF8().contains("0815"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(amountStr, zi.getAmount());
|
||||
assertEquals("1.19", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
@@ -81,4 +98,237 @@ public class ZF2PushTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
public void testAttachmentsExport() {
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "1.00";
|
||||
String taxID = "9990815";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
byte[] b = {12, 13};
|
||||
ze.attachFile("one.pdf", b, "Application/PDF", "Alternative");
|
||||
ze.attachFile("two.pdf", b, "Application/PDF", "Alternative");
|
||||
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addTaxID(taxID)).setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE4711").setContact(new Contact("Franz Müller", "01779999999", "franz@mueller.de", "teststr. 12", "55232", "Entenhausen", "DE"))).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
|
||||
);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_ATTACHMENTSPDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ATTACHMENTSPDF);
|
||||
|
||||
assertTrue(zi.getUTF8().contains("EUR"));
|
||||
assertTrue(zi.getUTF8().contains(taxID));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("1.19", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void testItemChargesAllowancesExport() {
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "3.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setProfile("extended").ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
// ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname,"teststr", "55232","teststadt","DE")).setOwnTaxID("4711").setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number)
|
||||
// .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50)))));
|
||||
|
||||
|
||||
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE")).setOwnTaxID("4711").setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setContact(new Contact("contact testname","123456","contact.testemail@example.org" ).setFax("0911623562"))).setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance(new BigDecimal("0.1"))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(2.0)).addCharge(new Charge(new BigDecimal(1))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addCharge(new Charge(new BigDecimal(1))).addAllowance(new Allowance(new BigDecimal("1"))))
|
||||
|
||||
);
|
||||
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_ITEMCHARGESALLOWANCESPDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ITEMCHARGESALLOWANCESPDF);
|
||||
|
||||
assertTrue(zi.getUTF8().contains("EUR"));
|
||||
assertTrue(zi.getUTF8().contains("0911623562")); // fax number
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("18.33", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void testChargesAllowancesExport() {
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "3.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setProfile(Profiles.getByName("en16931")).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
ze.setTransaction(new Invoice().setCurrency("CHF").setDueDate(new Date()).setOccurrenceDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE")).setOwnTaxID("4711").setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
.addCharge(new Charge(new BigDecimal(0.5)).setTaxPercent(new BigDecimal(19)))
|
||||
.addAllowance(new Allowance(new BigDecimal(0.2)).setTaxPercent(new BigDecimal(19)))
|
||||
|
||||
);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_CHARGESALLOWANCESPDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_CHARGESALLOWANCESPDF);
|
||||
|
||||
assertFalse(zi.getUTF8().contains("EUR"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("11.07", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void testRelativeChargesAllowancesExport() {
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "3.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setProfile(Profiles.getByName("extended")).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
ze.setTransaction(new Invoice().setCurrency("CHF").setDueDate(new Date()).setOccurrenceDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE")).setOwnTaxID("4711").setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addCharge(new Charge().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19))))
|
||||
.addAllowance(new Allowance().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19)))
|
||||
|
||||
);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_RELATIVECHARGESALLOWANCESPDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_RELATIVECHARGESALLOWANCESPDF);
|
||||
|
||||
assertFalse(zi.getUTF8().contains("EUR"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("6.25", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void testCorrectionExport() {
|
||||
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String priceStr = "1.00";
|
||||
BigDecimal price = new BigDecimal(priceStr);
|
||||
BigDecimal amount = new BigDecimal(-1.0);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setOccurrencePeriod(new Date(), new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addTaxID("4711").addVATID("DE0815")).setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE0815")).setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, amount))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, amount))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, amount)).setCorrection("0815");
|
||||
ze.setTransaction(i);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_CORRECTIONPDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not be raised in testEdgeExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_CORRECTIONPDF);
|
||||
|
||||
assertTrue(zi.getUTF8().contains("EUR"));
|
||||
//totest: typecode 384, BuyerOrderReferencedDocument
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("-3.57", zi.getAmount());
|
||||
assertEquals(zi.getHolder(), orgname);
|
||||
assertEquals(zi.getForeignReference(), number);
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ 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;
|
||||
import java.math.BigDecimal;
|
||||
@@ -60,28 +59,8 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnCountry() {
|
||||
return "DE";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnLocation() {
|
||||
return "Stadthausen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnOrganisationName() {
|
||||
return "Bei Spiel GmbH";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnStreet() {
|
||||
return "Ecke 12";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getOwnContact() {
|
||||
return new SenderContact();
|
||||
public IZUGFeRDExportableTradeParty getSender() {
|
||||
return new SenderTradeParty();
|
||||
|
||||
}
|
||||
|
||||
@@ -101,8 +80,8 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getRecipient() {
|
||||
return new RecipientContact();
|
||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||
return new RecipientTradeParty();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,11 +167,11 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).ignorePDFAErrors()
|
||||
ZUGFeRDExporterFromA3 ze = new ZUGFeRDExporterFromA3().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setProfile("EN16931")
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
@@ -207,14 +186,39 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getInvoiceID(), "RE-20170509/505");
|
||||
assertEquals(zi.getZUGFeRDProfil(), "COMFORT");
|
||||
assertEquals(zi.getInvoiceCurrencyCode(), "EUR");
|
||||
assertEquals(zi.getIssuerAssignedID(),"");
|
||||
assertEquals(zi.getIssueDate(), "20170509");
|
||||
assertEquals(zi.getTaxPointDate(), "20170507");
|
||||
assertEquals(zi.getPaymentTerms(), "Zahlbar ohne Abzug bis zum 30.05.2017");
|
||||
assertEquals(zi.getLineTotalAmount(), "496.00");
|
||||
assertEquals(zi.getTaxBasisTotalAmount(), "496.00");
|
||||
assertEquals(zi.getTaxTotalAmount(),"75.04");
|
||||
assertEquals(zi.getRoundingAmount(), "");
|
||||
assertEquals(zi.getPaidAmount(), "0.00");
|
||||
assertEquals(zi.getBuyerTradePartyName(), "Theodor Est");
|
||||
assertEquals(zi.getBuyerTradePartyGlobalID(), "");
|
||||
assertEquals(zi.getSellerTradePartyGlobalID(), "");
|
||||
assertEquals(zi.getBuyerTradePartyID(), "DE999999999");
|
||||
assertEquals(zi.getBuyertradePartySpecifiedTaxRegistrationID(), "DE999999999");
|
||||
assertEquals(zi.getIncludedNote(), "");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getDocumentCode(),"380");
|
||||
assertEquals(zi.getReference(),"AB321");
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getIBAN(),getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
assertEquals(zi.getBIC(), "COBADEFFXXX");
|
||||
assertEquals(zi.getIBAN(), "DE88 2008 0000 0970 3757 00");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getForeignReference(), getNumber());
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getPostcodeCode(), "88802");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineOne(), "Bahnstr. 42");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineTwo(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getLineThree(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCountrySubDivisionName(), null);
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCountryID(), "DE");
|
||||
assertEquals(zi.getBuyerTradePartyAddress().getCityName(), "Spielkreis");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getPostcodeCode(), "12345");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getLineOne(), "Ecke 12");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getLineTwo(), null);
|
||||
@@ -223,16 +227,16 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCountryID(), "DE");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCityName(), "Stadthausen");
|
||||
|
||||
List<org.mustangproject.ZUGFeRD.Item> li = zi.getLineItemList();
|
||||
List<org.mustangproject.Item> li = zi.getLineItemList();
|
||||
assertEquals(zi.getLineItemList().get(0).getId().toString(), "1");
|
||||
assertEquals(zi.getLineItemList().get(0).product.getBuyerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).product.getSellerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getBuyerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getSellerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getLineTotalAmount().toString(), "160.00");
|
||||
assertEquals(zi.getLineItemList().get(0).getQuantity().toString(), "1.0000");
|
||||
assertEquals(zi.getLineItemList().get(0).getGrossPrice().toString(), "160.0000");
|
||||
assertEquals(zi.getLineItemList().get(0).product.getVATPercent().toString(), "7.00");
|
||||
assertEquals(zi.getLineItemList().get(0).product.getName(), "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung");
|
||||
assertEquals(zi.getLineItemList().get(0).product.getDescription(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getVATPercent().toString(), "7.00");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getName(), "Künstlerische Gestaltung (Stunde): Einer Beispielrechnung");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getDescription(), "");
|
||||
|
||||
try {
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
|
||||
@@ -19,15 +19,7 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
|
||||
import org.mustangproject.Invoice;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
@@ -47,12 +39,17 @@ public class ZF2ZInvoiceImporterTest extends TestCase {
|
||||
|
||||
ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
||||
|
||||
|
||||
Invoice invoice=zii.extractInvoice();
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("Bei Spiel GmbH", zii.extractInvoice().getOwnOrganisationName());
|
||||
assertEquals(3, zii.extractInvoice().getZFItems().length);
|
||||
assertEquals("160.0000", zii.extractInvoice().getZFItems()[0].getPrice().toString());
|
||||
assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName());
|
||||
assertEquals(3, invoice.getZFItems().length);
|
||||
assertEquals("400.0000", invoice.getZFItems()[1].getQuantity().toString());
|
||||
|
||||
/* assertEquals("160.0000", invoice.getZFItems()[0].getPrice().toString());
|
||||
assertEquals("Heiße Luft pro Liter", invoice.getZFItems()[2].getProduct().getName());
|
||||
assertEquals("7", invoice.getZFItems()[0].getProduct().getVATPercent().toString());
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
163
pom.xml
163
pom.xml
@@ -1,10 +1,9 @@
|
||||
<?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</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Mustang</name>
|
||||
|
||||
@@ -18,11 +17,117 @@
|
||||
</description>
|
||||
<url>http://www.mustangproject.org/</url>
|
||||
<scm>
|
||||
<connection>scm:git:https://github.com/ZUGFeRD/mustangproject.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/ZUGFeRD/mustangproject.git</developerConnection>
|
||||
<url>https://github.com/ZUGFeRD/mustangproject</url>
|
||||
<tag>mustang-1.7.3</tag>
|
||||
</scm>
|
||||
<connection>scm:git:git://github.com/dexecutor/dependent-tasks-executor.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:dexecutor/dexecutor.git</developerConnection>
|
||||
<url>https://github.com/dexecutor/dependent-tasks-executor</url>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin><!-- mvn help:effective-pom will otherwise tell it just defaults
|
||||
to 2.3.2 - which does not release in the maven repo, and neither shows any
|
||||
error message :-( -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-release-plugin</artifactId>
|
||||
<version>2.5.3</version>
|
||||
<configuration>
|
||||
<localCheckout>true</localCheckout>
|
||||
<pushChanges>false</pushChanges>
|
||||
<mavenExecutorId>forked-path</mavenExecutorId>
|
||||
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-gitexe</artifactId>
|
||||
<version>1.9.5</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
|
||||
<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>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo
|
||||
</altDeploymentRepository>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--<plugin>
|
||||
<groupId>com.github.github</groupId>
|
||||
<artifactId>site-maven-plugin</artifactId>
|
||||
<version>0.12</version>
|
||||
<configuration>
|
||||
<message>Maven artifacts for ${project.version}</message>
|
||||
- git commit message -
|
||||
<noJekyll>true</noJekyll>
|
||||
- disable webpage processing -
|
||||
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
|
||||
- matches distribution management repository url above -
|
||||
<branch>refs/heads/mvn-repo</branch>
|
||||
- remote branch name -
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
<merge>true</merge>
|
||||
<repositoryName>mustangproject</repositoryName>
|
||||
- github repo name -
|
||||
<repositoryOwner>ZUGFeRD</repositoryOwner>
|
||||
- github username -
|
||||
</configuration>
|
||||
<executions>
|
||||
- run site-maven-plugin's 'site' target as part of the build's normal
|
||||
'deploy' phase -
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>site</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.8</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-javadoc</id>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository><!-- for jargs -->
|
||||
<id>sonatype-oss-public</id>
|
||||
@@ -36,10 +141,13 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>internal.repo</id>
|
||||
<name>Temporary Staging Repository</name>
|
||||
<url>file://${project.build.directory}/mvn-repo</url>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
<properties>
|
||||
@@ -83,4 +191,37 @@
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<profiles>
|
||||
|
||||
|
||||
<!-- GPG Signature on release -->
|
||||
|
||||
<profile>
|
||||
<id>release-sign-artifacts</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>performRelease</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>sign</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
|
||||
0.9.0
|
||||
======
|
||||
2020-03-24
|
||||
* ZF 2.1 Schema/Schematrons
|
||||
* check against URI allowing for different fragments
|
||||
* #27 wrong exit code
|
||||
* now context also loggs
|
||||
* introduced fatal errors. new errors: filename empty (10), xml not extractable (17), En16931 CEN Schematron error (24)
|
||||
* fail better if -f missing
|
||||
* validate against CEN 1.3
|
||||
* corrected invalidation of complete output status for broken pdfs
|
||||
* mention filename in report
|
||||
* escape xml in report elements, e.g. < in criterion to become <
|
||||
* validation element has been removed from pdf info and added as attribute in root, duration is now direct child of info
|
||||
* file not found and file too small now without filename
|
||||
* XML pretty print output. (XML report may now contain header <?xml...)
|
||||
* First XMLUnit tests
|
||||
* Better Check of XML Validity also against documents which start with comments or not with xml header <?xml...
|
||||
* prevent accidental CEN EN16931 application on extended profile
|
||||
* solved issues when XML structures start with comments instead of root node
|
||||
* added Symtrax signature
|
||||
|
||||
0.8.3
|
||||
======
|
||||
2019-10-20
|
||||
* #22 rounding errors when applying schematron
|
||||
* check for 1.0 or 2p0 in RDF, not 1.0 and 2.0 like before
|
||||
* updated to zf 2.0.1
|
||||
|
||||
0.8.2
|
||||
======
|
||||
2019-10-10
|
||||
* #22 rounding errors when applying schematron
|
||||
|
||||
0.8.1
|
||||
======
|
||||
2019-09-01
|
||||
|
||||
* added Signature pdfMachine
|
||||
* added check for additional data correctness
|
||||
* #23 ZF2 basic was incorrectly checked against Minimum/Basic Without lines Schema/Schematron
|
||||
* Merged -x and -z to -f
|
||||
* Created ZUGFeRDValidatorClass and MiscValidatorTests for e.g. tests without existing files
|
||||
|
||||
0.8.0
|
||||
======
|
||||
2019-07-08
|
||||
|
||||
* updated Mustang to mitigate #20 zf1 validation does not always return a <xml> section
|
||||
* validate not only against *schematron* but also against *schema* files
|
||||
|
||||
0.7.0
|
||||
======
|
||||
2019-05-31
|
||||
|
||||
* ZUGFeRD 2 final compatible
|
||||
* now displaying number of applied and failed rules
|
||||
* now failing if no rule could be applied at all
|
||||
* profileoverride option no longer needed
|
||||
* version dependent checks for profiles (i.e. comfort is not a valid ZF2 profile!)
|
||||
* allow new ZF2 filename (zugferd-invoice.xml instead ZUGFeRD-invoice.xml)
|
||||
* more JUnit tests
|
||||
* include own version number in XML report
|
||||
|
||||
|
||||
0.6.0
|
||||
=====
|
||||
2019-02-15
|
||||
Factur-X compatible
|
||||
Mention xpath location where the errors occurred
|
||||
JUnit tests
|
||||
new way to collect&handle errors
|
||||
XMP/PDF-A-Schema extension validation
|
||||
|
||||
|
||||
0.5.0
|
||||
=====
|
||||
2018-09-10
|
||||
Non-16931 profiles are no longer automatically (but still can be manually) checked,
|
||||
now writing a log file, attempt to find out which toolkit created that particular file (issue #2),
|
||||
fixing that XML could not be extracted from certain valid PDF/A-3 files (issue #9),
|
||||
added --action parameter (has to be validate), -f option changes to "-o -z", added APL license,
|
||||
added possibility to check XML files only, fixing issues with files that contained a
|
||||
UTF8 BOM in the XML content ("Content not allowed in prolog"),
|
||||
Upgraded VeraPDF-validation from 1.10.5 to 1.12.1
|
||||
|
||||
0.4.3
|
||||
=====
|
||||
2018-03-19
|
||||
|
||||
Java 8 capability (fixes issue #8)
|
||||
|
||||
0.4.2
|
||||
=====
|
||||
2018-03-11
|
||||
POJO embedding VeraPDF: unable to solve some severe deployment issues
|
||||
|
||||
|
||||
0.4.1
|
||||
=====
|
||||
2018-02-12
|
||||
ZUGFeRD 2 public preview EN16931 validation using the schematron files the CEN had
|
||||
published under APL
|
||||
|
||||
|
||||
0.3.0
|
||||
=====
|
||||
2017-07-24
|
||||
First release as VeraPDF plugin
|
||||
@@ -189,7 +189,7 @@ Permissive Open Source APL2, see LICENSE
|
||||
|
||||
## History
|
||||
|
||||
see the [history file](History.md)
|
||||
see the Mustangproject [history file](History.md)
|
||||
|
||||
|
||||
## Authors
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>validator</artifactId>
|
||||
<name>Library to validate Factur-X/ZUGFeRD 1.0 and 2.1 as well as XRechnung e-invoices. </name>
|
||||
<name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<!-- for jargs -->
|
||||
@@ -65,7 +64,7 @@
|
||||
<dependency>
|
||||
<groupId>org.verapdf</groupId>
|
||||
<artifactId>validation-model</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<version>1.16.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.helger/ph-schematron -->
|
||||
<dependency>
|
||||
@@ -76,7 +75,7 @@
|
||||
<dependency>
|
||||
<groupId>org.mustangproject</groupId>
|
||||
<artifactId>library</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.0-alpha4-SNAPSHOT</version>
|
||||
<!-- prototypes of new mustangproject versions can be installed by referring to them and installed to the local repo from a jar file with
|
||||
mvn install:install-file -Dfile=mustang-1.5.4-SNAPSHOT.jar -DgroupId=org.mustangproject.ZUGFeRD -DartifactId=mustang -Dversion=1.5.4 -Dpackaging=jar -DgeneratePom=true
|
||||
-->
|
||||
@@ -92,13 +91,6 @@
|
||||
<version>2.6.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<!-- for commandline options -->
|
||||
<groupId>com.sanityinc</groupId>
|
||||
<artifactId>jargs</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.riversun</groupId>
|
||||
<artifactId>bigdoc</artifactId>
|
||||
@@ -107,7 +99,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@@ -125,7 +117,7 @@
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<!-- be able to generate XSLT from XRechnung Schematron-->
|
||||
<!-- be able to generate XSLT from XRechnung Schematron
|
||||
<plugin>
|
||||
<groupId>com.helger.maven</groupId>
|
||||
<artifactId>ph-schematron-maven-plugin</artifactId>
|
||||
@@ -141,11 +133,13 @@
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugin> -->
|
||||
|
||||
<!-- allow getImplementationVersion for the pom.xml -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
@@ -172,13 +166,6 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- /ZUV -->
|
||||
<!-- generate XSLT files from schematron upon build (goal convert is part
|
||||
of the preparation of the "package" step)
|
||||
<plugin> <groupId>com.helger.maven</groupId> <artifactId>ph-sch2xslt-maven-plugin</artifactId>
|
||||
<version>5.0.8</version> <configuration> <schematronDirectory>${basedir}/src/main/resources/</schematronDirectory>
|
||||
<xsltDirectory>${basedir}/src/main/resources/xslt</xsltDirectory> </configuration>
|
||||
<executions> <execution> <goals> <goal>convert</goal> </goals> </execution>
|
||||
</executions> </plugin> -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
@@ -212,12 +199,6 @@
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
<filter>
|
||||
<artifact>com.sun.xml.bind:jaxb-core</artifact>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
<executions>
|
||||
@@ -228,7 +209,7 @@
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifactSet>
|
||||
<excludes/>
|
||||
<excludes />
|
||||
</artifactSet>
|
||||
</configuration>
|
||||
</execution>
|
||||
@@ -240,18 +221,18 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-zf-schematron-xml-dependencies</id>
|
||||
<phase>validate</phase>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/xslt/ZF_211/</outputDirectory>
|
||||
<outputDirectory>${basedir}/src/main/resources/xslt/ZF_211/</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>/schematron/ZF_211/</directory>
|
||||
<directory>${basedir}/src/main/resources/schematron/ZF_211/</directory>
|
||||
<includes>
|
||||
<include>*.xml</include>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
package org.mustangproject.validator;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.sanityinc.jargs.CmdLineParser;
|
||||
import com.sanityinc.jargs.CmdLineParser.Option;
|
||||
|
||||
public class Main {
|
||||
|
||||
static final ClassLoader cl = Main.class.getClassLoader();
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Main.class.getCanonicalName()); // log output is
|
||||
// ignored for the
|
||||
// time being
|
||||
|
||||
public void run(String[] args) {
|
||||
|
||||
/***
|
||||
* prerequisite is a mvn generate-resources
|
||||
*/
|
||||
|
||||
CmdLineParser parser = new CmdLineParser();
|
||||
Option<String> actionOption = parser.addStringOption('a', "action");
|
||||
Option<String> filenameOption = parser.addStringOption('f', "Filename");
|
||||
|
||||
Option<Boolean> licenseOption = parser.addBooleanOption('l', "license");
|
||||
Option<Boolean> helpOption = parser.addBooleanOption('h', "help");
|
||||
Option<String> logAppendOption = parser.addStringOption("logAppend");
|
||||
|
||||
boolean optionsRecognized = false;
|
||||
|
||||
try {
|
||||
parser.parse(args);
|
||||
} catch (CmdLineParser.OptionException e) {
|
||||
System.err.println(e.getMessage());
|
||||
System.exit(-2);
|
||||
}
|
||||
|
||||
Boolean helpRequested = parser.getOptionValue(helpOption);
|
||||
|
||||
if (parser.getOptionValue(licenseOption) != null) {
|
||||
optionsRecognized = true;
|
||||
|
||||
System.out.println("Copyright 2018 Jochen Stärk\n" + "\n"
|
||||
+ "Licensed under the Apache License, Version 2.0 (the \"License\");\n"
|
||||
+ "you may not use this file except in compliance with the License.\n"
|
||||
+ "You may obtain a copy of the License at\n" + "\n"
|
||||
+ " http://www.apache.org/licenses/LICENSE-2.0\n" + "\n"
|
||||
+ "Unless required by applicable law or agreed to in writing, software\n"
|
||||
+ "distributed under the License is distributed on an \"AS IS\" BASIS,\n"
|
||||
+ "WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
|
||||
+ "See the License for the specific language governing permissions and\n"
|
||||
+ "limitations under the License.\n\n\n\n\n"
|
||||
+ "This software is embedding the PDF/A validator VeraPDF, "
|
||||
+ "http://verapdf.org/, which is available under GPL and MPL licenses.");
|
||||
|
||||
System.exit(0);
|
||||
}
|
||||
String filename = parser.getOptionValue(filenameOption);
|
||||
String action = parser.getOptionValue(actionOption);
|
||||
File logdir = new File("log");
|
||||
if (!logdir.exists() || !logdir.isDirectory() || !logdir.canWrite()) {
|
||||
System.err.println("Need writable subdirectory 'log' for log files.");
|
||||
}
|
||||
|
||||
if ((action != null) && (action.equals("validate"))) {
|
||||
ZUGFeRDValidator zfv=new ZUGFeRDValidator();
|
||||
zfv.setLogAppend(parser.getOptionValue(logAppendOption));
|
||||
System.out.println(zfv.validate(filename));
|
||||
|
||||
optionsRecognized = !zfv.hasOptionsError();
|
||||
if (!zfv.wasCompletelyValid()) {
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((!optionsRecognized) || (helpRequested != null && helpRequested.booleanValue())) {
|
||||
System.out.println(
|
||||
"usage: --action validate --source <ZUGFeRD PDF Filename.pdf>|<ZUGFeRD XML Filename.xml> [-l (shows license)][--logAppend \"String to be appended to validation result log\"]");
|
||||
System.exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Main().run(args);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public class PDFValidator extends Validator {
|
||||
}
|
||||
boolean documentFilenameValid=false;
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
String[] valueArray = { "factur-x.xml", "ZUGFeRD-invoice.xml", "zugferd-invoice.xml" };
|
||||
String[] valueArray = { "factur-x.xml", "ZUGFeRD-invoice.xml", "zugferd-invoice.xml", "xrechnung.xml" };
|
||||
if (stringArrayContains(valueArray, nodes.item(i).getTextContent())) {
|
||||
documentFilenameValid=true;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ public class PDFValidator extends Validator {
|
||||
|
||||
boolean versionValid=false;
|
||||
for (int i = 0; i < nodes.getLength(); i++) {
|
||||
String[] valueArray = { "1.0", "2p0" };
|
||||
String[] valueArray = { "1.0", "2p0", "1p2" }; //1p2 is for xrechnung 1.2, 2p0 can be ZF 2.0, 2.1, 2.1.1 or XRechnung 2
|
||||
if (stringArrayContains(valueArray, nodes.item(i).getTextContent())) {
|
||||
versionValid=true;
|
||||
} // e.g. 1.0
|
||||
@@ -277,6 +277,7 @@ public class PDFValidator extends Validator {
|
||||
byte[] intarsysSignature = "intarsys ".getBytes("UTF-8");
|
||||
byte[] konikSignature = "Konik".getBytes("UTF-8");
|
||||
byte[] pdfMachineSignature = "pdfMachine from Broadgun Software".getBytes("UTF-8");
|
||||
byte[] ghostscriptSignature = "%%Invocation:".getBytes("UTF-8");
|
||||
|
||||
if (searcher.indexOf(file, symtraxSignature) != -1) {
|
||||
Signature = "Symtrax";
|
||||
@@ -290,6 +291,8 @@ public class PDFValidator extends Validator {
|
||||
Signature = "Konik";
|
||||
} else if (searcher.indexOf(file, pdfMachineSignature) != -1) {
|
||||
Signature = "pdfMachine";
|
||||
} else if (searcher.indexOf(file, ghostscriptSignature) != -1) {
|
||||
Signature = "Ghostscript";
|
||||
}
|
||||
|
||||
context.setSignature(Signature);
|
||||
|
||||
@@ -20,11 +20,11 @@ import javax.xml.transform.stream.StreamSource;
|
||||
public class SchematronPipeline {
|
||||
static final ClassLoader cl = SchematronPipeline.class.getClassLoader();
|
||||
private static final TransformerFactory factory = getTransformerFactory();
|
||||
private static final String xslExt = ".xsl"; //$NON-NLS-1$
|
||||
private static final String resourcePath = "iso-schematron-xslt2/"; //$NON-NLS-1$
|
||||
private static final String isoDsdlXsl = resourcePath + "iso_dsdl_include" + xslExt; //$NON-NLS-1$
|
||||
private static final String isoExpXsl = resourcePath + "iso_abstract_expand" + xslExt; //$NON-NLS-1$
|
||||
private static final String isoSvrlXsl = resourcePath + "iso_svrl_for_xslt2" + xslExt; //$NON-NLS-1$
|
||||
private static final String xslExt = ".xsl";
|
||||
private static final String resourcePath = "iso-schematron-xslt2/";
|
||||
private static final String isoDsdlXsl = resourcePath + "iso_dsdl_include" + xslExt;
|
||||
private static final String isoExpXsl = resourcePath + "iso_abstract_expand" + xslExt;
|
||||
private static final String isoSvrlXsl = resourcePath + "iso_svrl_for_xslt2" + xslExt;
|
||||
private static final Templates cachedIsoDsdXsl = createCachedTransform(isoDsdlXsl);
|
||||
private static final Templates cachedExpXsl = createCachedTransform(isoExpXsl);
|
||||
private static final Templates cachedIsoSvrlXsl = createCachedTransform(isoSvrlXsl);
|
||||
@@ -39,16 +39,16 @@ public class SchematronPipeline {
|
||||
try {
|
||||
return factory.newTemplates(new StreamSource(cl.getResourceAsStream(transName)));
|
||||
} catch (TransformerConfigurationException excep) {
|
||||
throw new IllegalStateException("Policy Schematron transformer XSL " + transName + " not found.", excep); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
throw new IllegalStateException("Policy Schematron transformer XSL " + transName + " not found.", excep); //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
|
||||
public static void processSchematron(InputStream schematronSource, OutputStream xslDest)
|
||||
throws TransformerException, IOException {
|
||||
File isoDsdResult = createTempFileResult(cachedIsoDsdXsl.newTransformer(), new StreamSource(schematronSource),
|
||||
"IsoDsd"); //$NON-NLS-1$
|
||||
"IsoDsd");
|
||||
File isoExpResult = createTempFileResult(cachedExpXsl.newTransformer(), new StreamSource(isoDsdResult),
|
||||
"ExpXsl"); //$NON-NLS-1$
|
||||
"ExpXsl");
|
||||
cachedIsoSvrlXsl.newTransformer().transform(new StreamSource(isoExpResult), new StreamResult(xslDest));
|
||||
isoDsdResult.delete();
|
||||
isoExpResult.delete();
|
||||
@@ -56,7 +56,7 @@ public class SchematronPipeline {
|
||||
|
||||
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$
|
||||
File result = File.createTempFile("ZUV_", suffix);
|
||||
result.deleteOnExit();
|
||||
|
||||
try (FileOutputStream fos = new FileOutputStream(result)) {
|
||||
|
||||
@@ -25,20 +25,37 @@ public abstract class Validator {
|
||||
}
|
||||
|
||||
//abstract method
|
||||
|
||||
|
||||
/***
|
||||
* prepare validation
|
||||
* @param filename the filename of the xml file to be examined
|
||||
* @throws IrrecoverableValidationError when any fatal errors arise, e.g. when the source file can not be found
|
||||
*/
|
||||
public abstract void setFilename(String filename) throws IrrecoverableValidationError;
|
||||
|
||||
/***
|
||||
* perform the validation
|
||||
* @throws IrrecoverableValidationError any fatal errors, e.g. when the source file can not be found
|
||||
*/
|
||||
public abstract void validate() throws IrrecoverableValidationError;
|
||||
|
||||
/**
|
||||
* get validation result
|
||||
* @return validation result as xml string
|
||||
*/
|
||||
public String getXMLResult() {
|
||||
return context.getXMLResult();
|
||||
}
|
||||
|
||||
/***
|
||||
* validates a schema, which can only be needed in XML validation - and in pdf validation for additional data
|
||||
* @param xmlRawData
|
||||
* @param schemaPath
|
||||
* @param xmlRawData the XML to be validated
|
||||
* @param schemaPath the filename of the schema file
|
||||
* @param section the error message type code
|
||||
* @param part whether the error message occurs in the pdf or xml part
|
||||
* @throws IrrecoverableValidationError when any fatal errors arise, e.g. when the source file can not be found
|
||||
*/
|
||||
protected void validateSchema(byte[] xmlRawData, String schemaPath,int section, EPart part) throws IrrecoverableValidationError {
|
||||
protected void validateSchema(byte[] xmlRawData, String schemaPath, int section, EPart part) throws IrrecoverableValidationError {
|
||||
URL schemaFile = ClassLoader.getSystemResource("schema/" + schemaPath);
|
||||
Source xmlData = new StreamSource(new ByteArrayInputStream(xmlRawData));
|
||||
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||
|
||||
@@ -33,171 +33,194 @@ import com.helger.schematron.svrl.SVRLHelper;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
public class XMLValidator extends Validator {
|
||||
public XMLValidator(ValidationContext ctx) {
|
||||
super(ctx);
|
||||
}
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(XMLValidator.class.getCanonicalName()); // log output
|
||||
// is
|
||||
// ignored for the
|
||||
// time being
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(XMLValidator.class.getCanonicalName()); // log output
|
||||
// is
|
||||
// ignored for the
|
||||
// time being
|
||||
|
||||
protected String zfXML = "";
|
||||
protected String filename = "";
|
||||
int firedRules = 0;
|
||||
int failedRules = 0;
|
||||
ISchematronResource aResSCH = null;
|
||||
|
||||
public void setFilename(String name) throws IrrecoverableValidationError { // from XML Filename
|
||||
filename = name;
|
||||
// file existence must have been checked before
|
||||
|
||||
try {
|
||||
zfXML = new String(Files.readAllBytes(Paths.get(name)));
|
||||
} catch (IOException e) {
|
||||
|
||||
ValidationResultItem vri = new ValidationResultItem(ESeverity.exception, e.getMessage()).setSection(9)
|
||||
.setPart(EPart.fx);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
vri.setStacktrace(sw.toString());
|
||||
context.addResultItem(vri);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStringContent(String xml) {
|
||||
zfXML = xml;
|
||||
}
|
||||
|
||||
public static boolean matchesURI(String uri1, String uri2) {
|
||||
return (uri1.equals(uri2) || uri1.startsWith(uri2 + "#"));
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* @param xmlString
|
||||
* @param overrideProfileCheck
|
||||
* if set to true, all ZF2 files will be checked against EN16931
|
||||
* schematron, since no other schematron is available
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void validate() throws IrrecoverableValidationError {
|
||||
long startXMLTime = Calendar.getInstance().getTimeInMillis();
|
||||
firedRules = 0;
|
||||
failedRules = 0;
|
||||
protected String zfXML = "";
|
||||
protected String filename = "";
|
||||
int firedRules = 0;
|
||||
int failedRules = 0;
|
||||
boolean disableNotices = false;
|
||||
ISchematronResource aResSCH = null;
|
||||
|
||||
|
||||
ByteArrayInputStream xmlByteInputStream = new ByteArrayInputStream(zfXML.getBytes(StandardCharsets.UTF_8));
|
||||
public XMLValidator(ValidationContext ctx) {
|
||||
super(ctx);
|
||||
}
|
||||
|
||||
if (zfXML.isEmpty()) {
|
||||
ValidationResultItem res = new ValidationResultItem(ESeverity.exception,
|
||||
"XML data not found in " + filename
|
||||
+ ": did you specify a pdf or xml file and does the xml file contain an embedded XML file?")
|
||||
.setSection(3);
|
||||
context.addResultItem(res);
|
||||
/***
|
||||
* set source file
|
||||
* @param name
|
||||
* @throws IrrecoverableValidationError
|
||||
*/
|
||||
public void setFilename(String name) throws IrrecoverableValidationError { // from XML Filename
|
||||
filename = name;
|
||||
// file existence must have been checked before
|
||||
|
||||
} else {
|
||||
try {
|
||||
zfXML = new String(Files.readAllBytes(Paths.get(name)));
|
||||
} catch (IOException e) {
|
||||
|
||||
// final ISchematronResource aResSCH =
|
||||
// SchematronResourceSCH.fromFile (new File("ZUGFeRD_1p0.scmt"));
|
||||
// ... DOES work but is highly deprecated (and rightly so) because
|
||||
// it takes 30-40min,
|
||||
ValidationResultItem vri = new ValidationResultItem(ESeverity.exception, e.getMessage()).setSection(9)
|
||||
.setPart(EPart.fx);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
vri.setStacktrace(sw.toString());
|
||||
context.addResultItem(vri);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ESeverity XrechnungSeverity=ESeverity.notice;
|
||||
/***
|
||||
* private static final String VALID_SCHEMATRON = "test-sch/valid01.sch";
|
||||
* private static final String VALID_XMLINSTANCE = "test-xml/valid01.xml";
|
||||
*
|
||||
* @Test public void testWriteValid () throws Exception { final Document aDoc =
|
||||
* SchematronResourceSCH.fromClassPath (VALID_SCHEMATRON)
|
||||
* .applySchematronValidation (new ClassPathResource (VALID_XMLINSTANCE));
|
||||
*
|
||||
*/
|
||||
/***
|
||||
* manually set the xml content
|
||||
* @param xml the xml to be checked
|
||||
*/
|
||||
public void setStringContent(String xml) {
|
||||
zfXML = xml;
|
||||
}
|
||||
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true); // otherwise we can not act namespace independently, i.e. use
|
||||
// document.getElementsByTagNameNS("*",...
|
||||
/**
|
||||
* whether uri1 has the same meaning like uri1 (it has, if it only differs in the fragment, i.e. uri1#1==uri1#2 )
|
||||
* @param uri1
|
||||
* @param uri2
|
||||
* @return true if semantically identical
|
||||
*/
|
||||
public static boolean matchesURI(String uri1, String uri2) {
|
||||
return (uri1.equals(uri2) || uri1.startsWith(uri2 + "#"));
|
||||
}
|
||||
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
|
||||
Document doc = db.parse(xmlByteInputStream);
|
||||
/***
|
||||
* don't report notices in validation report
|
||||
*/
|
||||
public void disableNotices() {
|
||||
disableNotices = true;
|
||||
}
|
||||
|
||||
Element root = doc.getDocumentElement();
|
||||
|
||||
NodeList ndList;
|
||||
/***
|
||||
* perform validation
|
||||
* @throws IrrecoverableValidationError if any fatal errors occur, e.g. source file can not be read
|
||||
*/
|
||||
@Override
|
||||
public void validate() throws IrrecoverableValidationError {
|
||||
long startXMLTime = Calendar.getInstance().getTimeInMillis();
|
||||
firedRules = 0;
|
||||
failedRules = 0;
|
||||
|
||||
// rootNode = document.getDocumentElement();
|
||||
// ApplicableSupplyChainTradeSettlement
|
||||
|
||||
// Create XPathFactory object
|
||||
XPathFactory xpathFactory = XPathFactory.newInstance();
|
||||
ByteArrayInputStream xmlByteInputStream = new ByteArrayInputStream(zfXML.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
// Create XPath object
|
||||
XPath xpath = xpathFactory.newXPath();
|
||||
XPathExpression expr = xpath.compile(
|
||||
"//*[local-name()=\"GuidelineSpecifiedDocumentContextParameter\"]/*[local-name()=\"ID\"]/text()");
|
||||
// evaluate expression result on XML document
|
||||
ndList = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
|
||||
if (zfXML.isEmpty()) {
|
||||
ValidationResultItem res = new ValidationResultItem(ESeverity.exception,
|
||||
"XML data not found in " + filename
|
||||
+ ": did you specify a pdf or xml file and does the xml file contain an embedded XML file?")
|
||||
.setSection(3);
|
||||
context.addResultItem(res);
|
||||
|
||||
for (int bookingIndex = 0; bookingIndex < ndList.getLength(); bookingIndex++) {
|
||||
Node booking = ndList.item(bookingIndex);
|
||||
// if there is a attribute in the tag number:value
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:extended
|
||||
// setForeignReference(booking.getTextContent());
|
||||
} else {
|
||||
|
||||
context.setProfile(booking.getNodeValue());
|
||||
}
|
||||
boolean isMiniumum = false;
|
||||
boolean isBasic = false;
|
||||
boolean isBasicWithoutLines = false;
|
||||
boolean isEN16931 = false;
|
||||
// final ISchematronResource aResSCH =
|
||||
// SchematronResourceSCH.fromFile (new File("ZUGFeRD_1p0.scmt"));
|
||||
// ... DOES work but is highly deprecated (and rightly so) because
|
||||
// it takes 30-40min,
|
||||
|
||||
try {
|
||||
ESeverity XrechnungSeverity = ESeverity.notice;
|
||||
/***
|
||||
* private static final String VALID_SCHEMATRON = "test-sch/valid01.sch";
|
||||
* private static final String VALID_XMLINSTANCE = "test-xml/valid01.xml";
|
||||
*
|
||||
* @Test public void testWriteValid () throws Exception { final Document aDoc =
|
||||
* SchematronResourceSCH.fromClassPath (VALID_SCHEMATRON)
|
||||
* .applySchematronValidation (new ClassPathResource (VALID_XMLINSTANCE));
|
||||
*
|
||||
*/
|
||||
|
||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||
dbf.setNamespaceAware(true); // otherwise we can not act namespace independently, i.e. use
|
||||
// document.getElementsByTagNameNS("*",...
|
||||
|
||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||
|
||||
Document doc = db.parse(xmlByteInputStream);
|
||||
|
||||
Element root = doc.getDocumentElement();
|
||||
|
||||
NodeList ndList;
|
||||
|
||||
// rootNode = document.getDocumentElement();
|
||||
// ApplicableSupplyChainTradeSettlement
|
||||
|
||||
// Create XPathFactory object
|
||||
XPathFactory xpathFactory = XPathFactory.newInstance();
|
||||
|
||||
// Create XPath object
|
||||
XPath xpath = xpathFactory.newXPath();
|
||||
XPathExpression expr = xpath.compile(
|
||||
"//*[local-name()=\"GuidelineSpecifiedDocumentContextParameter\"]/*[local-name()=\"ID\"]/text()");
|
||||
// evaluate expression result on XML document
|
||||
ndList = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
|
||||
|
||||
for (int bookingIndex = 0; bookingIndex < ndList.getLength(); bookingIndex++) {
|
||||
Node booking = ndList.item(bookingIndex);
|
||||
// if there is a attribute in the tag number:value
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:extended
|
||||
// setForeignReference(booking.getTextContent());
|
||||
|
||||
context.setProfile(booking.getNodeValue());
|
||||
}
|
||||
boolean isMiniumum = false;
|
||||
boolean isBasic = false;
|
||||
boolean isBasicWithoutLines = false;
|
||||
boolean isEN16931 = false;
|
||||
boolean isExtended = false;
|
||||
boolean isXRechnung = false;
|
||||
String xsltFilename = null;
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:extended,
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:comfort,
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:basic,
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:comfort,
|
||||
// urn:ferd:CrossIndustryDocument:invoice:1p0:basic,
|
||||
|
||||
// urn:cen.eu:en16931:2017
|
||||
// urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:basic
|
||||
if (root.getNodeName().equalsIgnoreCase("rsm:CrossIndustryInvoice")) { // ZUGFeRD 2.0 or Factur-X
|
||||
context.setVersion("2");
|
||||
// urn:cen.eu:en16931:2017
|
||||
// urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:basic
|
||||
if (root.getNodeName().equalsIgnoreCase("rsm:CrossIndustryInvoice")) { // ZUGFeRD 2.0 or Factur-X
|
||||
context.setVersion("2");
|
||||
|
||||
isMiniumum = context.getProfile().contains("minimum");
|
||||
isBasic = context.getProfile().contains("basic");
|
||||
isBasicWithoutLines = context.getProfile().contains("basicwl");
|
||||
if (isBasicWithoutLines) {
|
||||
isBasic = false;// basicwl also contains the string basic...
|
||||
}
|
||||
isEN16931 = matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931")
|
||||
|| matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017");
|
||||
isMiniumum = context.getProfile().contains("minimum");
|
||||
isBasic = context.getProfile().contains("basic");
|
||||
isBasicWithoutLines = context.getProfile().contains("basicwl");
|
||||
if (isBasicWithoutLines) {
|
||||
isBasic = false;// basicwl also contains the string basic...
|
||||
}
|
||||
isEN16931 = matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:en16931")
|
||||
|| matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017");
|
||||
|
||||
isExtended = context.getProfile().contains("extended");
|
||||
isXRechnung = context.getProfile().contains("xrechnung");
|
||||
|
||||
if ((isExtended)||(isXRechnung)) {
|
||||
isEN16931 = false;// the uri for extended is urn:cen.eu:en16931:2017#conformant#urn:zugferd.de:2p0:extended and thus contains en16931...
|
||||
}
|
||||
if (isMiniumum) {
|
||||
LOGGER.debug("is Minimum");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/MINIMUM/FACTUR-X_MINIMUM.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_MINIMUM.xslt";
|
||||
} else if (isBasicWithoutLines) {
|
||||
LOGGER.debug("is Basic/WL");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/BASIC-WL/FACTUR-X_BASIC-WL.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_BASIC-WL.xslt";
|
||||
} else if (isBasic) {
|
||||
LOGGER.debug("is Basic");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/BASIC/FACTUR-X_BASIC.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_BASIC.xslt";
|
||||
} else if (isEN16931) {
|
||||
LOGGER.debug("is EN16931");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/EN16931/FACTUR-X_EN16931.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_EN16931.xslt";
|
||||
} else if (isExtended) {
|
||||
if ((isExtended) || (isXRechnung)) {
|
||||
isEN16931 = false;// the uri for extended is urn:cen.eu:en16931:2017#conformant#urn:zugferd.de:2p0:extended and thus contains en16931...
|
||||
}
|
||||
if (isMiniumum) {
|
||||
LOGGER.debug("is Minimum");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/MINIMUM/FACTUR-X_MINIMUM.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_MINIMUM.xslt";
|
||||
} else if (isBasicWithoutLines) {
|
||||
LOGGER.debug("is Basic/WL");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/BASIC-WL/FACTUR-X_BASIC-WL.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_BASIC-WL.xslt";
|
||||
} else if (isBasic) {
|
||||
LOGGER.debug("is Basic");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/BASIC/FACTUR-X_BASIC.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_BASIC.xslt";
|
||||
} else if (isEN16931) {
|
||||
LOGGER.debug("is EN16931");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/EN16931/FACTUR-X_EN16931.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_EN16931.xslt";
|
||||
} else if (isExtended) {
|
||||
LOGGER.debug("is EXTENDED");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/EXTENDED/FACTUR-X_EXTENDED.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_EXTENDED.xslt";
|
||||
@@ -205,154 +228,170 @@ public class XMLValidator extends Validator {
|
||||
LOGGER.debug("is XRechnung");
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf2/EXTENDED/FACTUR-X_EXTENDED.xsd", 18, EPart.fx);
|
||||
xsltFilename = "/xslt/ZF_211/FACTUR-X_EN16931.xslt";
|
||||
XrechnungSeverity=ESeverity.error;
|
||||
XrechnungSeverity = ESeverity.error;
|
||||
} /*
|
||||
* ISchematronResource aResSCH = SchematronResourceXSLT.fromFile(new File(
|
||||
* "/Users/jstaerk/workspace/ZUV/src/main/resources/ZUGFeRDSchematronStylesheet.xsl"
|
||||
* ));
|
||||
*/
|
||||
* ISchematronResource aResSCH = SchematronResourceXSLT.fromFile(new File(
|
||||
* "/Users/jstaerk/workspace/ZUV/src/main/resources/ZUGFeRDSchematronStylesheet.xsl"
|
||||
* ));
|
||||
*/
|
||||
|
||||
// takes around 10 Seconds. //
|
||||
// http://www.bentoweb.org/refs/TCDL2.0/tsdtf_schematron.html // explains that
|
||||
// this xslt can be created using sth like
|
||||
// saxon java net.sf.saxon.Transform -o tcdl2.0.tsdtf.sch.tmp.xsl -s
|
||||
// tcdl2.0.tsdtf.sch iso_svrl.xsl
|
||||
// takes around 10 Seconds. //
|
||||
// http://www.bentoweb.org/refs/TCDL2.0/tsdtf_schematron.html // explains that
|
||||
// this xslt can be created using sth like
|
||||
// saxon java net.sf.saxon.Transform -o tcdl2.0.tsdtf.sch.tmp.xsl -s
|
||||
// tcdl2.0.tsdtf.sch iso_svrl.xsl
|
||||
|
||||
} else { // ZUGFeRD 1.0
|
||||
context.setVersion("1");
|
||||
//
|
||||
if ((!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:extended"))) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "Unsupported profile type")
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
}
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf1/ZUGFeRD1p0.xsd", 18, EPart.fx);
|
||||
} else { // ZUGFeRD 1.0
|
||||
context.setVersion("1");
|
||||
//
|
||||
if ((!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:extended"))) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "Unsupported profile type")
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
}
|
||||
validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "zf1/ZUGFeRD1p0.xsd", 18, EPart.fx);
|
||||
|
||||
xsltFilename = "/xslt/ZUGFeRD_1p0.xslt";
|
||||
}
|
||||
if (context.getVersion().equals("2")) {
|
||||
if ((!matchesURI(context.getProfile(), "urn:factur-x.eu:1p0:minimum"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:zugferd.de:2p0:minimum"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:factur-x.eu:1p0:basicwl"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:zugferd.de:2p0:basicwl"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#compliant#urn:zugferd.de:2p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#conformant#urn:zugferd.de:2p0:extended"))) {
|
||||
context.addResultItem(
|
||||
new ValidationResultItem(ESeverity.error, "Unsupported profile type " + context.getProfile())
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
xsltFilename = "/xslt/ZUGFeRD_1p0.xslt";
|
||||
}
|
||||
if (context.getVersion().equals("2")) {
|
||||
if ((!matchesURI(context.getProfile(), "urn:factur-x.eu:1p0:minimum"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:zugferd.de:2p0:minimum"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:factur-x.eu:1p0:basicwl"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:zugferd.de:2p0:basicwl"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#compliant#urn:zugferd.de:2p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:cen.eu:en16931:2017#conformant#urn:zugferd.de:2p0:extended"))) {
|
||||
context.addResultItem(
|
||||
new ValidationResultItem(ESeverity.error, "Unsupported profile type " + context.getProfile())
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
|
||||
}
|
||||
} else /** v1 */ {//urn:ferd:invoice:rc:comfort
|
||||
if ((!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:extended"))) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "Unsupported profile type")
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
}
|
||||
} else /** v1 */ {//urn:ferd:invoice:rc:comfort
|
||||
if ((!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:basic"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"))
|
||||
&& (!matchesURI(context.getProfile(), "urn:ferd:CrossIndustryDocument:invoice:1p0:extended"))) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "Unsupported profile type")
|
||||
.setSection(25).setPart(EPart.fx));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// main schematron validation
|
||||
validateSchematron(zfXML, xsltFilename, 4, ESeverity.error);
|
||||
// main schematron validation
|
||||
validateSchematron(zfXML, xsltFilename, 4, ESeverity.error);
|
||||
|
||||
if (context.getVersion().equals("2")
|
||||
&& isEN16931) {
|
||||
//additionally validate against CEN
|
||||
validateSchematron(zfXML, "/xslt/cii16931schematron/EN16931-CII-validation.xslt", 24, ESeverity.error);
|
||||
|
||||
validateXR(zfXML, XrechnungSeverity);
|
||||
}
|
||||
if (context.getVersion().equals("2")
|
||||
&& (isEN16931 || isXRechnung)) {
|
||||
//additionally validate against CEN
|
||||
validateSchematron(zfXML, "/xslt/cii16931schematron/EN16931-CII-validation.xslt", 24, ESeverity.error);
|
||||
if (!disableNotices || XrechnungSeverity != ESeverity.notice) {
|
||||
validateXR(zfXML, XrechnungSeverity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (IrrecoverableValidationError er) {
|
||||
throw er;
|
||||
} catch (Exception e) {
|
||||
ValidationResultItem vri = new ValidationResultItem(ESeverity.exception, e.getMessage()).setSection(22)
|
||||
.setPart(EPart.fx);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
vri.setStacktrace(sw.toString());
|
||||
context.addResultItem(vri);
|
||||
}
|
||||
} catch (IrrecoverableValidationError er) {
|
||||
throw er;
|
||||
} catch (Exception e) {
|
||||
ValidationResultItem vri = new ValidationResultItem(ESeverity.exception, e.getMessage()).setSection(22)
|
||||
.setPart(EPart.fx);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
vri.setStacktrace(sw.toString());
|
||||
context.addResultItem(vri);
|
||||
}
|
||||
|
||||
}
|
||||
long endTime = Calendar.getInstance().getTimeInMillis();
|
||||
}
|
||||
long endTime = Calendar.getInstance().getTimeInMillis();
|
||||
|
||||
context.addCustomXML("<info><version>" + ((context.getVersion() != null) ? context.getVersion() : "invalid")
|
||||
+ "</version><profile>" + ((context.getProfile() != null) ? context.getProfile() : "invalid") +
|
||||
"</profile><validator version=\"" + Main.class.getPackage().getImplementationVersion() + "\"></validator><rules><fired>" + firedRules + "</fired><failed>" + failedRules + "</failed></rules>" + "<duration unit='ms'>" + (endTime - startXMLTime) + "</duration></info>");
|
||||
context.addCustomXML("<info><version>" + ((context.getVersion() != null) ? context.getVersion() : "invalid")
|
||||
+ "</version><profile>" + ((context.getProfile() != null) ? context.getProfile() : "invalid") +
|
||||
"</profile><validator version=\"" + XMLValidator.class.getPackage().getImplementationVersion() + "\"></validator><rules><fired>" + firedRules + "</fired><failed>" + failedRules + "</failed></rules>" + "<duration unit='ms'>" + (endTime - startXMLTime) + "</duration></info>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void validateXR(String xml, ESeverity errorImpact) throws IrrecoverableValidationError {
|
||||
public void validateXR(String xml, ESeverity errorImpact) throws IrrecoverableValidationError {
|
||||
|
||||
validateSchematron(xml, "/xslt/XR/XRechnung-CII-validation.xslt",27, errorImpact);
|
||||
//Guideline ID=urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2 or
|
||||
if (xml.contains(":xrechnung_1.")) {
|
||||
// urn:cen.eu:en16931:2017#compliant#urn:xoev-dede:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0
|
||||
validateSchematron(xml, "/xslt/XR_12/XRechnung-CII-validation.xslt", 27, errorImpact);
|
||||
} else {
|
||||
// urn:cen.eu:en16931:2017#compliant#urn:xoev-dede:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0
|
||||
validateSchematron(xml, "/xslt/XR_20/XRechnung-CII-validation.xslt", 27, errorImpact);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void validateSchematron(String xml, String xsltFilename, int section, ESeverity severity) throws IrrecoverableValidationError {
|
||||
ISchematronResource aResSCH = null;
|
||||
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
|
||||
if (aResSCH != null) {
|
||||
if (!aResSCH.isValidSchematron()) {
|
||||
throw new IllegalArgumentException(xsltFilename + " is invalid Schematron!");
|
||||
}
|
||||
/***
|
||||
* validate using a xslt file generated from a schematron in the build preparation of this software
|
||||
* @param xml the xml to be checked
|
||||
* @param xsltFilename the filename of the intermediate XSLT file
|
||||
* @param section the error type code, if one arises
|
||||
* @param severity how serious a error should be treated - may only be notice
|
||||
* @throws IrrecoverableValidationError if anything happened that prevents further checks
|
||||
*/
|
||||
public void validateSchematron(String xml, String xsltFilename, int section, ESeverity severity) throws IrrecoverableValidationError {
|
||||
ISchematronResource aResSCH = null;
|
||||
aResSCH = SchematronResourceXSLT.fromClassPath(xsltFilename);
|
||||
if (aResSCH != null) {
|
||||
if (!aResSCH.isValidSchematron()) {
|
||||
throw new IllegalArgumentException(xsltFilename + " is invalid Schematron!");
|
||||
}
|
||||
|
||||
SchematronOutputType sout;
|
||||
try {
|
||||
sout = aResSCH
|
||||
.applySchematronValidationToSVRL(new StreamSource(new StringReader(xml)));
|
||||
} catch (Exception e) {
|
||||
throw new IrrecoverableValidationError(e.getMessage());
|
||||
}
|
||||
SchematronOutputType sout;
|
||||
try {
|
||||
sout = aResSCH
|
||||
.applySchematronValidationToSVRL(new StreamSource(new StringReader(xml)));
|
||||
} catch (Exception e) {
|
||||
throw new IrrecoverableValidationError(e.getMessage());
|
||||
}
|
||||
|
||||
List<Object> failedAsserts = sout.getActivePatternAndFiredRuleAndFailedAssert();
|
||||
if (failedAsserts.size() > 0) {
|
||||
for (Object object : failedAsserts) {
|
||||
if (object instanceof FailedAssert) {
|
||||
List<Object> failedAsserts = sout.getActivePatternAndFiredRuleAndFailedAssert();
|
||||
if (failedAsserts.size() > 0) {
|
||||
for (Object object : failedAsserts) {
|
||||
if (object instanceof FailedAssert) {
|
||||
|
||||
FailedAssert failedAssert = (FailedAssert) object;
|
||||
LOGGER.info("FailedAssert ", failedAssert);
|
||||
FailedAssert failedAssert = (FailedAssert) object;
|
||||
LOGGER.info("FailedAssert ", failedAssert);
|
||||
|
||||
context.addResultItem(new ValidationResultItem(severity, SVRLHelper.getAsString(failedAssert.getText()))
|
||||
.setLocation(failedAssert.getLocation()).setCriterion(failedAssert.getTest()).setSection(section)
|
||||
.setPart(EPart.fx));
|
||||
failedRules++;
|
||||
} else if (object instanceof FiredRule) {
|
||||
firedRules++;
|
||||
}
|
||||
}
|
||||
context.addResultItem(new ValidationResultItem(severity, SVRLHelper.getAsString(failedAssert.getText()))
|
||||
.setLocation(failedAssert.getLocation()).setCriterion(failedAssert.getTest()).setSection(section)
|
||||
.setPart(EPart.fx));
|
||||
failedRules++;
|
||||
} else if (object instanceof FiredRule) {
|
||||
firedRules++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (firedRules == 0) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "No rules matched, XML to minimal?").setSection(26)
|
||||
.setPart(EPart.fx));
|
||||
}
|
||||
if (firedRules == 0) {
|
||||
context.addResultItem(new ValidationResultItem(ESeverity.error, "No rules matched, XML to minimal?").setSection(26)
|
||||
.setPart(EPart.fx));
|
||||
|
||||
}
|
||||
// for (String currentString : sout.getText()) {
|
||||
// schematronValidationString += "<output>" + currentString + "</output>";
|
||||
// }
|
||||
}
|
||||
// for (String currentString : sout.getText()) {
|
||||
// schematronValidationString += "<output>" + currentString + "</output>";
|
||||
// }
|
||||
|
||||
// schematronValidationString += new SVRLMarshaller ().getAsString (sout);
|
||||
// returns the complete SVRL
|
||||
// schematronValidationString += new SVRLMarshaller ().getAsString (sout);
|
||||
// returns the complete SVRL
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getFiredRules() {
|
||||
return firedRules;
|
||||
}
|
||||
public int getFiredRules() {
|
||||
return firedRules;
|
||||
}
|
||||
|
||||
public int getFailedRules() {
|
||||
return failedRules;
|
||||
}
|
||||
public int getFailedRules() {
|
||||
return failedRules;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class ZUGFeRDValidator {
|
||||
protected boolean displayXMLValidationOutput;
|
||||
protected long startTime;
|
||||
protected boolean optionsRecognized;
|
||||
protected boolean disableNotices = false;
|
||||
protected String Signature;
|
||||
protected boolean wasCompletelyValid = false;
|
||||
protected String logAppend=null;
|
||||
@@ -77,7 +78,7 @@ public class ZUGFeRDValidator {
|
||||
boolean xmlValidity;
|
||||
context.clear();
|
||||
StringBuffer finalStringResult = new StringBuffer();
|
||||
SimpleDateFormat isoDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
|
||||
SimpleDateFormat isoDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
startTime = Calendar.getInstance().getTimeInMillis();
|
||||
try {
|
||||
@@ -110,7 +111,9 @@ public class ZUGFeRDValidator {
|
||||
} else {
|
||||
BigFileSearcher searcher = new BigFileSearcher();
|
||||
XMLValidator xv = new XMLValidator(context);
|
||||
|
||||
if (disableNotices) {
|
||||
xv.disableNotices();
|
||||
}
|
||||
byte[] pdfSignature = { '%', 'P', 'D', 'F' };
|
||||
boolean isPDF = searcher.indexOf(file, pdfSignature) == 0;
|
||||
if (isPDF) {
|
||||
@@ -250,6 +253,12 @@ public class ZUGFeRDValidator {
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
/***
|
||||
* don't report notices in validation report
|
||||
*/
|
||||
public void disableNotices() {
|
||||
disableNotices=true;
|
||||
}
|
||||
/**
|
||||
* Read the file and calculate the SHA-1 checksum
|
||||
*
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<configuration>
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<target>System.err</target>
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
@@ -24,6 +25,6 @@
|
||||
<!-- Configure so that it outputs to both console and log file -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE" />
|
||||
<!-- appender-ref ref="STDOUT" /-->
|
||||
<!-- appender-ref ref="STDERR" /-->
|
||||
</root>
|
||||
</configuration>
|
||||
</configuration>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,194 +1,194 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<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="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC-WL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<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="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PercentType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="PercentType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,242 +1,242 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<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="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="CreditorFinancialAccountType">
|
||||
<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="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeTaxType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CalculatedAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" type="udt:PercentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="UniversalCommunicationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="URIID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,61 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,318 +1,318 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SellerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedProcuringProject" type="ram:ProcuringProjectType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TaxCurrencyCode" type="qdt:CurrencyCodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProcuringProjectType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="Value" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="AttachmentBinaryObject" type="udt:BinaryObjectType" minOccurs="0"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
</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="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementFinancialCardType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="CardholderName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="2"/>
|
||||
<xs:element name="RoundingAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeSettlementFinancialCard" type="ram:TradeSettlementFinancialCardType" minOccurs="0"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" 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"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="TaxPointDate" type="udt:DateType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" 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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<xs:element name="IncludedNote" type="ram:NoteType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SellerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedProcuringProject" type="ram:ProcuringProjectType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TaxCurrencyCode" type="qdt:CurrencyCodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradePaymentTerms" type="ram:TradePaymentTermsType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProcuringProjectType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="Value" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="AttachmentBinaryObject" type="udt:BinaryObjectType" minOccurs="0"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</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:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainEventType">
|
||||
<xs:sequence>
|
||||
<xs:element name="OccurrenceDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAllowanceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeIndicator" type="udt:IndicatorType" minOccurs="0"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ActualAmount" type="udt:AmountType"/>
|
||||
<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"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
</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="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTaxRegistration" type="ram:TaxRegistrationType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementFinancialCardType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="CardholderName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="2"/>
|
||||
<xs:element name="RoundingAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeSettlementFinancialCard" type="ram:TradeSettlementFinancialCardType" minOccurs="0"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" 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"/>
|
||||
<xs:element name="TypeCode" type="qdt:TaxTypeCodeType"/>
|
||||
<xs:element name="ExemptionReason" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="BasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="TaxPointDate" type="udt:DateType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" 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,85 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="BinaryObjectType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute name="mimeCode" type="xs:token" use="required"/>
|
||||
<xs:attribute name="filename" type="xs:string" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token" use="optional"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token" use="optional"/>
|
||||
</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" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="BinaryObjectType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute name="mimeCode" type="xs:token" use="required"/>
|
||||
<xs:attribute name="filename" type="xs:string" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token" use="optional"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token" use="optional"/>
|
||||
</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" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="IndicatorType">
|
||||
<xs:choice>
|
||||
<xs:element name="Indicator" type="xs:boolean"/>
|
||||
</xs:choice>
|
||||
</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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,433 +1,433 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="AdvancePaymentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PaidAmount" type="udt:AmountType"/>
|
||||
<xs:element name="FormattedReceivedDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
<xs:element name="IncludedTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
<xs:element name="LineStatusCode" type="qdt:LineStatusCodeType" minOccurs="0"/>
|
||||
<xs:element name="LineStatusReasonCode" type="udt:CodeType" 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"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<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="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" 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="SellerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedProcuringProject" type="ram:ProcuringProjectType" minOccurs="0"/>
|
||||
<xs:element name="UltimateCustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="RelatedSupplyChainConsignment" type="ram:SupplyChainConsignmentType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TaxCurrencyCode" type="qdt:CurrencyCodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="InvoiceIssuerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoicerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="TaxApplicableTradeCurrencyExchange" type="ram:TradeCurrencyExchangeType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<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="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedAdvancePayment" type="ram:AdvancePaymentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
<xs:element name="UltimateCustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
<xs:element name="ChargeFreeQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="PackageQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="UltimateShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsServiceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="AppliedAmount" type="udt:AmountType"/>
|
||||
<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="qdt:TransportModeCodeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ContentCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProcuringProjectType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="ValueMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="Value" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType"/>
|
||||
<xs:element name="ClassName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AttachmentBinaryObject" type="udt:BinaryObjectType" minOccurs="0"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="UnitQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SpecifiedPeriodType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:AccountingAccountTypeCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
</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"/>
|
||||
<xs:element name="FaxUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeCurrencyExchangeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SourceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="TargetCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="ConversionRate" type="udt:RateType"/>
|
||||
<xs:element name="ConversionRateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</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="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" 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"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualDiscountAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</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"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualPenaltyAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PartialPaymentAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradePaymentPenaltyTerms" type="ram:TradePaymentPenaltyTermsType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradePaymentDiscountTerms" type="ram:TradePaymentDiscountTermsType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedTradeTax" type="ram:TradeTaxType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="IncludedReferencedProduct" type="ram:ReferencedProductType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementFinancialCardType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="CardholderName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType" maxOccurs="2"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="2"/>
|
||||
<xs:element name="RoundingAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType" maxOccurs="2"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalAllowanceChargeAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeSettlementFinancialCard" type="ram:TradeSettlementFinancialCardType" minOccurs="0"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" 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"/>
|
||||
<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"/>
|
||||
<xs:element name="LineTotalBasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceChargeBasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType" minOccurs="0"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="TaxPointDate" type="udt:DateType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" 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>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="AdvancePaymentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PaidAmount" type="udt:AmountType"/>
|
||||
<xs:element name="FormattedReceivedDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
<xs:element name="IncludedTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DebtorFinancialAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IBANID" type="udt:IDType"/>
|
||||
</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"/>
|
||||
<xs:element name="LineStatusCode" type="qdt:LineStatusCodeType" minOccurs="0"/>
|
||||
<xs:element name="LineStatusReasonCode" type="udt:CodeType" 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"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
<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="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="SellerTaxRepresentativeTradeParty" 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="SellerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedProcuringProject" type="ram:ProcuringProjectType" minOccurs="0"/>
|
||||
<xs:element name="UltimateCustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="RelatedSupplyChainConsignment" type="ram:SupplyChainConsignmentType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="CreditorReferenceID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PaymentReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="TaxCurrencyCode" type="qdt:CurrencyCodeType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="InvoiceIssuerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="InvoicerTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="InvoiceeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="PayeeTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="TaxApplicableTradeCurrencyExchange" type="ram:TradeCurrencyExchangeType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeSettlementPaymentMeans" type="ram:TradeSettlementPaymentMeansType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<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="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
<xs:element name="InvoiceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedAdvancePayment" type="ram:AdvancePaymentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TradingBusinessName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ContractReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="GrossPriceProductTradePrice" type="ram:TradePriceType" minOccurs="0"/>
|
||||
<xs:element name="NetPriceProductTradePrice" type="ram:TradePriceType"/>
|
||||
<xs:element name="UltimateCustomerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeDeliveryType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BilledQuantity" type="udt:QuantityType"/>
|
||||
<xs:element name="ChargeFreeQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="PackageQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="ShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="UltimateShipToTradeParty" type="ram:TradePartyType" minOccurs="0"/>
|
||||
<xs:element name="ActualDeliverySupplyChainEvent" type="ram:SupplyChainEventType" minOccurs="0"/>
|
||||
<xs:element name="DespatchAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="ReceivingAdviceReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
<xs:element name="DeliveryNoteReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LineTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableTradeTax" type="ram:TradeTaxType" maxOccurs="unbounded"/>
|
||||
<xs:element name="BillingSpecifiedPeriod" type="ram:SpecifiedPeriodType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="SpecifiedTradeSettlementLineMonetarySummation" type="ram:TradeSettlementLineMonetarySummationType"/>
|
||||
<xs:element name="AdditionalReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="ReceivableSpecifiedTradeAccountingAccount" type="ram:TradeAccountingAccountType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LogisticsServiceChargeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="AppliedAmount" type="udt:AmountType"/>
|
||||
<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="qdt:TransportModeCodeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="NoteType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ContentCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="Content" type="udt:TextType"/>
|
||||
<xs:element name="SubjectCode" type="udt:CodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProcuringProjectType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductCharacteristicType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="Description" type="udt:TextType"/>
|
||||
<xs:element name="ValueMeasure" type="udt:MeasureType" minOccurs="0"/>
|
||||
<xs:element name="Value" type="udt:TextType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ProductClassificationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ClassCode" type="udt:CodeType"/>
|
||||
<xs:element name="ClassName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="URIID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="LineID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType" minOccurs="0"/>
|
||||
<xs:element name="Name" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="AttachmentBinaryObject" type="udt:BinaryObjectType" minOccurs="0"/>
|
||||
<xs:element name="ReferenceTypeCode" type="qdt:ReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="FormattedIssueDateTime" type="qdt:FormattedDateTimeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="UnitQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SpecifiedPeriodType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeLineItemType">
|
||||
<xs:sequence>
|
||||
<xs:element name="AssociatedDocumentLineDocument" type="ram:DocumentLineDocumentType"/>
|
||||
<xs:element name="SpecifiedTradeProduct" type="ram:TradeProductType"/>
|
||||
<xs:element name="SpecifiedLineTradeAgreement" type="ram:LineTradeAgreementType"/>
|
||||
<xs:element name="SpecifiedLineTradeDelivery" type="ram:LineTradeDeliveryType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLineTradeSettlement" type="ram:LineTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IncludedSupplyChainTradeLineItem" type="ram:SupplyChainTradeLineItemType" maxOccurs="unbounded"/>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAccountingAccountType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:AccountingAccountTypeCodeType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
</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"/>
|
||||
<xs:element name="FaxUniversalCommunication" type="ram:UniversalCommunicationType" minOccurs="0"/>
|
||||
<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"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeCurrencyExchangeType">
|
||||
<xs:sequence>
|
||||
<xs:element name="SourceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="TargetCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="ConversionRate" type="udt:RateType"/>
|
||||
<xs:element name="ConversionRateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
</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="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<xs:element name="DefinedTradeContact" type="ram:TradeContactType" minOccurs="0"/>
|
||||
<xs:element name="PostalTradeAddress" type="ram:TradeAddressType" minOccurs="0"/>
|
||||
<xs:element name="URIUniversalCommunication" type="ram:UniversalCommunicationType" 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"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualDiscountAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</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"/>
|
||||
<xs:element name="CalculationPercent" type="udt:PercentType" minOccurs="0"/>
|
||||
<xs:element name="ActualPenaltyAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePaymentTermsType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="DueDateDateTime" type="udt:DateTimeType" minOccurs="0"/>
|
||||
<xs:element name="DirectDebitMandateID" type="udt:IDType" minOccurs="0"/>
|
||||
<xs:element name="PartialPaymentAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradePaymentPenaltyTerms" type="ram:TradePaymentPenaltyTermsType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradePaymentDiscountTerms" type="ram:TradePaymentDiscountTermsType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePriceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ChargeAmount" type="udt:AmountType"/>
|
||||
<xs:element name="BasisQuantity" type="udt:QuantityType" minOccurs="0"/>
|
||||
<xs:element name="AppliedTradeAllowanceCharge" type="ram:TradeAllowanceChargeType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
<xs:element name="IncludedTradeTax" type="ram:TradeTaxType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeProductType">
|
||||
<xs:sequence>
|
||||
<xs:element name="GlobalID" type="udt:IDType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="Description" type="udt:TextType" minOccurs="0"/>
|
||||
<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"/>
|
||||
<xs:element name="IncludedReferencedProduct" type="ram:ReferencedProductType" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementFinancialCardType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="CardholderName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="ChargeTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType" maxOccurs="2"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0" maxOccurs="2"/>
|
||||
<xs:element name="RoundingAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType" maxOccurs="2"/>
|
||||
<xs:element name="TotalPrepaidAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementLineMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="LineTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TotalAllowanceChargeAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeSettlementPaymentMeansType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TypeCode" type="qdt:PaymentMeansCodeType"/>
|
||||
<xs:element name="Information" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="ApplicableTradeSettlementFinancialCard" type="ram:TradeSettlementFinancialCardType" minOccurs="0"/>
|
||||
<xs:element name="PayerPartyDebtorFinancialAccount" type="ram:DebtorFinancialAccountType" minOccurs="0"/>
|
||||
<xs:element name="PayeePartyCreditorFinancialAccount" type="ram:CreditorFinancialAccountType" 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"/>
|
||||
<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"/>
|
||||
<xs:element name="LineTotalBasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="AllowanceChargeBasisAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="CategoryCode" type="qdt:TaxCategoryCodeType" minOccurs="0"/>
|
||||
<xs:element name="ExemptionReasonCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="TaxPointDate" type="udt:DateType" minOccurs="0"/>
|
||||
<xs:element name="DueDateTypeCode" type="qdt:TimeReferenceCodeType" minOccurs="0"/>
|
||||
<xs:element name="RateApplicablePercent" 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,103 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="BinaryObjectType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute name="mimeCode" type="xs:token" use="required"/>
|
||||
<xs:attribute name="filename" type="xs:string" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token" use="optional"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token" use="optional"/>
|
||||
</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" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DateTime" type="xs:dateTime"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="RateType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="BinaryObjectType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:base64Binary">
|
||||
<xs:attribute name="mimeCode" type="xs:token" use="required"/>
|
||||
<xs:attribute name="filename" type="xs:string" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token">
|
||||
<xs:attribute name="listID" type="xs:token" use="optional"/>
|
||||
<xs:attribute name="listVersionID" type="xs:token" use="optional"/>
|
||||
</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" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="DateTime" type="xs:dateTime"/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="DateType">
|
||||
<xs:choice>
|
||||
<xs:element name="DateString">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="format" type="xs:string" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<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="xs:token" use="required"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="RateType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:element name="CrossIndustryInvoice" type="rsm:CrossIndustryInvoiceType"/>
|
||||
<xs:complexType name="CrossIndustryInvoiceType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ExchangedDocumentContext" type="ram:ExchangedDocumentContextType"/>
|
||||
<xs:element name="ExchangedDocument" type="ram:ExchangedDocumentType"/>
|
||||
<xs:element name="SupplyChainTradeTransaction" type="ram:SupplyChainTradeTransactionType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,92 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="DocumentContextParameterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType"/>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePartyType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<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="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"
|
||||
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
|
||||
elementFormDefault="qualified">
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd"/>
|
||||
<xs:import namespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" schemaLocation="FACTUR-X_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd"/>
|
||||
<xs:complexType name="DocumentContextParameterType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentContextType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BusinessProcessSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType" minOccurs="0"/>
|
||||
<xs:element name="GuidelineSpecifiedDocumentContextParameter" type="ram:DocumentContextParameterType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ExchangedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
<xs:element name="TypeCode" type="qdt:DocumentCodeType"/>
|
||||
<xs:element name="IssueDateTime" type="udt:DateTimeType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeAgreementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="BuyerReference" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="SellerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerTradeParty" type="ram:TradePartyType"/>
|
||||
<xs:element name="BuyerOrderReferencedDocument" type="ram:ReferencedDocumentType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="HeaderTradeDeliveryType"/>
|
||||
<xs:complexType name="HeaderTradeSettlementType">
|
||||
<xs:sequence>
|
||||
<xs:element name="InvoiceCurrencyCode" type="qdt:CurrencyCodeType"/>
|
||||
<xs:element name="SpecifiedTradeSettlementHeaderMonetarySummation" type="ram:TradeSettlementHeaderMonetarySummationType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="LegalOrganizationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="ReferencedDocumentType">
|
||||
<xs:sequence>
|
||||
<xs:element name="IssuerAssignedID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="SupplyChainTradeTransactionType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ApplicableHeaderTradeAgreement" type="ram:HeaderTradeAgreementType"/>
|
||||
<xs:element name="ApplicableHeaderTradeDelivery" type="ram:HeaderTradeDeliveryType"/>
|
||||
<xs:element name="ApplicableHeaderTradeSettlement" type="ram:HeaderTradeSettlementType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TaxRegistrationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="ID" type="udt:IDType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradeAddressType">
|
||||
<xs:sequence>
|
||||
<xs:element name="PostcodeCode" type="udt:CodeType" minOccurs="0"/>
|
||||
<xs:element name="LineOne" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineTwo" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="LineThree" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CityName" type="udt:TextType" minOccurs="0"/>
|
||||
<xs:element name="CountryID" type="qdt:CountryIDType"/>
|
||||
<xs:element name="CountrySubDivisionName" type="udt:TextType" minOccurs="0"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TradePartyType">
|
||||
<xs:sequence>
|
||||
<xs:element name="Name" type="udt:TextType"/>
|
||||
<xs:element name="SpecifiedLegalOrganization" type="ram:LegalOrganizationType" minOccurs="0"/>
|
||||
<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="TradeSettlementHeaderMonetarySummationType">
|
||||
<xs:sequence>
|
||||
<xs:element name="TaxBasisTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="TaxTotalAmount" type="udt:AmountType" minOccurs="0"/>
|
||||
<xs:element name="GrandTotalAmount" type="udt:AmountType"/>
|
||||
<xs:element name="DuePayableAmount" type="udt:AmountType"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
@@ -1,44 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xs:schema xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
targetNamespace="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100"
|
||||
elementFormDefault="qualified"
|
||||
version="100.D16B">
|
||||
<xs:complexType name="AmountType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:decimal">
|
||||
<xs:attribute name="currencyID" type="xs:token" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CodeType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:token"/>
|
||||
</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" use="required"/>
|
||||
</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" use="optional"/>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="TextType">
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string"/>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:schema>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user