Skip to content

Commit

Permalink
cleanup two PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
jstaerk committed Nov 17, 2024
1 parent c0b766e commit 756f90a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 37 deletions.
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- 538 Mustang validator always claims PDF is invalid if flavour is PDF/A-3A
- 555 be able to validate ubl credit notes
- when parsing now distinguishing between the parseExceptions StructureException and ArithmetricException

- Import IncludedNotes on invoice extraction #554

2.14.2
=======
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.mustangproject.*;

import javax.xml.xpath.XPathExpressionException;
Expand All @@ -35,6 +36,9 @@
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;


/***
Expand Down Expand Up @@ -372,4 +376,24 @@ public void testImportMinimum() {

}

@Test
public void testImportIncludedNotes() throws XPathExpressionException, ParseException {
InputStream inputStream = this.getClass()
.getResourceAsStream("/EN16931_Einfach.pdf");
ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter(inputStream);
Invoice invoice = importer.extractInvoice();
List<IncludedNote> notesWithSubjectCode = invoice.getNotesWithSubjectCode();
assertThat(notesWithSubjectCode).hasSize(2);
assertThat(notesWithSubjectCode.get(0).getSubjectCode()).isNull();
assertThat(notesWithSubjectCode.get(0).getContent()).isEqualTo("Rechnung gemäß Bestellung vom 01.11.2024.");
assertThat(notesWithSubjectCode.get(1).getSubjectCode()).isEqualTo(SubjectCode.REG);
assertThat(notesWithSubjectCode.get(1).getContent()).isEqualTo("Lieferant GmbH\t\t\t\t\n"
+ "Lieferantenstraße 20\t\t\t\t\n"
+ "80333 München\t\t\t\t\n"
+ "Deutschland\t\t\t\t\n"
+ "Geschäftsführer: Hans Muster\n"
+ "Handelsregisternummer: H A 123");

}

}

This file was deleted.

0 comments on commit 756f90a

Please sign in to comment.