Merge pull request #1007 from burak-inan/ubl-duplicate-notes-and-missing-bic

fix: resolve duplicate notes and missing BIC parsing for UBL invoices
This commit is contained in:
Jochen Staerk
2026-02-04 13:07:34 +01:00
committed by GitHub

View File

@@ -386,7 +386,6 @@ public class ZUGFeRDInvoiceImporter {
for (int nodeIndex = 0; nodeIndex < UBLNotesNd.getLength(); nodeIndex++) { for (int nodeIndex = 0; nodeIndex < UBLNotesNd.getLength(); nodeIndex++) {
includedNotes.add(IncludedNote.generalNote(UBLNotesNd.item(nodeIndex).getTextContent())); includedNotes.add(IncludedNote.generalNote(UBLNotesNd.item(nodeIndex).getTextContent()));
} }
zpp.addNotes(includedNotes);
} }
XPathExpression shipExUBL = xpath.compile("//*[local-name()=\"Delivery\"]"); XPathExpression shipExUBL = xpath.compile("//*[local-name()=\"Delivery\"]");
@@ -963,6 +962,16 @@ public class ZUGFeRDInvoiceImporter {
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("ID"))) { if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("ID"))) {
IBAN = XMLTools.trimOrNull(paymentTermChilds.item(paymentTermChildIndex)); IBAN = XMLTools.trimOrNull(paymentTermChilds.item(paymentTermChildIndex));
} }
if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null)
&& (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("FinancialInstitutionBranch"))) {
NodeList branchChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes();
for (int branchChildIndex = 0; branchChildIndex < branchChilds.getLength(); branchChildIndex++) {
if ((branchChilds.item(branchChildIndex).getLocalName() != null)
&& (branchChilds.item(branchChildIndex).getLocalName().equals("ID"))) {
BIC = XMLTools.trimOrNull(branchChilds.item(branchChildIndex));
}
}
}
} }
} }
if ((paymentMeansChilds.item(meansChildIndex).getLocalName() != null) if ((paymentMeansChilds.item(meansChildIndex).getLocalName() != null)
@@ -978,6 +987,9 @@ public class ZUGFeRDInvoiceImporter {
} }
if (IBAN != null) { if (IBAN != null) {
BankDetails bd = new BankDetails(IBAN); BankDetails bd = new BankDetails(IBAN);
if (BIC != null) {
bd.setBIC(BIC);
}
if (accountName != null) { if (accountName != null) {
bd.setAccountName(accountName); bd.setAccountName(accountName);
} }