Merge pull request #278 from weclapp-dev/master

Add missing encodeXML to node payment terms description
This commit is contained in:
Jochen Staerk
2022-07-09 11:39:13 +02:00
committed by GitHub
2 changed files with 3 additions and 4 deletions

View File

@@ -35,7 +35,6 @@ import java.util.logging.Logger;
import org.mustangproject.EStandard;
import org.mustangproject.FileAttachment;
import org.mustangproject.TradeParty;
import org.mustangproject.XMLTools;
public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider {
@@ -57,7 +56,7 @@ public class OXPullProvider extends ZUGFeRD2PullProvider implements IXMLProvider
final String exemptionReason = "";
if (trans.getPaymentTermDescription() != null) {
paymentTermsDescription = trans.getPaymentTermDescription();
paymentTermsDescription = XMLTools.encodeXML(trans.getPaymentTermDescription());
}
if ((paymentTermsDescription == null) && (trans.getDocumentCode() != CORRECTEDINVOICE)/* && (trans.getDocumentCode() != DocumentCodeTypeConstants.CREDITNOTE)*/) {

View File

@@ -265,7 +265,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
String exemptionReason = "";
if (trans.getPaymentTermDescription() != null) {
paymentTermsDescription = trans.getPaymentTermDescription();
paymentTermsDescription = XMLTools.encodeXML(trans.getPaymentTermDescription());
}
if ((paymentTermsDescription == null) && (trans.getDocumentCode() != CORRECTEDINVOICE)/* && (trans.getDocumentCode() != DocumentCodeTypeConstants.CREDITNOTE)*/) {
@@ -746,7 +746,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
String paymentTermsXml = "<ram:SpecifiedTradePaymentTerms>";
final IZUGFeRDPaymentDiscountTerms discountTerms = paymentTerms.getDiscountTerms();
Date dueDate = paymentTerms.getDueDate();
final Date dueDate = paymentTerms.getDueDate();
if (dueDate != null && discountTerms != null && discountTerms.getBaseDate() != null) {
throw new IllegalStateException(
"if paymentTerms.dueDate is specified, paymentTerms.discountTerms.baseDate has not to be specified");