This commit is contained in:
jstaerk
2025-02-10 07:50:57 +01:00
parent 036de68d0a
commit e2290e36cd
5 changed files with 14 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
#558
2.16.2 2.16.2
======= =======

View File

@@ -134,7 +134,10 @@ public class Charge implements IZUGFeRDAllowanceCharge {
if (totalAmount!=null) { if (totalAmount!=null) {
return totalAmount; return totalAmount;
} else { } else {
throw new RuntimeException("totalAmount must be set"); if (percent==null) {
throw new RuntimeException("totalAmount must be set");
}
return null;
} }
} }

View File

@@ -704,6 +704,7 @@ public class ZUGFeRDInvoiceImporter {
NodeList paymentMeansChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes(); NodeList paymentMeansChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes();
IBAN = null; IBAN = null;
BIC = null; BIC = null;
String accountName = null;
paymentMeansCode = null; paymentMeansCode = null;
paymentMeansInformation = null; paymentMeansInformation = null;
for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds.getLength(); paymentMeansChildIndex++) { for (int paymentMeansChildIndex = 0; paymentMeansChildIndex < paymentMeansChilds.getLength(); paymentMeansChildIndex++) {
@@ -722,6 +723,9 @@ public class ZUGFeRDInvoiceImporter {
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("IBANID"))) {//CII
IBAN = XMLTools.trimOrNull(accountChilds.item(accountChildIndex)); IBAN = XMLTools.trimOrNull(accountChilds.item(accountChildIndex));
} }
if ((accountChilds.item(accountChildIndex).getLocalName() != null) && (accountChilds.item(accountChildIndex).getLocalName().equals("AccountName"))) {//CII
accountName = XMLTools.trimOrNull(accountChilds.item(accountChildIndex));
}
} }
} }
if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeeSpecifiedCreditorFinancialInstitution"))) { if ((paymentMeansChilds.item(paymentMeansChildIndex).getLocalName() != null) && (paymentMeansChilds.item(paymentMeansChildIndex).getLocalName().equals("PayeeSpecifiedCreditorFinancialInstitution"))) {
@@ -739,6 +743,9 @@ public class ZUGFeRDInvoiceImporter {
if (BIC != null) { if (BIC != null) {
bd.setBIC(BIC); bd.setBIC(BIC);
} }
if (accountName!=null) {
bd.setAccountName(accountName);
}
bankDetails.add(bd); bankDetails.add(bd);
} }
} }

View File

@@ -88,7 +88,7 @@ public class XRTest extends TestCase {
FileAttachment fe1 = new FileAttachment("one.pdf", "application/pdf", "Alternative", b); FileAttachment fe1 = new FileAttachment("one.pdf", "application/pdf", "Alternative", b);
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()) Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date())
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").setEmail("sender@example.com").addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "test@example.org")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX"))) .setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").setEmail("sender@example.com").addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "test@example.org")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX").setAccountName("kontoInhaber")))
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setEmail("recipient@sample.org")) .setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setEmail("recipient@sample.org"))
.addCashDiscount(new CashDiscount(new BigDecimal(2), 7)) .addCashDiscount(new CashDiscount(new BigDecimal(2), 7))
.addCashDiscount(new CashDiscount(new BigDecimal(3), 14)) .addCashDiscount(new CashDiscount(new BigDecimal(3), 14))

View File

@@ -340,6 +340,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
IZUGFeRDTradeSettlementPayment paym = (IZUGFeRDTradeSettlementPayment) invoice.getTradeSettlement()[0]; IZUGFeRDTradeSettlementPayment paym = (IZUGFeRDTradeSettlementPayment) invoice.getTradeSettlement()[0];
assertEquals("DE12500105170648489890", paym.getOwnIBAN()); assertEquals("DE12500105170648489890", paym.getOwnIBAN());
assertEquals("COBADEFXXX", paym.getOwnBIC()); assertEquals("COBADEFXXX", paym.getOwnBIC());
assertEquals("kontoInhaber",paym.getAccountName());
assertTrue(invoice.getPayee() != null); assertTrue(invoice.getPayee() != null);