Merge pull request #111 from swsch/extensions
make document name and globalID configurable by implementers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user