Merge pull request #111 from swsch/extensions

make document name and globalID configurable by implementers
This commit is contained in:
Jochen Staerk
2019-07-24 17:31:14 +02:00
committed by GitHub
3 changed files with 33 additions and 1 deletions

View File

@@ -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

View File

@@ -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";
}
/**
*
*

View File

@@ -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());