-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ZUGFeRD:master' into position-allowance
- Loading branch information
Showing
16 changed files
with
163 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,9 +61,9 @@ public class ZF2PushTest extends TestCase { | |
final String TARGET_REVERSECHARGEPDF = "./target/testout-ZF2PushReverseCharge.pdf"; | ||
|
||
public void testPushExport() { | ||
/*** | ||
* This writes to a filename like an official sample, please consider when changing (probably better not?) | ||
*/ | ||
/*** | ||
* This writes to a filename like an official sample, please consider when changing (probably better not?) | ||
*/ | ||
// the writing part | ||
String orgname = "Bei Spiel GmbH"; | ||
String number = "RE-20201121/508"; | ||
|
@@ -96,8 +96,8 @@ public void testPushExport() { | |
fail("Exception should not be raised"); | ||
} | ||
|
||
ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF); | ||
Invoice i=new Invoice(); | ||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_PDF); | ||
Invoice i = new Invoice(); | ||
try { | ||
zii.extractInto(i); | ||
} catch (XPathExpressionException e) { | ||
|
@@ -164,15 +164,15 @@ public void testAttachmentsExport() { | |
fail("IOException should not be raised"); | ||
} | ||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_ATTACHMENTSPDF); | ||
Invoice i= null; | ||
Invoice i = null; | ||
try { | ||
i = zii.extractInvoice(); | ||
} catch (XPathExpressionException e) { | ||
throw new RuntimeException(e); | ||
} catch (ParseException e) { | ||
throw new RuntimeException(e); | ||
} | ||
assertEquals(senderDescription,i.getSender().getDescription()); | ||
assertEquals(senderDescription, i.getSender().getDescription()); | ||
|
||
// now check the contents (like MustangReaderTest) | ||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ATTACHMENTSPDF); | ||
|
@@ -302,7 +302,7 @@ public void testIntraCommunitySupplyItemExport() { | |
// .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50))))); | ||
|
||
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()) | ||
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addVATID("DE0815").addTaxID ("4711")) | ||
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addVATID("DE0815").addTaxID("4711")) | ||
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE0816") | ||
.setContact(new Contact("contact testname", "123456", "[email protected]").setFax("0911623562"))) | ||
.setDeliveryAddress(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE0816")) | ||
|
@@ -372,7 +372,7 @@ public void testIntraCommunitySupplyManualExport() { | |
fail("IOException should not be raised"); | ||
} | ||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_INTRACOMMUNITYSUPPLYMANUALPDF); | ||
Invoice i= null; | ||
Invoice i = null; | ||
try { | ||
i = zii.extractInvoice(); | ||
} catch (XPathExpressionException e) { | ||
|
@@ -530,7 +530,7 @@ public void testPushEdge() { | |
.setContractReferencedDocument(contractID) | ||
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addGlobalID(gln).setEmail("[email protected]").addVATID("DE4711") | ||
.setContact(new Contact("Franz Müller", "01779999999", "[email protected]", "teststr. 12", "55232", "Entenhausen", "DE").setFax("++49555123456")).setAdditionalAddress("Hinterhaus 3")) | ||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(16)).addGlobalID(gtin).setSellerAssignedID("4711"), price, new BigDecimal(1.0)).addReferencedLineID("xxx").addNote("item level 1/1").addAllowance(new Allowance(new BigDecimal(0.02)).setReason("item discount").setTaxPercent(new BigDecimal(16))).setDetailedDeliveryPeriod(sdf.parse("2020-01-13"), sdf.parse("2020-01-15"))) | ||
.addItem(new Item(new Product("Testprodukt", "", "H87", new BigDecimal(16)).addGlobalID(gtin).setSellerAssignedID("4711"), price, new BigDecimal(1.0)).setId("a123").addReferencedLineID("xxx").addNote("item level 1/1").addAllowance(new Allowance(new BigDecimal(0.02)).setReason("item discount").setTaxPercent(new BigDecimal(16))).setDetailedDeliveryPeriod(sdf.parse("2020-01-13"), sdf.parse("2020-01-15"))) | ||
.addCharge(new Charge(new BigDecimal(0.5)).setReason("quick delivery charge").setTaxPercent(new BigDecimal(16))) | ||
.addAllowance(new Allowance(new BigDecimal(0.2)).setReason("discount").setTaxPercent(new BigDecimal(16))) | ||
.addCashDiscount(new CashDiscount(new BigDecimal(2), 14)) | ||
|
@@ -562,7 +562,7 @@ public void testPushEdge() { | |
assertTrue(zi.getUTF8().contains(occurrenceFrom)); | ||
assertTrue(zi.getUTF8().contains(occurrenceTo)); | ||
assertTrue(zi.getUTF8().contains(contractID)); | ||
|
||
assertEquals(zi.importedInvoice.getZFItems()[0].getId(), "a123"); | ||
assertTrue(zi.getUTF8().contains("20200113")); // to contain item delivery periods | ||
assertTrue(zi.getUTF8().contains("20200115")); // to contain item delivery periods | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.