If this project saved you some time or made your day a little easier, a star would mean a lot — it helps others find it too.
A Java library for converting Peppol e-invoices (UBL 2.1 Invoice / CreditNote) into Slovakia Tax Data Documents (TDD) for tax reporting.
peppol-sk is part of my Peppol solution stack. See https://github.com/phax/peppol for other components and libraries in that area.
This project is work in progress and contains the version to be send out for member review - there might be future changes for the final data model for SK!
This contains a set of Java libraries. They are licensed under the Apache 2.0 license. The minimum requirement is Java 17.
The backing specifications are:
- SK TDD: https://docs.peppol.eu/tdd/sk/
This project consists of the following submodules (in alphabetic order)
peppol-sk-tdd- contains the main logic to create Peppol SK TDD documents based on the Peppol SK pilot documents as well as documentation- Main class to build a complete SK from scratch is
PeppolSKTDD100Builder - To run the Schematron validation, use class
PeppolSKTDDValidator
- Main class to build a complete SK from scratch is
peppol-sk-tdd-datatypes- contains the JAXB generated Peppol SK TDD data model- Main class to read and write TDD XML is
PeppolSKTDD100Marshaller
- Main class to read and write TDD XML is
peppol-sk-testfiles- contains Peppol SK specific test files as a reusable component- Main class is
PeppolSKTestFiles
- Main class is
Add the following to your pom.xml to use this artifact, replacing x.y.z with the real version number.
<dependency>
<groupId>com.helger.peppol</groupId>
<artifactId>peppol-sk-tdd</artifactId>
<version>x.y.z</version>
</dependency>// Convert a UBL Invoice to a TDD document
TaxDataType tdd = new PeppolSKTDD100Builder ()
.taxDataTypeCode (ESKTDDTaxDataTypeCode.SUBMIT)
.reportingParty (participantID)
.receivingParty (receiverID)
.taxAuthorityID ("SK")
.reportedTransaction (rt -> rt.initFromInvoice (invoice))
.build ();
// Serialize to XML
String xml = new PeppolSKTDD100Marshaller ().setFormattedOutput (true).getAsString (tdd);
// Validate with Schematron
ISchematronResource schematron = PeppolSKTDDValidator.getSchematronSK_TDD_100 ();The ReportedDocument is created for every TaxDataTypeCode, including D (DISREGARD), so all of its mandatory fields must be set.
The ReportedDocument/UUID is calculated according to rule ID-BDID-01 from BT-34-1, BT-34, BT-3, BT-1 and BT-2.
Leading and trailing whitespace is removed from these values for the calculation, and build() returns null if one of them is missing or empty.
All other values are copied as is.
This project requires Apache Maven 3.x and Java 17 for building. Simply run
mvn clean install
to build the solution.
v0.9.2 - work in progress
PeppolSKTDD100ReportedTransactionBuilder.initFromInvoiceandinitFromCreditNotenow find thecac:PartyTaxSchemefor the VAT identifiers (BT-31, BT-48, BT-63) independent of the case and surrounding whitespace of theTaxScheme/ID, as the EN 16931 Schematron does. Previously a BIS3-validTaxScheme/IDlikevatorVatlost the VAT identifiers in the TDD. See #10 - thx @FilipKovac
v0.9.1 - 2026-10-28
- Requires ph-commons 12.5.3
- Added
taxPointDate (LocalDate)toPeppolSKTDD100ReportedTransactionBuilder. The value added tax point date (BT-7) of an Invoice or CreditNote is now taken over intoReportedDocument/cbc:TaxPointDate. See #5 - thx @FilipKovac - Fixed an
IndexOutOfBoundsExceptioninPeppolSKTDD100ReportedTransactionBuilder.initFromInvoiceandinitFromCreditNoteif the invoice period contains a tax point date code (BT-8). The value is now correctly taken over intoReportedDocument/cac:InvoicePeriod/cbc:DescriptionCode. See #6 - thx @FilipKovac PeppolSKTDD100ReportedTransactionBuilder.initFromInvoiceandinitFromCreditNotenow take the VAT identifiers (BT-31, BT-48, BT-63) from thecac:PartyTaxSchemewithTaxScheme/IDVAT, instead of always using the first one. Previously a Seller tax registration identifier (BT-32) listed first was reported as VAT identifier. A party without aVATtax scheme now has no VAT identifier. See #7 - thx @FilipKovac- Fixed
PeppolSKTDD100ReportedTransactionBuilder.build ()to write the payment instructions (BG-16) to the TDD. Previously thecac:PaymentMeanselements were collected but never emitted, so no TDD contained them. See #8 - thx @FilipKovac - Added
paymentMandateID (String)andpayerFinancialAccountID (String)toPeppolSKTDD100PaymentMeansBuilder. The direct debit information (BG-19 with BT-89 and BT-91) of an Invoice or CreditNote is now taken over intocac:PaymentMeans/cac:PaymentMandate. See #8 - thx @FilipKovac PeppolSKTDD100ReportedTransactionBuildernow removes leading and trailing whitespace from the five values used for theReportedDocument/cbc:UUIDcalculation (ruleID-BDID-01). A value that is empty after trimming is now treated as missing, sobuild ()returnsnullinstead of creating a deviating UUID. See #9 - thx @FilipKovac
v0.9.0 - 2026-10-22
- Requires ph-commons 12.5.2
- Added
logHandler (ILogHandler)toPeppolSKTDD100Builderand all sub-builders. It receives the message of each missing or invalid required field (as error) when callingbuild (); the default handler logs to the logger of the builder class. UseILogHandler.createForConsumer,ILogHandler.createForBiConsumerorErrorListLogHandlerto redirect the messages, andILogHandler.createNoOp ()to discard them. Call it first, because it is passed on to sub-builders created via lambda afterwards - Added
isEveryRequiredFieldSet (ErrorList)which collects the messages in anErrorList, independent of the log handler - Removed the public
isEveryRequiredFieldSet ()andisEveryRequiredFieldSet (boolean)methods; useisEveryRequiredFieldSet (ErrorList)orbuild ()instead
v0.2.2 - 2026-09-23
- The tax exemption reason (BT-120) and tax exemption reason code (BT-121) are no longer copied into the invoice line VAT information (BG-30) and into the document level allowance/charge (BG-20, BG-21), because the SK TDD rules
ibr-tdd-80andibr-tdd-63forbid them there. See #4 - thx @mariansbr - The tax category is no longer copied into the invoice line level allowance/charge (BG-27, BG-28), because the SK TDD rule
ibr-tdd-60forbids it there - Added the new test invoice
invoice/good/vat-category-AE.xmlcovering all of the above
v0.2.1 - 2026-08-12
- Added the mapping of tax exemption reason (BT-120) and tax exemption reason code (BT-121) in class
PeppolSKTDD100TaxCategoryBuilder. See #3 - thx @vrbyjimmy
v0.2.0 - 2026-07-17
- Updated to ph-schematron v10.x
- Requires at least phive 12.0.2
v0.1.3 - 2026-03-11
- Updated to latest published Schematrons.
v0.1.2 - 2026-03-10
- Added support for participant identifier scheme
0245. See #1 - thx @vrbyjimmy
v0.1.1 - 2026-03-05
- Validating all output against all 3 layers of Schematron instead of just one
- Added the mandatory mapping of Reported Document / buyer name (BT-44)
- Added the optional mapping for price base quantity (BT-149)
- The builder class
PeppolSKTDD100TaxSubtotalBuildernot also correctly uses the nestedPeppolSKTDD100TaxCategoryBuilderbuilder class
v0.1.0 - 2026-03-03
- Initial version targeting Peppol SK member review TDD specs
My personal Coding Styleguide | It is appreciated if you star the GitHub project if you like it.