Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates about SpecifiedTradeSettlementHeaderMonetarySummation and SpecifiedTradeSettlementPaymentMeans #729

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions library/src/main/java/org/mustangproject/BankDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -123,5 +131,31 @@ public String getAccountName() {
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; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ default String getOwnIBAN() {
*/
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
Expand All @@ -70,12 +80,14 @@ default String getSettlementXML() {
}

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>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ public void generateXML(IExportableTransaction trans) {
final String chargesTotalLine = "<ram:ChargeTotalAmount>" + currencyFormat(calc.getChargesForPercent(null)) + "</ram:ChargeTotalAmount>";

xml += "<ram:SpecifiedTradeSettlementHeaderMonetarySummation>";
if ((getProfile() != Profiles.getByName("Minimum")) && (getProfile() != Profiles.getByName("BASICWL"))) {
if ((getProfile() != Profiles.getByName("Minimum"))) {
xml += "<ram:LineTotalAmount>" + currencyFormat(calc.getTotal()) + "</ram:LineTotalAmount>";
xml += chargesTotalLine
+ allowanceTotalLine;
Expand Down