corrected test

This commit is contained in:
jstaerk
2022-12-23 10:03:31 +01:00
parent 794edc272b
commit 1325fa15b3
2 changed files with 18 additions and 15 deletions

View File

@@ -1,6 +1,10 @@
2.6.0 2.6.0 "Joyeux Noël"
======= =======
2022-12-23
- Allow foreign (e.g., french) trade parties whose addresses only consist of the country
- Allow invoices in minimum profile e.g. hide applicabletradetax, linetotalamount, paymentreference etc in Minimum profile
- due date and delivery date no longer mandatory for credit notes
- invoiceimporter to parse BuyerReference - invoiceimporter to parse BuyerReference
- support LineThree in TradeParty (BT-165?) - support LineThree in TradeParty (BT-165?)
- Corrected forgotten --d CLI shortcut - Corrected forgotten --d CLI shortcut
@@ -8,9 +12,6 @@
- automated server tests - automated server tests
- prevent nullpointerexception https://github.com/ZUGFeRD/mustangproject/pull/302 thanks to weclapp-dev - prevent nullpointerexception https://github.com/ZUGFeRD/mustangproject/pull/302 thanks to weclapp-dev
- lines no longer included in basic-wl and minimum - lines no longer included in basic-wl and minimum
- due date and delivery date no longer mandatory for credit notes
- Allow foreign limited addresses, e.g. allow Parties withpout postal addresses/postcodes
- Allow invoices in minimum profile e.g. dont use applicabletradetax, linetotalamount, paymentreference etc in Minimum profile
2.5.7 2.5.7
======= =======

View File

@@ -51,21 +51,23 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
try (InputStream SOURCE_PDF = this.getClass() try (InputStream SOURCE_PDF = this.getClass()
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf"); .getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("Minimum").load(SOURCE_PDF)) { IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("Minimum").load(SOURCE_PDF)) {
//https://stackoverflow.com/questions/72450066/creating-a-min-basic-and-basic-wl-factur-x-using-mustang /***
* this is a classical example of a french invoice (very low profile, siret number) and an attempt to answer stackoverflow (!)
* https://stackoverflow.com/questions/72450066/creating-a-min-basic-and-basic-wl-factur-x-using-mustang
*/
TradeParty recipient = new TradeParty().setName("Client").setCountry("FR");
String siret="0815";
String sirenTypeCode="0002";
recipient.setLegalOrganisation(new LegalOrganisation(siret,sirenTypeCode));
Invoice i = new Invoice() Invoice i = new Invoice()
.setIssueDate(new Date()) .setIssueDate(new Date())
/* .setDueDate(new Date())
.setDetailedDeliveryPeriod(new Date(), new Date())
.setDeliveryDate(new Date())*/
.setSender( .setSender(
new TradeParty().setName(ownOrgName).setCountry("FR") new TradeParty().setName(ownOrgName).setCountry("FR")
.addBankDetails(new BankDetails(ownIBAN, ownBIC))) .addBankDetails(new BankDetails(ownIBAN, ownBIC)))
.setRecipient( .setRecipient(recipient)
new TradeParty().setName("Client").setCountry("FR"))
.setNumber(ownNumber) .setNumber(ownNumber)
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1))) .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)))
.setCreditNote(); .setCreditNote();
ze.setTransaction(i); ze.setTransaction(i);
ze.export(TARGET_PDF_FX_MINIMUM); ze.export(TARGET_PDF_FX_MINIMUM);
@@ -76,17 +78,17 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
// assertFalse(pdfContent.indexOf("urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#") == -1); // assertFalse(pdfContent.indexOf("urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#") == -1);
} catch (IOException e) { } catch (IOException e) {
fail("IOException should not happen in testZExport"); fail("IOException should not happen in testMinimumExport");
} }
// now check the contents (like MustangReaderTest) // now check the contents (like MustangReaderTest)
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF_FX_MINIMUM); ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF_FX_MINIMUM);
// Reading ZUGFeRD // Reading ZUGFeRD
assertEquals(zi.getAmount(), "439.11"); assertEquals("146.37",zi.getAmount());
// assertEquals(zi.getBIC(), ownBIC); // assertEquals(zi.getBIC(), ownBIC);
// assertEquals(zi.getIBAN(), ownIBAN); // assertEquals(zi.getIBAN(), ownIBAN);
assertEquals(zi.getHolder(), ownOrgName); assertEquals(ownOrgName, zi.getHolder());
// assertEquals(zi.getForeignReference(), ownNumber); // assertEquals(zi.getForeignReference(), ownNumber);