additional minimum test, require toolchains.xml only for release, not for any build
This commit is contained in:
@@ -41,7 +41,7 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
|
||||
|
||||
final String TARGET_PDF_FX_MINIMUM = "./target/testout-Minimum.pdf";
|
||||
|
||||
public void testMinimumExport() {
|
||||
public void testMinimumCreditNote() {
|
||||
String ownNumber = "NUMFACTURE";
|
||||
String ownBIC = "COBADEFFXXX";
|
||||
String ownIBAN = "DE88200800000970375700";
|
||||
@@ -95,4 +95,58 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
|
||||
}
|
||||
|
||||
|
||||
public void testMinimumInvoice() {
|
||||
String ownNumber = "NUMFACTURE";
|
||||
String ownBIC = "COBADEFFXXX";
|
||||
String ownIBAN = "DE88200800000970375700";
|
||||
String ownOrgName = "ME";
|
||||
|
||||
// the writing part
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("Minimum").load(SOURCE_PDF)) {
|
||||
/***
|
||||
* 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()
|
||||
.setIssueDate(new Date())
|
||||
.setDueDate(new Date())
|
||||
.setSender(
|
||||
new TradeParty().setName(ownOrgName).setCountry("FR")
|
||||
.addBankDetails(new BankDetails(ownIBAN)))
|
||||
.setRecipient(recipient)
|
||||
.setNumber(ownNumber).setTotalPrepaidAmount(new BigDecimal("1"))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)));
|
||||
ze.setTransaction(i);
|
||||
ze.export(TARGET_PDF_FX_MINIMUM);
|
||||
|
||||
// check for pdf-a schema extension
|
||||
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||
// assertFalse(pdfContent.indexOf("<pdfaSchema:prefix>zf</pdfaSchema:prefix>") == -1);
|
||||
// assertFalse(pdfContent.indexOf("urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#") == -1);
|
||||
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen in testMinimumExport");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF_FX_MINIMUM);
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("145.37",zi.getAmount());
|
||||
// assertEquals(zi.getBIC(), ownBIC);
|
||||
// assertEquals(zi.getIBAN(), ownIBAN);
|
||||
assertEquals(ownOrgName, zi.getHolder());
|
||||
// assertEquals(zi.getForeignReference(), ownNumber);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user