tests pass again
This commit is contained in:
@@ -29,7 +29,9 @@ switch
|
|||||||
- validate as library doc
|
- validate as library doc
|
||||||
- unify loggers
|
- unify loggers
|
||||||
- release notes
|
- release notes
|
||||||
- new tradeparty class, switch recipient, shipping address from contact to tradeparty
|
- new tradeparty class, Contact getOwnContact superseded by TradeParty getSender
|
||||||
|
- switch recipient, shipping address from contact to tradeparty
|
||||||
|
- new invoicecorrection class
|
||||||
|
|
||||||
### 2.0 still todo
|
### 2.0 still todo
|
||||||
- verapdf as prevalidation?
|
- verapdf as prevalidation?
|
||||||
|
|||||||
@@ -195,7 +195,11 @@ public interface IExportableTransaction {
|
|||||||
* @return the sender's organisation name
|
* @return the sender's organisation name
|
||||||
*/
|
*/
|
||||||
default String getOwnOrganisationName() {
|
default String getOwnOrganisationName() {
|
||||||
return null;
|
if (getSender()!=null) {
|
||||||
|
return getSender().getName();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +209,11 @@ public interface IExportableTransaction {
|
|||||||
* @return sender street address
|
* @return sender street address
|
||||||
*/
|
*/
|
||||||
default String getOwnStreet() {
|
default String getOwnStreet() {
|
||||||
return null;
|
if (getSender()!=null) {
|
||||||
|
return getSender().getStreet();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -215,7 +223,12 @@ public interface IExportableTransaction {
|
|||||||
* @return sender postal code
|
* @return sender postal code
|
||||||
*/
|
*/
|
||||||
default String getOwnZIP() {
|
default String getOwnZIP() {
|
||||||
return null;
|
if (getSender()!=null) {
|
||||||
|
return getSender().getZIP();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -225,7 +238,12 @@ public interface IExportableTransaction {
|
|||||||
* @return the invoice sender's city
|
* @return the invoice sender's city
|
||||||
*/
|
*/
|
||||||
default String getOwnLocation() {
|
default String getOwnLocation() {
|
||||||
return null;
|
if (getSender()!=null) {
|
||||||
|
return getSender().getLocation();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -235,7 +253,12 @@ public interface IExportableTransaction {
|
|||||||
* @return the invoice senders two character country iso code
|
* @return the invoice senders two character country iso code
|
||||||
*/
|
*/
|
||||||
default String getOwnCountry() {
|
default String getOwnCountry() {
|
||||||
return null;
|
if (getSender()!=null) {
|
||||||
|
return getSender().getCountry();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IProfileProvider {
|
|||||||
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(trans.getSender().getGlobalIDScheme()) + "\">"
|
xml = xml + " <ram:GlobalID schemeID=\"" + XMLTools.encodeXML(trans.getSender().getGlobalIDScheme()) + "\">"
|
||||||
+ XMLTools.encodeXML(trans.getSender().getGlobalID()) + "</ram:GlobalID>\n";
|
+ XMLTools.encodeXML(trans.getSender().getGlobalID()) + "</ram:GlobalID>\n";
|
||||||
}
|
}
|
||||||
xml = xml + " <ram:Name>" + XMLTools.encodeXML(trans.getOwnOrganisationName()) + "</ram:Name>\n"; //$NON-NLS-2$
|
xml = xml + " <ram:Name>" + XMLTools.encodeXML(trans.getSender().getName()) + "</ram:Name>\n"; //$NON-NLS-2$
|
||||||
|
|
||||||
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
|
if ((trans.getOwnVATID()!=null)&&(trans.getOwnOrganisationName()!=null)) {
|
||||||
|
|
||||||
|
|||||||
@@ -302,12 +302,17 @@ public class BackwardCompatibilityTest extends TestCase implements IExportableTr
|
|||||||
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
|
return new GregorianCalendar(2019, Calendar.JUNE, 10).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableTradeParty getRecipient() {
|
public IZUGFeRDExportableTradeParty getRecipient() {
|
||||||
return new TradeParty("name","street","zip","city","DE");
|
return new TradeParty("name","street","zip","city","DE");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IZUGFeRDExportableTradeParty getSender() {
|
||||||
|
return new TradeParty("Bei Spiel GmbH","street","zip","city","DE");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public abstract class MustangReaderTestCase extends TestCase implements IExporta
|
|||||||
return "88802";
|
return "88802";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class SenderContact implements IZUGFeRDExportableContact {
|
protected class SenderContact implements IZUGFeRDExportableContact {
|
||||||
|
|
||||||
|
|
||||||
@@ -108,6 +108,36 @@ public abstract class MustangReaderTestCase extends TestCase implements IExporta
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected class SenderTradeParty implements IZUGFeRDExportableTradeParty {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return "Bei Spiel GmbH";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getZIP() {
|
||||||
|
return "55232";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getCountry() {
|
||||||
|
return "DE";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getLocation() {
|
||||||
|
return "Stadthausen";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getStreet() {
|
||||||
|
return "Ecke 12";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected class Item implements IZUGFeRDExportableItem {
|
protected class Item implements IZUGFeRDExportableItem {
|
||||||
|
|
||||||
public Item(BigDecimal price, BigDecimal quantity, IZUGFeRDExportableProduct product) {
|
public Item(BigDecimal price, BigDecimal quantity, IZUGFeRDExportableProduct product) {
|
||||||
|
|||||||
@@ -76,8 +76,8 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableContact getOwnContact() {
|
public IZUGFeRDExportableTradeParty getSender() {
|
||||||
return new SenderContact();
|
return new SenderTradeParty();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,8 +105,8 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableContact getOwnContact() {
|
public IZUGFeRDExportableTradeParty getSender() {
|
||||||
return new SenderContact();
|
return new SenderTradeParty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -459,11 +459,11 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
|||||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
|
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
|
||||||
|
|
||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
assertEquals(zi.getAmount(), "571.04");
|
assertEquals("571.04", zi.getAmount());
|
||||||
assertEquals(zi.getBIC(), getTradeSettlementPayment()[0].getOwnBIC());
|
assertEquals(getTradeSettlementPayment()[0].getOwnBIC(), zi.getBIC());
|
||||||
assertEquals(zi.getIBAN(), getTradeSettlementPayment()[0].getOwnIBAN());
|
assertEquals(getTradeSettlementPayment()[0].getOwnIBAN(), zi.getIBAN());
|
||||||
assertEquals(zi.getHolder(), getOwnOrganisationName());
|
assertEquals(getOwnOrganisationName(), zi.getHolder());
|
||||||
assertEquals(zi.getForeignReference(), getNumber());
|
assertEquals(getNumber(), zi.getForeignReference());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExceptionOnPDF14() {
|
public void testExceptionOnPDF14() {
|
||||||
|
|||||||
@@ -153,8 +153,8 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTra
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableContact getOwnContact() {
|
public IZUGFeRDExportableTradeParty getSender() {
|
||||||
return new SenderContact();
|
return new SenderTradeParty();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,28 +59,8 @@ public class ZF2Test extends MustangReaderTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOwnCountry() {
|
public IZUGFeRDExportableTradeParty getSender() {
|
||||||
return "DE";
|
return new SenderTradeParty();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getOwnLocation() {
|
|
||||||
return "Stadthausen";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getOwnOrganisationName() {
|
|
||||||
return "Bei Spiel GmbH";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getOwnStreet() {
|
|
||||||
return "Ecke 12";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IZUGFeRDExportableContact getOwnContact() {
|
|
||||||
return new SenderContact();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user