corrected reading of date

This commit is contained in:
jstaerk
2025-10-20 10:25:48 +02:00
parent c3a5f0ef2c
commit a60ff926ca
2 changed files with 7 additions and 2 deletions

View File

@@ -721,7 +721,8 @@ public class ZUGFeRDInvoiceImporter {
}
if((additionalChilds.item(additionalChildIndex).getLocalName() != null)
&& (additionalChilds.item(additionalChildIndex).getLocalName().equals("FormattedIssueDateTime"))) {
NodeList FormattedIssueDateTimeChilds = headerTradeAgreementChilds.item(agreementChildIndex).getChildNodes();
NodeList FormattedIssueDateTimeChilds = additionalChilds.item(additionalChildIndex).getChildNodes();
for (int dateChildIndex = 0; dateChildIndex < FormattedIssueDateTimeChilds.getLength(); dateChildIndex++){
if((FormattedIssueDateTimeChilds.item(dateChildIndex).getLocalName() != null)
&& (FormattedIssueDateTimeChilds.item(dateChildIndex).getLocalName().equals("DateTimeString"))) {

View File

@@ -20,6 +20,7 @@
*/
package org.mustangproject.ZUGFeRD;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
@@ -178,7 +179,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
hasExceptions = true;
}
assertFalse(hasExceptions);
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-mm-dd");
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-MM-dd");
// Reading ZUGFeRD
assertEquals("4711", invoice.getZFItems()[0].getProduct().getSellerAssignedID());
assertEquals("9384", invoice.getSellerOrderReferencedDocumentID());
@@ -188,6 +189,9 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
assertEquals("recipient@test.org", invoice.getRecipient().getEmail());
assertEquals("28934", invoice.getBuyerOrderReferencedDocumentID());
}