Updated ZUGFeRDImporter.java -> getReference() to fit ZUGFeRD 1.0
Added Test
This commit is contained in:
@@ -276,7 +276,16 @@ public class ZUGFeRDImporter {
|
||||
* @return the referred document
|
||||
*/
|
||||
public String getReference() {
|
||||
return extractString("//ApplicableHeaderTradeAgreement/BuyerReference");
|
||||
try {
|
||||
if (getVersion() == 1) {
|
||||
return extractString("//ApplicableSupplyChainTradeAgreement/BuyerReference");
|
||||
} else {
|
||||
return extractString("//ApplicableHeaderTradeAgreement/BuyerReference");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
||||
assertEquals(zi.getDocumentCode(),"380");
|
||||
assertEquals(zi.getReference(),"AB321");
|
||||
assertEquals(zi.getAmount(), "571.04");
|
||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
||||
assertEquals(zi.getIBAN(),getTradeSettlementPayment()[0].getOwnIBAN());
|
||||
|
||||
Reference in New Issue
Block a user