Added getInvoiceCurrencyCode() to ZUGFeRDImporter.java

Added Test
This commit is contained in:
Alexander Berndt
2020-06-18 10:29:10 +02:00
parent 77a660b737
commit a4be1da6c6
2 changed files with 18 additions and 0 deletions

View File

@@ -274,6 +274,22 @@ public class ZUGFeRDImporter {
return "";
}
/**
* @return the Invoice Currency Code
*/
public String getInvoiceCurrencyCode() {
try {
if (getVersion() == 1) {
return extractString("//ApplicableSupplyChainTradeSettlement//InvoiceCurrencyCode");
} else {
return extractString("//ApplicableHeaderTradeSettlement//InvoiceCurrencyCode");
}
} catch (Exception e) {
e.printStackTrace();
return "";
}
}
/**
* @return the Invoice ID
*/

View File

@@ -209,6 +209,8 @@ public class ZF2Test extends MustangReaderTestCase {
assertEquals(zi.getAmount(), "571.04");
assertEquals(zi.getInvoiceID(), "RE-20170509/505");
assertEquals(zi.getZUGFeRDProfil(), "COMFORT");
assertEquals(zi.getInvoiceCurrencyCode(), "EUR");
assertEquals(zi.getHolder(), getOwnOrganisationName());
assertEquals(zi.getDocumentCode(),"380");
assertEquals(zi.getReference(),"AB321");