diff --git a/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableContact.java b/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableContact.java index 6b154b67..4704ab4f 100644 --- a/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableContact.java +++ b/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableContact.java @@ -38,6 +38,24 @@ 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 diff --git a/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTransaction.java b/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTransaction.java index 0de986c1..03a93e7d 100644 --- a/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTransaction.java +++ b/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableTransaction.java @@ -33,6 +33,14 @@ import java.util.Date; public interface IZUGFeRDExportableTransaction { + /** + * appears in /rsm:CrossIndustryDocument/rsm:HeaderExchangedDocument/ram:Name + * @return Name of document + */ + default String getDocumentName() { + return "RECHNUNG"; + } + /** * * diff --git a/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDTransactionModelConverter.java b/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDTransactionModelConverter.java index 8e63ec71..ef65035c 100644 --- a/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDTransactionModelConverter.java +++ b/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDTransactionModelConverter.java @@ -149,7 +149,7 @@ class ZUGFeRDTransactionModelConverter { document.setTypeCode(documentCodeType); TextType name = xmlFactory.createTextType(); - name.setValue("RECHNUNG"); + name.setValue(trans.getDocumentName()); document.getName().add(name); if (trans.getOwnOrganisationFullPlaintextInfo() != null) { @@ -212,6 +212,12 @@ class ZUGFeRDTransactionModelConverter { buyerID.setValue(trans.getRecipient().getID()); buyerTradeParty.getID().add(buyerID); } + if (trans.getRecipient().getGlobalID() != null) { + IDType globalID = xmlFactory.createIDType(); + globalID.setValue(trans.getRecipient().getGlobalID()); + globalID.setSchemeID(trans.getRecipient().getGlobalIDScheme()); + buyerTradeParty.getGlobalID().add(globalID); + } TextType buyerName = xmlFactory.createTextType(); buyerName.setValue(trans.getRecipient().getName());