From 9fa8db04aedbac0b9cbb25a11ab561569cbe99a8 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Sun, 3 Jan 2021 10:48:02 +0100 Subject: [PATCH] Removing datechecked Xrechnung version switch (became effective 2020-01-01 anyway) --- .../ZUGFeRD/IExportableTransaction.java | 14 +++++++++---- .../ZUGFeRD/IZUGFeRDExportableItem.java | 8 ++++++-- .../ZUGFeRD/IZUGFeRDExportableTradeParty.java | 20 +++++-------------- .../org/mustangproject/ZUGFeRD/Profiles.java | 3 +-- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java index e7ef193c..70fa9e50 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java @@ -126,13 +126,19 @@ public interface IExportableTransaction { return null; } - IZUGFeRDAllowanceCharge[] getZFAllowances(); + default IZUGFeRDAllowanceCharge[] getZFAllowances() { + return null; + } - IZUGFeRDAllowanceCharge[] getZFCharges(); + default IZUGFeRDAllowanceCharge[] getZFCharges() { + return null; + } - IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges(); + default IZUGFeRDAllowanceCharge[] getZFLogisticsServiceCharges() { + return null; + } IZUGFeRDExportableItem[] getZFItems(); @@ -290,7 +296,7 @@ public interface IExportableTransaction { * @return three character currency of this invoice */ default String getCurrency() { - return null; + return "EUR"; } diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableItem.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableItem.java index 80ead5ed..a584c718 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableItem.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableItem.java @@ -37,13 +37,17 @@ public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{ * item level discounts * @return array of the discounts on a single item */ - IZUGFeRDAllowanceCharge[] getItemAllowances(); + default IZUGFeRDAllowanceCharge[] getItemAllowances() { + return null; + } /** * item level price additions * @return array of the additional charges on the item */ - IZUGFeRDAllowanceCharge[] getItemCharges(); + default IZUGFeRDAllowanceCharge[] getItemCharges() { + return null; + } /** diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTradeParty.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTradeParty.java index 66f25163..315de277 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTradeParty.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTradeParty.java @@ -68,17 +68,13 @@ public interface IZUGFeRDExportableTradeParty { * * @return First and last name of the recipient */ - default String getName() { - return null; - } + String getName(); /** * Postal code of the recipient * * @return Postal code of the recipient */ - default String getZIP() { - return null; - } + String getZIP(); /** @@ -96,9 +92,7 @@ public interface IZUGFeRDExportableTradeParty { * * @return two-letter iso country code of the contact */ - default String getCountry() { - return null; - } + String getCountry(); /** @@ -106,9 +100,7 @@ public interface IZUGFeRDExportableTradeParty { * * @return Returns the city of the recipient */ - default String getLocation() { - return null; - } + String getLocation(); /** @@ -116,9 +108,7 @@ public interface IZUGFeRDExportableTradeParty { * * @return street address (street+number) of the contact */ - default String getStreet() { - return null; - } + String getStreet(); /** * returns additional address information which is display in xml tag "LineTwo" diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/Profiles.java b/library/src/main/java/org/mustangproject/ZUGFeRD/Profiles.java index 515e9505..dc0d6e4f 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/Profiles.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/Profiles.java @@ -20,7 +20,6 @@ */ package org.mustangproject.ZUGFeRD; -import java.time.Year; import java.util.Map; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -32,7 +31,7 @@ public class Profiles { {"BASIC", new Profile("BASIC", "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic")}, {"EN16931", new Profile("EN16931", "urn:cen.eu:en16931:2017")}, {"EXTENDED", new Profile("EXTENDED", "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended")}, - {"XRECHNUNG", new Profile("XRECHNUNG", "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_"+((Year.now().getValue()<=2020)?"1.2":"2.0"))} //intentionally switch to XRechnung 2.0 on 01.01.2021 + {"XRECHNUNG", new Profile("XRECHNUNG", "urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0")} //switched to XRechnung 2.0 in 2021 }).collect(Collectors.toMap(data -> (String) data[0], data -> (Profile) data[1])); static Map zf1Map = Stream.of(new Object[][]{