feat: possibility to override ram:SpecifiedTradeSettlementPaymentMeans/ram:TypeCode
Factur-X 1.07.2 specifications indicate that the ram:TypeCode can be other code than 58. Espacially for ChorusPro which expect 30 for SEPA credit transfer
This commit is contained in:
@@ -23,6 +23,14 @@ public class BankDetails implements IZUGFeRDTradeSettlementPayment {
|
||||
* the "name" of the bank account (holder)
|
||||
*/
|
||||
protected String accountName = null;
|
||||
/**
|
||||
* payment means code
|
||||
*/
|
||||
protected String paymentMeansCode = "58";
|
||||
/**
|
||||
* payment means information
|
||||
*/
|
||||
protected String paymentMeansInformation = "SEPA credit transfer";
|
||||
|
||||
/***
|
||||
* bean constructor
|
||||
@@ -123,5 +131,31 @@ public class BankDetails implements IZUGFeRDTradeSettlementPayment {
|
||||
return accountName;
|
||||
}
|
||||
|
||||
/**
|
||||
* set payment means code
|
||||
*
|
||||
* @param paymentMeansCode the payment means code
|
||||
* @return fluent setter
|
||||
*/
|
||||
public BankDetails setPaymentMeansCode(String paymentMeansCode) {
|
||||
this.paymentMeansCode = paymentMeansCode;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentMeansCode() { return paymentMeansCode; }
|
||||
|
||||
/**
|
||||
* set payment means information
|
||||
*
|
||||
* @param paymentMeansInformation the payment mean information
|
||||
* @return fluent setter
|
||||
*/
|
||||
public BankDetails setPaymentMeansInformation(String paymentMeansInformation) {
|
||||
this.paymentMeansInformation = paymentMeansInformation;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPaymentMeansInformation() { return paymentMeansInformation; }
|
||||
}
|
||||
|
||||
@@ -59,6 +59,16 @@ public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement
|
||||
*/
|
||||
default String getAccountName() { return null; }
|
||||
|
||||
/***
|
||||
* @return payment means code (BT-81 / UNTDID 4461)
|
||||
*/
|
||||
default String getPaymentMeansCode() { return null; };
|
||||
|
||||
/***
|
||||
* @return payment means description (BT-82) (optional)
|
||||
*/
|
||||
default String getPaymentMeansInformation() { return null; };
|
||||
|
||||
|
||||
@Override
|
||||
@JsonIgnore
|
||||
@@ -70,12 +80,14 @@ public interface IZUGFeRDTradeSettlementPayment extends IZUGFeRDTradeSettlement
|
||||
}
|
||||
|
||||
String xml = "<ram:SpecifiedTradeSettlementPaymentMeans>"
|
||||
+ "<ram:TypeCode>58</ram:TypeCode>"
|
||||
+ "<ram:Information>SEPA credit transfer</ram:Information>"
|
||||
+ "<ram:PayeePartyCreditorFinancialAccount>"
|
||||
+ "<ram:IBANID>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>";
|
||||
xml+= accountNameStr;
|
||||
xml+= "</ram:PayeePartyCreditorFinancialAccount>";
|
||||
+ "<ram:TypeCode>" + XMLTools.encodeXML(getPaymentMeansCode()) + "</ram:TypeCode>"
|
||||
+ "<ram:Information>" + XMLTools.encodeXML(getPaymentMeansInformation()) + "</ram:Information>";
|
||||
if (getOwnIBAN() != null) {
|
||||
xml += "<ram:PayeePartyCreditorFinancialAccount>"
|
||||
+ "<ram:IBANID>" + XMLTools.encodeXML(getOwnIBAN()) + "</ram:IBANID>"
|
||||
+ accountNameStr
|
||||
+ "</ram:PayeePartyCreditorFinancialAccount>";
|
||||
}
|
||||
if (getOwnBIC()!=null) {
|
||||
xml+= "<ram:PayeeSpecifiedCreditorFinancialInstitution>"
|
||||
+ "<ram:BICID>" + XMLTools.encodeXML(getOwnBIC()) + "</ram:BICID>"
|
||||
|
||||
Reference in New Issue
Block a user