Updated ZUGFeRDImporter.java -> getReference() to fit ZUGFeRD 1.0

Added Test
This commit is contained in:
Alexander Berndt
2020-05-22 15:25:18 +02:00
parent 0cde732e43
commit 566ead3c67
2 changed files with 11 additions and 1 deletions

View File

@@ -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 "";
}
}