Bugfix in ZUGFeRD2PullProvider.generateXML(): try getPaymentTermDescription() before constructing one

or the program throws a NullPointerException if 'trans' only overwrites
'getPaymentTermDescription()' but not the default 'getDueDate()'.
This commit is contained in:
Jens Heise
2020-05-06 23:25:30 +02:00
committed by heisej
parent 496c6bdfe1
commit 69128ce509

View File

@@ -252,13 +252,14 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$ SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$
String exemptionReason=""; String exemptionReason="";
if (trans.getPaymentTermDescription()!=null) {
paymentTermsDescription=trans.getPaymentTermDescription();
}
if (paymentTermsDescription==null) { if (paymentTermsDescription==null) {
paymentTermsDescription= "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate()); paymentTermsDescription= "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
} }
if (trans.getPaymentTermDescription()!=null) {
paymentTermsDescription=trans.getPaymentTermDescription();
}
String senderReg = ""; String senderReg = "";
if (trans.getOwnOrganisationFullPlaintextInfo() != null) { if (trans.getOwnOrganisationFullPlaintextInfo() != null) {