Merge branch 'master' into issue-830
This commit is contained in:
@@ -54,9 +54,9 @@ public class CalculationTest extends ResourceCase {
|
||||
|
||||
final LineCalculator calculator = new LineCalculator(currentItem);
|
||||
|
||||
assertEquals(valueOf(133.857).stripTrailingZeros(), calculator.getPrice().stripTrailingZeros());
|
||||
assertEquals(valueOf(1606.28).stripTrailingZeros(), calculator.getItemTotalNetAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(257.0048).stripTrailingZeros(), calculator.getItemTotalVATAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(148.73).stripTrailingZeros(), calculator.getPrice().stripTrailingZeros());
|
||||
assertEquals(valueOf(1769.89).stripTrailingZeros(), calculator.getItemTotalNetAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(283.1824).stripTrailingZeros(), calculator.getItemTotalVATAmount().stripTrailingZeros());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -74,17 +74,20 @@ public class CalculationTest extends ResourceCase {
|
||||
|
||||
final LineCalculator calculator = new LineCalculator(currentItem);
|
||||
|
||||
assertEquals(valueOf(163.603).stripTrailingZeros(), calculator.getPrice().stripTrailingZeros());
|
||||
assertEquals(valueOf(1963.24).stripTrailingZeros(), calculator.getItemTotalNetAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(314.1184).stripTrailingZeros(), calculator.getItemTotalVATAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(148.73).stripTrailingZeros(), calculator.getPrice().stripTrailingZeros());
|
||||
assertEquals(valueOf(1799.63).stripTrailingZeros(), calculator.getItemTotalNetAmount().stripTrailingZeros());
|
||||
assertEquals(valueOf(287.9408).stripTrailingZeros(), calculator.getItemTotalVATAmount().stripTrailingZeros());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLineCalculatorForeignCurrencyExample() {
|
||||
|
||||
/*
|
||||
/*** xml of official fx sample with allowances and charges
|
||||
* 10x100 with 10% and 50€ item discount =850€
|
||||
* +8,75 charges on document level=858,75, +19%VAT=1021,91
|
||||
* prepaid 500->due payable=521,91
|
||||
*/
|
||||
File inputCII = getResourceAsFile("Extended_fremdwaehrung.xml");
|
||||
inputCII=new File("C:\\Users\\jstaerk\\workspace\\XMLExamples\\zfdiverses\\20250407\\fremdwaehrung.xml");
|
||||
|
||||
ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter();
|
||||
Invoice invoice=null;
|
||||
zii.doIgnoreCalculationErrors();
|
||||
@@ -104,9 +107,9 @@ inputCII=new File("C:\\Users\\jstaerk\\workspace\\XMLExamples\\zfdiverses\\20250
|
||||
|
||||
final TransactionCalculator calculator = new TransactionCalculator(invoice);
|
||||
|
||||
assertEquals(valueOf(521.91).stripTrailingZeros(), calculator.getGrandTotal().stripTrailingZeros());
|
||||
assertEquals(valueOf(521.91).stripTrailingZeros(), calculator.getDuePayable().stripTrailingZeros());
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -221,9 +224,94 @@ inputCII=new File("C:\\Users\\jstaerk\\workspace\\XMLExamples\\zfdiverses\\20250
|
||||
invoice.addAllowance(new Allowance().setPercent(total_discount_percent).setTaxPercent(sales_tax_percent1).setReasonCode("95").setReason("Rabatte"));
|
||||
}
|
||||
TransactionCalculator calculator = new TransactionCalculator(invoice);
|
||||
assertEquals(valueOf(101.86).stripTrailingZeros(), calculator.getGrandTotal().stripTrailingZeros());
|
||||
assertEquals(valueOf(307.18).stripTrailingZeros(), calculator.getGrandTotal().stripTrailingZeros());
|
||||
}
|
||||
|
||||
public void testSimpleItemPercentAllowance() {
|
||||
/***
|
||||
* a product with net 1.10 and qty 5 and relative item allowance of 10% should return 5 as line and grand total
|
||||
*/
|
||||
SimpleDateFormat sqlDate = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Invoice invoice = new Invoice();
|
||||
invoice.setDocumentName("Rechnung");
|
||||
invoice.setNumber("777777");
|
||||
try {
|
||||
invoice.setIssueDate(sqlDate.parse("2020-12-31"));
|
||||
invoice.setDetailedDeliveryPeriod(sqlDate.parse("2020-12-01 - 2020-12-31".split(" - ")[0]), sqlDate.parse("2020-12-01 - 2020-12-31".split(" - ")[1]));
|
||||
invoice.setDeliveryDate(sqlDate.parse("2020-12-31"));
|
||||
invoice.setDueDate(sqlDate.parse("2021-01-15"));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to set dates", e);
|
||||
|
||||
}
|
||||
TradeParty sender = new TradeParty("Maier GmbH", "Musterweg 5", "11111", "Testung", "DE");
|
||||
sender.addVATID("DE2222222222");
|
||||
invoice.setSender(sender);
|
||||
|
||||
/* trade party (recipient) */
|
||||
TradeParty recipient = new TradeParty("Teston GmbH" + " " + "Zentrale" + " " + "", "Testweg 5", "11111", "Testung", "DE");
|
||||
recipient.setID("111111");
|
||||
recipient.addVATID("DE111111111");
|
||||
invoice.setRecipient(recipient);
|
||||
|
||||
/* item */
|
||||
Product product;
|
||||
Item item;
|
||||
|
||||
product = new Product("AAA", "", "H84", BigDecimal.ZERO);
|
||||
item = new Item(product, new BigDecimal("1.10"), new BigDecimal(5.00));
|
||||
|
||||
item.addAllowance(new Allowance().setPercent(new BigDecimal(10)).setTaxPercent(BigDecimal.ZERO));
|
||||
invoice.addItem(item);
|
||||
|
||||
TransactionCalculator calculator = new TransactionCalculator(invoice);
|
||||
assertEquals(new BigDecimal(5), calculator.getGrandTotal().stripTrailingZeros());
|
||||
}
|
||||
|
||||
public void testSimpleItemTotalAllowance() {
|
||||
/***
|
||||
* a product with net 1 and qty 5 and absolute _item_ allowance of 1 should return 4 as line total, and grand total
|
||||
*/
|
||||
SimpleDateFormat sqlDate = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Invoice invoice = new Invoice();
|
||||
invoice.setDocumentName("Rechnung");
|
||||
invoice.setNumber("777777");
|
||||
try {
|
||||
invoice.setIssueDate(sqlDate.parse("2020-12-31"));
|
||||
invoice.setDetailedDeliveryPeriod(sqlDate.parse("2020-12-01 - 2020-12-31".split(" - ")[0]), sqlDate.parse("2020-12-01 - 2020-12-31".split(" - ")[1]));
|
||||
invoice.setDeliveryDate(sqlDate.parse("2020-12-31"));
|
||||
invoice.setDueDate(sqlDate.parse("2021-01-15"));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Failed to set dates", e);
|
||||
|
||||
}
|
||||
TradeParty sender = new TradeParty("Maier GmbH", "Musterweg 5", "11111", "Testung", "DE");
|
||||
sender.addVATID("DE2222222222");
|
||||
invoice.setSender(sender);
|
||||
|
||||
/* trade party (recipient) */
|
||||
TradeParty recipient = new TradeParty("Teston GmbH" + " " + "Zentrale" + " " + "", "Testweg 5", "11111", "Testung", "DE");
|
||||
recipient.setID("111111");
|
||||
recipient.addVATID("DE111111111");
|
||||
invoice.setRecipient(recipient);
|
||||
|
||||
/* item */
|
||||
Product product;
|
||||
Item item;
|
||||
|
||||
product = new Product("AAA", "", "H84", BigDecimal.ZERO);
|
||||
item = new Item(product, new BigDecimal("1.00"), new BigDecimal(5.00));
|
||||
|
||||
item.addAllowance(new Allowance(new BigDecimal(1)).setTaxPercent(BigDecimal.ZERO));
|
||||
invoice.addItem(item);
|
||||
|
||||
TransactionCalculator calculator = new TransactionCalculator(invoice);
|
||||
assertEquals(new BigDecimal(4), calculator.getGrandTotal().stripTrailingZeros());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* LineCalculator should not throw an exception when calculating a non-terminating decimal expansion
|
||||
* */
|
||||
|
||||
@@ -395,7 +395,7 @@ public class DeSerializationTest extends ResourceCase {
|
||||
try {
|
||||
Invoice newInvoiceFromJSON = mapper.readValue(json, Invoice.class);
|
||||
TransactionCalculator tc=new TransactionCalculator(newInvoiceFromJSON);
|
||||
assertEquals(new BigDecimal("19.52"),tc.getGrandTotal());
|
||||
assertEquals(new BigDecimal("18.92"),tc.getGrandTotal());
|
||||
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
@@ -32,6 +32,8 @@ import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class VisualizationTest extends ResourceCase {
|
||||
@@ -80,7 +82,7 @@ public class VisualizationTest extends ResourceCase {
|
||||
} catch (ParserConfigurationException e) {
|
||||
fail("ParserConfigurationException should not happen: " + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
assertNotNull(result);
|
||||
/* remove file endings so that tests can also pass after checking
|
||||
out from git with arbitrary options (which may include CSRF changes)
|
||||
@@ -94,6 +96,7 @@ public class VisualizationTest extends ResourceCase {
|
||||
.replace(" ", ""));
|
||||
}
|
||||
|
||||
|
||||
public void testPDFVisualizationCII() {
|
||||
|
||||
File CIIinputFile = getResourceAsFile("cii/01.01a-INVOICE.cii.xml");
|
||||
|
||||
@@ -34,6 +34,7 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.xpath.XPath;
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants;
|
||||
import javax.xml.xpath.XPathExpressionException;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
import java.io.BufferedWriter;
|
||||
@@ -61,8 +62,8 @@ public class XRTest extends TestCase {
|
||||
TradeParty recipient = new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE");
|
||||
recipient.setEmail("quack@ducktown.org");
|
||||
Invoice i = createInvoice(recipient);
|
||||
String legalOrgID="aCustomSellerLegalOrgId";
|
||||
String sellerID="aSellerTradePartyID";
|
||||
String legalOrgID = "aCustomSellerLegalOrgId";
|
||||
String sellerID = "aSellerTradePartyID";
|
||||
i.getSender().setLegalOrganisation(new LegalOrganisation(legalOrgID));
|
||||
i.getSender().setID(sellerID);
|
||||
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
|
||||
@@ -70,8 +71,8 @@ public class XRTest extends TestCase {
|
||||
zf2p.generateXML(i);
|
||||
String theXML = new String(zf2p.getXML(), StandardCharsets.UTF_8);
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
assertTrue(theXML.contains("<ram:ID>"+sellerID+"</ram:ID>"));// must be possible without scheme #
|
||||
assertTrue(theXML.contains("<ram:ID>"+legalOrgID+"</ram:ID>"));// must be possible without scheme #
|
||||
assertTrue(theXML.contains("<ram:ID>" + sellerID + "</ram:ID>"));// must be possible without scheme #
|
||||
assertTrue(theXML.contains("<ram:ID>" + legalOrgID + "</ram:ID>"));// must be possible without scheme #
|
||||
assertThat(theXML).valueByXPath("count(//*[local-name()='IncludedSupplyChainTradeLineItem'])")
|
||||
.asInt()
|
||||
.isEqualTo(1); //2 errors are OK because there is a known bug
|
||||
@@ -90,6 +91,7 @@ public class XRTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void testXREdgeExport() {
|
||||
|
||||
// the writing part
|
||||
@@ -109,7 +111,7 @@ public class XRTest extends TestCase {
|
||||
.setReferenceNumber("991-01484-64")//leitweg-id
|
||||
// not using any VAT, this is also a test of zero-rated goods:
|
||||
.setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", BigDecimal.ZERO).setTaxExemptionReason("Kleinunternehmer"), amount, new BigDecimal(1.0)))
|
||||
.setPayee( new TradeParty().setName("VR Factoring GmbH").setID("DE813838785").setLegalOrganisation(new LegalOrganisation("391200LDDFJDMIPPMZ54", "0199")))
|
||||
.setPayee(new TradeParty().setName("VR Factoring GmbH").setID("DE813838785").setLegalOrganisation(new LegalOrganisation("391200LDDFJDMIPPMZ54", "0199")))
|
||||
.embedFileInXML(fe1);
|
||||
|
||||
|
||||
@@ -149,9 +151,9 @@ public class XRTest extends TestCase {
|
||||
fail("ParseException not expected");
|
||||
} catch (IOException e) {
|
||||
fail("IOException not expected");
|
||||
}
|
||||
FileAttachment[] attachedFiles=readInvoice.getAdditionalReferencedDocuments();
|
||||
assertNotNull(attachedFiles);
|
||||
}
|
||||
FileAttachment[] attachedFiles = readInvoice.getAdditionalReferencedDocuments();
|
||||
assertNotNull(attachedFiles);
|
||||
assertEquals(attachedFiles.length, 1);
|
||||
|
||||
assertTrue(Arrays.equals(attachedFiles[0].getData(), b));
|
||||
@@ -289,6 +291,36 @@ public class XRTest extends TestCase {
|
||||
}
|
||||
|
||||
|
||||
public void testApplicablePercentInUntaxedService() {
|
||||
|
||||
// the writing part
|
||||
TradeParty recipient = new TradeParty("Franz Müller", null, "55232", "Entenhausen", "DE");
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
String amountStr = "1.00";
|
||||
BigDecimal amount = new BigDecimal(amountStr);
|
||||
var i = new Invoice().setDueDate(new java.util.Date()).setIssueDate(new java.util.Date()).setDeliveryDate(new java.util.Date())
|
||||
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addTaxID("DE4711").addVATID("DE0815").setEmail("info@example.org").setContact(new org.mustangproject.Contact("Hans Test", "+49123456789", "test@example.org")).addBankDetails(new org.mustangproject.BankDetails("DE12500105170648489890", "COBADEFXXX")))
|
||||
.setRecipient(recipient)
|
||||
.setReferenceNumber("991-01484-64")//leitweg-id
|
||||
// not using any VAT, this is also a test of zero-rated goods:
|
||||
.setNumber(number).addItem(new org.mustangproject.Item(new org.mustangproject.Product("Testprodukt", "", "C62", java.math.BigDecimal.ZERO).setTaxCategoryCode(TaxCategoryCodeTypeConstants.UNTAXEDSERVICE).setTaxExemptionReason("Expemtion reason"), amount, new java.math.BigDecimal(1.0)));
|
||||
|
||||
ZUGFeRD2PullProvider zf2p = new ZUGFeRD2PullProvider();
|
||||
zf2p.setProfile(Profiles.getByName("XRechnung"));
|
||||
zf2p.generateXML(i);
|
||||
String theXML = new String(zf2p.getXML(), StandardCharsets.UTF_8);
|
||||
// Untaxed services don't have the field RateApplicablePercent, since it would be always 0. An error is thrown on validation, if 0 is set.
|
||||
assertThat(theXML).valueByXPath("count(//*[local-name()='RateApplicablePercent'])")
|
||||
.asInt()
|
||||
.isEqualTo(0);
|
||||
|
||||
//Exemption reason needs to be set if TaxCategoryCode == "O", reason should be at the product and in the ApplicableTradeTax
|
||||
assertThat(theXML).valueByXPath("count(//*[local-name()='ExemptionReason'])")
|
||||
.asInt()
|
||||
.isEqualTo(2);
|
||||
}
|
||||
|
||||
private org.mustangproject.Invoice createInvoice(TradeParty recipient) {
|
||||
String orgname = "Test company";
|
||||
String number = "123";
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ZF2PushTest extends TestCase {
|
||||
|
||||
String senderDescription = "Kleinunternehmer";
|
||||
String taxID = "9990815";
|
||||
String theNote="oh lala";
|
||||
String theNote = "oh lala";
|
||||
BigDecimal price = new BigDecimal(priceStr);
|
||||
try {
|
||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
@@ -177,7 +177,7 @@ public class ZF2PushTest extends TestCase {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
assertEquals(i.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),theNote);
|
||||
assertEquals(i.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(), theNote);
|
||||
assertEquals(senderDescription, i.getSender().getDescription());
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
@@ -255,16 +255,16 @@ public class ZF2PushTest extends TestCase {
|
||||
// ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setSender(new TradeParty(orgname,"teststr", "55232","teststadt","DE")).setOwnTaxID("4711").setOwnVATID("DE0815").setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number)
|
||||
// .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50)))));
|
||||
|
||||
Invoice i=new Invoice().setDueDate(new Date()).setIssueDate(new Date())
|
||||
Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date())
|
||||
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addTaxID("4711").addVATID("DE0815"))
|
||||
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE")
|
||||
.setContact(new Contact("contact testname", "123456", "contact.testemail@example.org").setFax("0911623562")))
|
||||
.setNumber(number)
|
||||
.addCharge(new Charge(new BigDecimal(1)).setReasonCode("ABK").setReason("AReason").setTaxPercent(new BigDecimal(19)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance(new BigDecimal("0.1"))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance(new BigDecimal("0.1")).setReasonCode("95")))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50)).setReason("In love with salesperson")))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(2.0)).addCharge(new Charge(new BigDecimal(1)).setReasonCode("ABK").setReason("AnotherReason")))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addCharge(new Charge(new BigDecimal(1))).addAllowance(new Allowance(new BigDecimal("1"))));
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addCharge(new Charge(new BigDecimal(1)).setReasonCode("ABK").setReason("Yet another reason")).addAllowance(new Allowance(new BigDecimal("1")).setReason("Something completely strange")));
|
||||
ze.setTransaction(i);
|
||||
|
||||
|
||||
@@ -275,21 +275,20 @@ public class ZF2PushTest extends TestCase {
|
||||
fail("IOException should not be raised");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ITEMCHARGESALLOWANCESPDF);
|
||||
|
||||
assertEquals("EUR", zi.getInvoiceCurrencyCode());
|
||||
assertTrue(zi.getUTF8().contains("0911623562")); // fax number
|
||||
assertTrue(zi.getUTF8().contains("ABK"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("19.52", zi.getAmount());
|
||||
assertEquals(orgname, zi.getHolder());
|
||||
assertEquals(number, zi.getForeignReference());
|
||||
try {
|
||||
// now check the contents (like MustangReaderTest)
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ITEMCHARGESALLOWANCESPDF);
|
||||
assertEquals("EUR", zi.getInvoiceCurrencyCode());
|
||||
assertTrue(zi.getUTF8().contains("0911623562")); // fax number
|
||||
assertTrue(zi.getUTF8().contains("ABK"));
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("18.92", zi.getAmount());
|
||||
assertEquals(orgname, zi.getHolder());
|
||||
assertEquals(number, zi.getForeignReference());
|
||||
assertEquals(zi.getVersion(), 2);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fail("Exception should not be raised");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +594,7 @@ public class ZF2PushTest extends TestCase {
|
||||
assertEquals(1, i.getInvoiceReferencedDocuments().size());
|
||||
assertEquals("abcd1234", i.getInvoiceReferencedDocuments().get(0).getIssuerAssignedID());
|
||||
assertEquals("4304171000002", i.getRecipient().getGlobalID());
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMdd");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
assertEquals(occurrenceFrom, sdf.format(i.getDetailedDeliveryPeriodFrom()));
|
||||
assertEquals(occurrenceTo, sdf.format(i.getDetailedDeliveryPeriodTo()));
|
||||
assertEquals("2001015001325", i.getZFItems()[0].getProduct().getGlobalID());
|
||||
@@ -629,7 +628,7 @@ public class ZF2PushTest extends TestCase {
|
||||
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addTaxID("4711").addVATID("DE0815"))
|
||||
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE"))
|
||||
.setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(500.0), qty).addAllowance(new Allowance(new BigDecimal(300)).setTaxPercent(new BigDecimal(19))))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)).addAllowance(new Allowance(BigDecimal.ONE)), new BigDecimal(500.0), qty).addAllowance(new Allowance(new BigDecimal(300)).setTaxPercent(new BigDecimal(19))))
|
||||
.addAllowance(new Allowance(new BigDecimal(600)).setTaxPercent(new BigDecimal(19)))
|
||||
);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
@@ -645,7 +644,7 @@ public class ZF2PushTest extends TestCase {
|
||||
assertEquals("EUR", zi.getInvoiceCurrencyCode());
|
||||
|
||||
// Reading ZUGFeRD
|
||||
assertEquals("4046.00", zi.getAmount());
|
||||
assertEquals("10805.20", zi.getAmount());
|
||||
assertEquals(orgname, zi.getHolder());
|
||||
assertEquals(number, zi.getForeignReference());
|
||||
try {
|
||||
@@ -675,8 +674,8 @@ public class ZF2PushTest extends TestCase {
|
||||
.setNumber(number)
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, new BigDecimal(1.0)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, new BigDecimal(1.0)).addCharge(new Charge().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19))))
|
||||
.addAllowance(new Allowance().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19)))
|
||||
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), price, new BigDecimal(1.0)).addCharge(new Charge().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19)).setReasonCode("ABK")))
|
||||
.addAllowance(new Allowance().setPercent(new BigDecimal(50)).setTaxPercent(new BigDecimal(19)).setReason("Mengenrabatt"))
|
||||
);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
@@ -689,7 +688,7 @@ public class ZF2PushTest extends TestCase {
|
||||
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_RELATIVECHARGESALLOWANCESPDF);
|
||||
|
||||
assertEquals("CHF", zi.getInvoiceCurrencyCode());
|
||||
assertEquals("6.25", zi.getAmount());
|
||||
assertEquals("11.10", zi.getAmount());
|
||||
assertEquals(orgname, zi.getHolder());
|
||||
assertEquals(number, zi.getForeignReference());
|
||||
try {
|
||||
|
||||
@@ -34,12 +34,14 @@ import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -262,9 +264,27 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
||||
}
|
||||
assertFalse(hasExceptions);
|
||||
TransactionCalculator tc = new TransactionCalculator(invoice);
|
||||
assertEquals(new BigDecimal("19.52"), tc.getGrandTotal());
|
||||
assertEquals(new BigDecimal("18.92"), tc.getGrandTotal());
|
||||
}
|
||||
|
||||
public void testIBANImport() {
|
||||
File CIIinputFile = getResourceAsFile("cii/lastschrift_iban_bug.xml");
|
||||
try {
|
||||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
|
||||
|
||||
|
||||
CalculatedInvoice invoice = new CalculatedInvoice();
|
||||
zii.extractInto(invoice);
|
||||
assertEquals("DE11111111111111111111", invoice.getCreditorReferenceID());
|
||||
assertEquals("DE22222222222222222222", invoice.getSender().getBankDetails().stream().map(BankDetails::getIBAN).collect(Collectors.joining(",")));
|
||||
} catch (FileNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (XPathExpressionException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
public void testBasisQuantityImport() {
|
||||
|
||||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter("./target/testout-ZF2newEdge.pdf");
|
||||
|
||||
152
library/src/test/resources/cii/lastschrift_iban_bug.xml
Normal file
152
library/src/test/resources/cii/lastschrift_iban_bug.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:a="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:10" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<rsm:ExchangedDocumentContext>
|
||||
<ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
<ram:ID>urn:cen.eu:en16931:2017</ram:ID>
|
||||
</ram:GuidelineSpecifiedDocumentContextParameter>
|
||||
</rsm:ExchangedDocumentContext>
|
||||
<rsm:ExchangedDocument>
|
||||
<ram:ID>123456</ram:ID>
|
||||
<ram:TypeCode>380</ram:TypeCode>
|
||||
<ram:IssueDateTime>
|
||||
<udt:DateTimeString format="102">20250426</udt:DateTimeString>
|
||||
</ram:IssueDateTime>
|
||||
<ram:IncludedNote>
|
||||
<ram:Content>Jahresbeitrag</ram:Content>
|
||||
</ram:IncludedNote>
|
||||
</rsm:ExchangedDocument>
|
||||
<rsm:SupplyChainTradeTransaction>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>1</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Product: Plus</ram:Name>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount>239.00</ram:ChargeAmount>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="H87">1.00</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
<ram:LineTotalAmount>239.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:AssociatedDocumentLineDocument>
|
||||
<ram:LineID>1</ram:LineID>
|
||||
</ram:AssociatedDocumentLineDocument>
|
||||
<ram:SpecifiedTradeProduct>
|
||||
<ram:Name>Getting Started-Rabatt</ram:Name>
|
||||
</ram:SpecifiedTradeProduct>
|
||||
<ram:SpecifiedLineTradeAgreement>
|
||||
<ram:NetPriceProductTradePrice>
|
||||
<ram:ChargeAmount>120.00</ram:ChargeAmount>
|
||||
</ram:NetPriceProductTradePrice>
|
||||
</ram:SpecifiedLineTradeAgreement>
|
||||
<ram:SpecifiedLineTradeDelivery>
|
||||
<ram:BilledQuantity unitCode="H87">-1.00</ram:BilledQuantity>
|
||||
</ram:SpecifiedLineTradeDelivery>
|
||||
<ram:SpecifiedLineTradeSettlement>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
<ram:LineTotalAmount>-120.00</ram:LineTotalAmount>
|
||||
</ram:SpecifiedTradeSettlementLineMonetarySummation>
|
||||
</ram:SpecifiedLineTradeSettlement>
|
||||
</ram:IncludedSupplyChainTradeLineItem>
|
||||
<ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:BuyerReference>7777777</ram:BuyerReference>
|
||||
<ram:SellerTradeParty>
|
||||
<ram:Name>---</ram:Name>
|
||||
<ram:DefinedTradeContact>
|
||||
<ram:PersonName>---</ram:PersonName>
|
||||
<ram:DepartmentName>Geschäftsführer</ram:DepartmentName>
|
||||
<ram:TelephoneUniversalCommunication>
|
||||
<ram:CompleteNumber>---</ram:CompleteNumber>
|
||||
</ram:TelephoneUniversalCommunication>
|
||||
<ram:EmailURIUniversalCommunication>
|
||||
<ram:URIID>q@q.com</ram:URIID>
|
||||
</ram:EmailURIUniversalCommunication>
|
||||
</ram:DefinedTradeContact>
|
||||
<ram:PostalTradeAddress>
|
||||
<ram:PostcodeCode>12345</ram:PostcodeCode>
|
||||
<ram:LineOne>Str. 11</ram:LineOne>
|
||||
<ram:CityName>---</ram:CityName>
|
||||
<ram:CountryID>DE</ram:CountryID>
|
||||
</ram:PostalTradeAddress>
|
||||
<ram:URIUniversalCommunication>
|
||||
<ram:URIID schemeID="EM">a@a.com</ram:URIID>
|
||||
</ram:URIUniversalCommunication>
|
||||
<ram:SpecifiedTaxRegistration>
|
||||
<ram:ID schemeID="VA">DE111111111</ram:ID>
|
||||
</ram:SpecifiedTaxRegistration>
|
||||
</ram:SellerTradeParty>
|
||||
<ram:BuyerTradeParty>
|
||||
<ram:Name>a & b GmbH</ram:Name>
|
||||
<ram:PostalTradeAddress>
|
||||
<ram:PostcodeCode>123456</ram:PostcodeCode>
|
||||
<ram:LineOne>--</ram:LineOne>
|
||||
<ram:LineTwo>Str. 17</ram:LineTwo>
|
||||
<ram:CityName>--</ram:CityName>
|
||||
<ram:CountryID>DE</ram:CountryID>
|
||||
</ram:PostalTradeAddress>
|
||||
</ram:BuyerTradeParty>
|
||||
</ram:ApplicableHeaderTradeAgreement>
|
||||
<ram:ApplicableHeaderTradeDelivery/>
|
||||
<ram:ApplicableHeaderTradeSettlement>
|
||||
<ram:CreditorReferenceID>DE11111111111111111111</ram:CreditorReferenceID>
|
||||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
|
||||
<ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:TypeCode>59</ram:TypeCode>
|
||||
<ram:PayerPartyDebtorFinancialAccount>
|
||||
<ram:IBANID>DE22222222222222222222</ram:IBANID>
|
||||
</ram:PayerPartyDebtorFinancialAccount>
|
||||
</ram:SpecifiedTradeSettlementPaymentMeans>
|
||||
<ram:ApplicableTradeTax>
|
||||
<ram:CalculatedAmount>22.61</ram:CalculatedAmount>
|
||||
<ram:TypeCode>VAT</ram:TypeCode>
|
||||
<ram:BasisAmount>119.00</ram:BasisAmount>
|
||||
<ram:CategoryCode>S</ram:CategoryCode>
|
||||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent>
|
||||
</ram:ApplicableTradeTax>
|
||||
<ram:BillingSpecifiedPeriod>
|
||||
<ram:StartDateTime>
|
||||
<udt:DateTimeString format="102">20250426</udt:DateTimeString>
|
||||
</ram:StartDateTime>
|
||||
<ram:EndDateTime>
|
||||
<udt:DateTimeString format="102">20250525</udt:DateTimeString>
|
||||
</ram:EndDateTime>
|
||||
</ram:BillingSpecifiedPeriod>
|
||||
<ram:SpecifiedTradePaymentTerms>
|
||||
<ram:Description>Zahlbar sofort</ram:Description>
|
||||
<ram:DueDateDateTime>
|
||||
<udt:DateTimeString format="102">20250426</udt:DateTimeString>
|
||||
</ram:DueDateDateTime>
|
||||
</ram:SpecifiedTradePaymentTerms>
|
||||
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
<ram:LineTotalAmount>119.00</ram:LineTotalAmount>
|
||||
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount>
|
||||
<ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount>
|
||||
<ram:TaxBasisTotalAmount>119.00</ram:TaxBasisTotalAmount>
|
||||
<ram:TaxTotalAmount currencyID="EUR">22.61</ram:TaxTotalAmount>
|
||||
<ram:GrandTotalAmount>141.61</ram:GrandTotalAmount>
|
||||
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount>
|
||||
<ram:DuePayableAmount>141.61</ram:DuePayableAmount>
|
||||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
|
||||
</ram:ApplicableHeaderTradeSettlement>
|
||||
</rsm:SupplyChainTradeTransaction>
|
||||
</rsm:CrossIndustryInvoice>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1665,7 +1665,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Discount (net):</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Net list price:</div>
|
||||
@@ -1977,7 +1977,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Discount (net):</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Net list price:</div>
|
||||
@@ -2133,7 +2133,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Discount (net):</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Net list price:</div>
|
||||
@@ -2629,4 +2629,4 @@ function downloadData (element_id) {
|
||||
});
|
||||
//
|
||||
|
||||
</script></html>
|
||||
</script></html>
|
||||
@@ -1379,7 +1379,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Discount (net):</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Net list price:</div>
|
||||
@@ -1535,7 +1535,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Discount (net):</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Net list price:</div>
|
||||
@@ -1758,7 +1758,7 @@
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Process ID:</div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert"></div>
|
||||
<div id="BT-23" title="BT-23" class="boxdaten wert">urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende">Specification ID:</div>
|
||||
@@ -1948,4 +1948,4 @@ function downloadData (element_id) {
|
||||
});
|
||||
//
|
||||
|
||||
</script></html>
|
||||
</script></html>
|
||||
@@ -1395,7 +1395,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Remise nette:</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Prix catalogue (net):</div>
|
||||
@@ -1551,7 +1551,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Remise nette:</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Prix catalogue (net):</div>
|
||||
@@ -1707,7 +1707,7 @@
|
||||
<div class="boxtabelle boxinhalt noPaddingTop borderSpacing">
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Remise nette:</div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert"></div>
|
||||
<div id="BT-147" title="BT-147" class="boxdaten wert">0,00</div>
|
||||
</div>
|
||||
<div class="boxzeile">
|
||||
<div class="boxdaten legende ">Prix catalogue (net):</div>
|
||||
|
||||
@@ -1,174 +1,174 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>
|
||||
<cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID>
|
||||
<cbc:ID>RE-20201121/508</cbc:ID>
|
||||
<cbc:IssueDate>2020-11-21</cbc:IssueDate>
|
||||
<cbc:DueDate>2020-12-12</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference>AB321</cbc:BuyerReference>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Ecke 12</cbc:StreetName>
|
||||
<cbc:CityName>Stadthausen</cbc:CityName>
|
||||
<cbc:PostalZone>12345</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>DE136695976</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Bei Spiel GmbH</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Bahnstr. 42</cbc:StreetName>
|
||||
<cbc:CityName>Spielkreis</cbc:CityName>
|
||||
<cbc:PostalZone>88802</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Theodor Est</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:Delivery>
|
||||
<cbc:ActualDeliveryDate>2020-11-10</cbc:ActualDeliveryDate>
|
||||
</cac:Delivery>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode name="Bank transfer">42</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>RE-20201121/508</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>DE88200800000970375700</cbc:ID>
|
||||
<cbc:Name>Max Mustermann</cbc:Name>
|
||||
<cac:FinancialInstitutionBranch>
|
||||
<cbc:ID>COBADEFFXXX</cbc:ID>
|
||||
</cac:FinancialInstitutionBranch>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:Note>Zahlbar ohne Abzug bis 12.12.2020</cbc:Note>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">75.04</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">160</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">11.2</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>7</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">336</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">63.84</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">496</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">496</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">571.04</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="EUR">0</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="EUR">0</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="EUR">0</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">571.04</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="HUR">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">160</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Of a sample invoice</cbc:Description>
|
||||
<cbc:Name>Design (hours)</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>7</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">160</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="HUR">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">160</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cec="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
|
||||
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
|
||||
<cbc:ID>RE-20201121/508</cbc:ID>
|
||||
<cbc:IssueDate>2020-11-21</cbc:IssueDate>
|
||||
<cbc:DueDate>2020-12-12</cbc:DueDate>
|
||||
<cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>
|
||||
<cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>
|
||||
<cbc:BuyerReference>AB321</cbc:BuyerReference>
|
||||
<cac:AccountingSupplierParty>
|
||||
<cac:Party>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Ecke 12</cbc:StreetName>
|
||||
<cbc:CityName>Stadthausen</cbc:CityName>
|
||||
<cbc:PostalZone>12345</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyTaxScheme>
|
||||
<cbc:CompanyID>DE136695976</cbc:CompanyID>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:PartyTaxScheme>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Bei Spiel GmbH</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingSupplierParty>
|
||||
<cac:AccountingCustomerParty>
|
||||
<cac:Party>
|
||||
<cac:PartyIdentification>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="H87">400</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">316</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>various colors, ~2000ml</cbc:Description>
|
||||
<cbc:Name>Ballons</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">0.79</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="H87">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">0.79</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>3</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="LTR">800</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">20</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>Hot air „heiße Luft“ (litres)</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">0.025</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="LTR">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">0.025</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</cac:PartyIdentification>
|
||||
<cac:PostalAddress>
|
||||
<cbc:StreetName>Bahnstr. 42</cbc:StreetName>
|
||||
<cbc:CityName>Spielkreis</cbc:CityName>
|
||||
<cbc:PostalZone>88802</cbc:PostalZone>
|
||||
<cac:Country>
|
||||
<cbc:IdentificationCode>DE</cbc:IdentificationCode>
|
||||
</cac:Country>
|
||||
</cac:PostalAddress>
|
||||
<cac:PartyLegalEntity>
|
||||
<cbc:RegistrationName>Theodor Est</cbc:RegistrationName>
|
||||
</cac:PartyLegalEntity>
|
||||
</cac:Party>
|
||||
</cac:AccountingCustomerParty>
|
||||
<cac:Delivery>
|
||||
<cbc:ActualDeliveryDate>2020-11-10</cbc:ActualDeliveryDate>
|
||||
</cac:Delivery>
|
||||
<cac:PaymentMeans>
|
||||
<cbc:PaymentMeansCode name="Bank transfer">42</cbc:PaymentMeansCode>
|
||||
<cbc:PaymentID>RE-20201121/508</cbc:PaymentID>
|
||||
<cac:PayeeFinancialAccount>
|
||||
<cbc:ID>DE88200800000970375700</cbc:ID>
|
||||
<cbc:Name>Max Mustermann</cbc:Name>
|
||||
<cac:FinancialInstitutionBranch>
|
||||
<cbc:ID>COBADEFFXXX</cbc:ID>
|
||||
</cac:FinancialInstitutionBranch>
|
||||
</cac:PayeeFinancialAccount>
|
||||
</cac:PaymentMeans>
|
||||
<cac:PaymentTerms>
|
||||
<cbc:Note>Zahlbar ohne Abzug bis 12.12.2020</cbc:Note>
|
||||
</cac:PaymentTerms>
|
||||
<cac:TaxTotal>
|
||||
<cbc:TaxAmount currencyID="EUR">75.04</cbc:TaxAmount>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">160</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">11.2</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>7</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
<cac:TaxSubtotal>
|
||||
<cbc:TaxableAmount currencyID="EUR">336</cbc:TaxableAmount>
|
||||
<cbc:TaxAmount currencyID="EUR">63.84</cbc:TaxAmount>
|
||||
<cac:TaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:TaxCategory>
|
||||
</cac:TaxSubtotal>
|
||||
</cac:TaxTotal>
|
||||
<cac:LegalMonetaryTotal>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">496</cbc:LineExtensionAmount>
|
||||
<cbc:TaxExclusiveAmount currencyID="EUR">496</cbc:TaxExclusiveAmount>
|
||||
<cbc:TaxInclusiveAmount currencyID="EUR">571.04</cbc:TaxInclusiveAmount>
|
||||
<cbc:AllowanceTotalAmount currencyID="EUR">0</cbc:AllowanceTotalAmount>
|
||||
<cbc:ChargeTotalAmount currencyID="EUR">0</cbc:ChargeTotalAmount>
|
||||
<cbc:PrepaidAmount currencyID="EUR">0</cbc:PrepaidAmount>
|
||||
<cbc:PayableAmount currencyID="EUR">571.04</cbc:PayableAmount>
|
||||
</cac:LegalMonetaryTotal>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>1</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="HUR">1</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">160</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>Of a sample invoice</cbc:Description>
|
||||
<cbc:Name>Design (hours)</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>7</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">160</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="HUR">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">160</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>2</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="H87">400</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">316</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Description>various colors, ~2000ml</cbc:Description>
|
||||
<cbc:Name>Ballons</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">0.79</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="H87">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">0.79</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
<cac:InvoiceLine>
|
||||
<cbc:ID>3</cbc:ID>
|
||||
<cbc:InvoicedQuantity unitCode="LTR">800</cbc:InvoicedQuantity>
|
||||
<cbc:LineExtensionAmount currencyID="EUR">20</cbc:LineExtensionAmount>
|
||||
<cac:Item>
|
||||
<cbc:Name>Hot air „heiße Luft“ (litres)</cbc:Name>
|
||||
<cac:ClassifiedTaxCategory>
|
||||
<cbc:ID>S</cbc:ID>
|
||||
<cbc:Percent>19</cbc:Percent>
|
||||
<cac:TaxScheme>
|
||||
<cbc:ID>VAT</cbc:ID>
|
||||
</cac:TaxScheme>
|
||||
</cac:ClassifiedTaxCategory>
|
||||
</cac:Item>
|
||||
<cac:Price>
|
||||
<cbc:PriceAmount currencyID="EUR">0.025</cbc:PriceAmount>
|
||||
<cbc:BaseQuantity unitCode="LTR">1</cbc:BaseQuantity>
|
||||
<cac:AllowanceCharge>
|
||||
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
|
||||
<cbc:Amount currencyID="EUR">0</cbc:Amount>
|
||||
<cbc:BaseAmount currencyID="EUR">0.025</cbc:BaseAmount>
|
||||
</cac:AllowanceCharge>
|
||||
</cac:Price>
|
||||
</cac:InvoiceLine>
|
||||
</Invoice>
|
||||
Reference in New Issue
Block a user