Don't write "null" as paymentDescription if no Bank account is specified
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
- #201 correct embedded files in XRechnung
|
- #201 correct embedded files in XRechnung
|
||||||
- transaction calculator getGrandTotal now public
|
- transaction calculator getGrandTotal now public
|
||||||
|
- corrected sample in docs thanks to tweimer PR #204
|
||||||
|
- don't write "null" as paymentDescription if no Bank account is specified
|
||||||
|
|
||||||
2.0.2
|
2.0.2
|
||||||
=======
|
=======
|
||||||
|
|||||||
@@ -571,9 +571,12 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (trans.getPaymentTerms() == null) {
|
if ((trans.getPaymentTerms() == null)&&((paymentTermsDescription!=null)||(trans.getTradeSettlement()!=null)||(hasDueDate))) {
|
||||||
xml = xml + " <ram:SpecifiedTradePaymentTerms>\n"
|
xml = xml + "<ram:SpecifiedTradePaymentTerms>\n";
|
||||||
+ " <ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
|
||||||
|
if (paymentTermsDescription!=null) {
|
||||||
|
xml = xml + "<ram:Description>" + paymentTermsDescription + "</ram:Description>\n";
|
||||||
|
}
|
||||||
|
|
||||||
if (trans.getTradeSettlement() != null) {
|
if (trans.getTradeSettlement() != null) {
|
||||||
for (IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
for (IZUGFeRDTradeSettlement payment : trans.getTradeSettlement()) {
|
||||||
@@ -645,9 +648,13 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String buildPaymentTermsXml() {
|
private String buildPaymentTermsXml() {
|
||||||
String paymentTermsXml = "<ram:SpecifiedTradePaymentTerms>";
|
|
||||||
|
|
||||||
IZUGFeRDPaymentTerms paymentTerms = trans.getPaymentTerms();
|
IZUGFeRDPaymentTerms paymentTerms = trans.getPaymentTerms();
|
||||||
|
if (paymentTerms==null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String paymentTermsXml = "<ram:SpecifiedTradePaymentTerms>";
|
||||||
|
|
||||||
IZUGFeRDPaymentDiscountTerms discountTerms = paymentTerms.getDiscountTerms();
|
IZUGFeRDPaymentDiscountTerms discountTerms = paymentTerms.getDiscountTerms();
|
||||||
Date dueDate = paymentTerms.getDueDate();
|
Date dueDate = paymentTerms.getDueDate();
|
||||||
if (dueDate != null && discountTerms != null && discountTerms.getBaseDate() != null) {
|
if (dueDate != null && discountTerms != null && discountTerms.getBaseDate() != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user