Added getInvoiceID() to ZUGFeRDImporter.java
Added Test
This commit is contained in:
@@ -252,6 +252,22 @@ public class ZUGFeRDImporter {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Invoice ID
|
||||
*/
|
||||
public String getInvoiceID() {
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//HeaderExchangedDocument//ID");
|
||||
} else {
|
||||
return extractString("//ExchangedDocument//ID");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the document code
|
||||
|
||||
@@ -207,6 +207,7 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getInvoiceID(), "RE-20170509/505");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getDocumentCode(),"380");
|
||||
assertEquals(zi.getReference(),"AB321");
|
||||
|
||||
Reference in New Issue
Block a user