Merge branch 'master' into issues/503-ubl
This commit is contained in:
@@ -700,7 +700,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCountry() {
|
public String getCountry() {
|
||||||
return taxScheme;
|
return country;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@@ -709,7 +709,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
* @return fluent setter
|
* @return fluent setter
|
||||||
*/
|
*/
|
||||||
public TradeParty setCountry(String country) {
|
public TradeParty setCountry(String country) {
|
||||||
this.taxScheme = country;
|
this.country = country;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -351,10 +351,6 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void testImportMinimum() {
|
public void testImportMinimum() {
|
||||||
File CIIinputFile = getResourceAsFile("cii/facturFrMinimum.xml");
|
File CIIinputFile = getResourceAsFile("cii/facturFrMinimum.xml");
|
||||||
try {
|
try {
|
||||||
@@ -375,59 +371,5 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
this would test if for all elements/attributes
|
|
||||||
*/
|
|
||||||
|
|
||||||
public void testEEISI_300_cii_Import() throws XPathExpressionException, ParseException {
|
|
||||||
boolean hasExceptions = false;
|
|
||||||
File inputCII = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.cii.xml");
|
|
||||||
File inputUBL = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel.ubl.xml");
|
|
||||||
|
|
||||||
|
|
||||||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter();
|
|
||||||
try {
|
|
||||||
zii.fromXML(new String(Files.readAllBytes(inputCII.toPath()), StandardCharsets.UTF_8));
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
hasExceptions = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Invoice invoiceUBL = null;
|
|
||||||
invoiceUBL = zii.extractInvoice();
|
|
||||||
|
|
||||||
try {
|
|
||||||
zii.fromXML(new String(Files.readAllBytes(inputUBL.toPath()), StandardCharsets.UTF_8));
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
|
||||||
hasExceptions = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Invoice invoiceCII = null;
|
|
||||||
try {
|
|
||||||
invoiceCII = zii.extractInvoice();
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
|
||||||
String ubl=mapper.writeValueAsString(invoiceUBL).replace("," ,"\n");
|
|
||||||
String cii=mapper.writeValueAsString(invoiceCII).replace("," ,"\n");
|
|
||||||
|
|
||||||
assertEquals(cii,ubl);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
<cbc:Name>Seller contact point</cbc:Name>
|
|
||||||
<cbc:Telephone>+41 345 654455</cbc:Telephone>
|
|
||||||
<cbc:ElectronicMail>seller@contact.de);*/
|
|
||||||
} catch (XPathExpressionException | ParseException e) {
|
|
||||||
hasExceptions = true;
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
assertFalse(hasExceptions);
|
|
||||||
|
|
||||||
// TransactionCalculator tc = new TransactionCalculator(invoiceCII);
|
|
||||||
// assertEquals(new BigDecimal("205.00"), tc.getGrandTotal());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,10 +224,10 @@ public class ZUGFeRDValidatorTest extends ResourceCase {
|
|||||||
|
|
||||||
assertThat(res).valueByXPath("count(//error)")
|
assertThat(res).valueByXPath("count(//error)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(3);
|
.isEqualTo(1);
|
||||||
assertThat(res).valueByXPath("count(//warning)")
|
assertThat(res).valueByXPath("count(//warning)")
|
||||||
.asInt()
|
.asInt()
|
||||||
.isEqualTo(1);
|
.isEqualTo(3);
|
||||||
|
|
||||||
assertThat(res).valueByXPath("count(//notice)")
|
assertThat(res).valueByXPath("count(//notice)")
|
||||||
.asInt()
|
.asInt()
|
||||||
|
|||||||
Reference in New Issue
Block a user