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

ZUGFeRDInvoiceImporter does not read BankDetails.accountName #558

Open
dankito opened this issue Nov 14, 2024 · 0 comments
Open

ZUGFeRDInvoiceImporter does not read BankDetails.accountName #558

dankito opened this issue Nov 14, 2024 · 0 comments

Comments

@dankito
Copy link

dankito commented Nov 14, 2024

I'm using current version 2.14.2.

In ZUGFeRDInvoiceImporter.java BankDetails.accountName does not get read (line 240 ff.):

	String IBAN = null, BIC = null;
	for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds.getLength(); paymentMeansChildIndex++) {
		if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
			NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
			for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
				if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
					IBAN = accountChilds.item(accountChildIndex).getTextContent();
				}

                               // TODO: also read element AccountName
			}
		}
// ...

A fix would be:

	String IBAN = null, BIC = null, accountName = null;
	for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds.getLength(); paymentMeansChildIndex++) {
		if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeePartyCreditorFinancialAccount"))) {
			NodeList accountChilds = paymentMeansChilds.item(paymentMeansChildIndex).getChildNodes();
			for (int accountChildIndex = 0; accountChildIndex < accountChilds.getLength(); accountChildIndex++) {
				if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
					IBAN = accountChilds.item(accountChildIndex).getTextContent();
				}

                                // this has to be added, as well as `accountName = null` in first line
				if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("AccountName"))) {//CII
					accountName = accountChilds.item(accountChildIndex).getTextContent();
				}
			}
		}

// ...


	if (IBAN != null) {
		BankDetails bd = new BankDetails(IBAN);
		if (BIC != null) {
			bd.setBIC(BIC);
		}
                bd.setAccountName(accountName); // also has to be added
		bankDetails.add(bd);
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant