Skip to content

Commit

Permalink
Updated examples, All XRechnung Examples are fully valid
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Nov 25, 2020
1 parent 8e00ab8 commit c097815
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
4 changes: 4 additions & 0 deletions examples/En16931Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdProfiles;
use horstoeko\zugferd\codelists\ZugferdPaymentMeans;

require getcwd() . "/../vendor/autoload.php";

Expand All @@ -11,12 +12,15 @@
->addDocumentNote('Rechnung gemäß Bestellung vom 01.03.2018.')
->addDocumentNote('Lieferant GmbH' . PHP_EOL . 'Lieferantenstraße 20' . PHP_EOL . '80333 München' . PHP_EOL . 'Deutschland' . PHP_EOL . 'Geschäftsführer: Hans Muster' . PHP_EOL . 'Handelsregisternummer: H A 123' . PHP_EOL . PHP_EOL, null, 'REG')
->setDocumentSupplyChainEvent(\DateTime::createFromFormat('Ymd', '20180305'))
->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, "DE12500105170648489890", null, null, null)
->setDocumentSeller("Lieferant GmbH", "549910")
->addDocumentSellerGlobalId("4000001123452", "0088")
->addDocumentSellerTaxRegistration("FC", "201/113/40209")
->addDocumentSellerTaxRegistration("VA", "DE123456789")
->setDocumentSellerAddress("Lieferantenstraße 20", "", "", "80333", "München", "DE")
->setDocumentSellerContact("Heinz Mükker", "Buchhaltung", "+49-111-2222222", "+49-111-3333333","info@lieferant.de")
->setDocumentBuyer("Kunden AG Mitte", "GE2020211")
->setDocumentBuyerReference("34676-342323")
->setDocumentBuyerAddress("Kundenstraße 15", "", "", "69876", "Frankfurt", "DE")
->addDocumentTax("S", "VAT", 275.0, 19.25, 7.0)
->addDocumentTax("S", "VAT", 198.0, 37.62, 19.0)
Expand Down
4 changes: 2 additions & 2 deletions examples/En16931SimpleQuick.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
->doSetPaymentTerms("Zahlbar sofort", new \DateTime('+3 days'))
->doAddNote('Rechnung gemäß Bestellung vom 01.03.2018.')
->doAddNote('Lieferant GmbH' . PHP_EOL . 'Lieferantenstraße 20' . PHP_EOL . '80333 München' . PHP_EOL . 'Deutschland' . PHP_EOL . 'Geschäftsführer: Hans Muster' . PHP_EOL . 'Handelsregisternummer: H A 123' . PHP_EOL . PHP_EOL, ZugferdTextSubjectCodeQualifiers::UNTDID_4451_REG)
->doSetBuyer("Kunden AG Mitte", "69876", "Frankfurt", "Lieferantenstraße 20", "DE", "byeref")
->doSetBuyer("Kunden AG Mitte", "69876", "Frankfurt", "Lieferantenstraße 20", "DE", "34676-342323")
->doSetBuyerContact("Hans Miller")
->doSetSeller("Lieferant GmbH", "80333", "München", "Lieferantenstraße 20", "DE", null, "4000001123452", "0088")
->doAddSellerTaxRegistration("FC", "201/113/40209")
Expand All @@ -22,7 +22,7 @@
->doAddTradeLineItem("4", "Bierbrau Pils 20/0500", 12.0, 15.0, "XBC", 0.0, "", "S", "VAT", 19.0)
->doAddTradeLineItem("5", "Leergutpfand 20 x 0,5l", 3.10, 15.0, "C62", 0.0, "", "S", "VAT", 19.0)
->doAddTradeLineItem("6", "Mischpalette Joghurt Karton 3 x 20", 29.10, 2.0, "C62", 0.0, "", "S", "VAT", 7.0)
->doSetPaymentMeansForCreditTransfer(false, "DE00000000000000000000")
->doSetPaymentMeansForCreditTransfer(true, "DE12500105170648489890")
->doAddTradeAllowanceCharge(-5.60, "Rechnungsrabatt 1", "S", "VAT", 19.0)
->doAddTradeAllowanceCharge(-2.61, "Rechnungsrabatt 1", "S", "VAT", 7.0)
->doAddTradeAllowanceCharge(-2.50, "Rechnungsrabatt 2", "S", "VAT", 19.0)
Expand Down
4 changes: 4 additions & 0 deletions examples/En16931SimpleWithPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdDocumentPdfBuilder;
use horstoeko\zugferd\ZugferdProfiles;
use horstoeko\zugferd\codelists\ZugferdPaymentMeans;

require getcwd() . "/../vendor/autoload.php";

Expand All @@ -12,12 +13,15 @@
->addDocumentNote('Rechnung gemäß Bestellung vom 01.03.2018.')
->addDocumentNote('Lieferant GmbH' . PHP_EOL . 'Lieferantenstraße 20' . PHP_EOL . '80333 München' . PHP_EOL . 'Deutschland' . PHP_EOL . 'Geschäftsführer: Hans Muster' . PHP_EOL . 'Handelsregisternummer: H A 123' . PHP_EOL . PHP_EOL, null, 'REG')
->setDocumentSupplyChainEvent(\DateTime::createFromFormat('Ymd', '20180305'))
->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, "DE12500105170648489890", null, null, null)
->setDocumentSeller("Lieferant GmbH", "549910")
->addDocumentSellerGlobalId("4000001123452", "0088")
->addDocumentSellerTaxRegistration("FC", "201/113/40209")
->addDocumentSellerTaxRegistration("VA", "DE123456789")
->setDocumentSellerAddress("Lieferantenstraße 20", "", "", "80333", "München", "DE")
->setDocumentSellerContact("Heinz Mükker", "Buchhaltung", "+49-111-2222222", "+49-111-3333333","info@lieferant.de")
->setDocumentBuyer("Kunden AG Mitte", "GE2020211")
->setDocumentBuyerReference("34676-342323")
->setDocumentBuyerAddress("Kundenstraße 15", "", "", "69876", "Frankfurt", "DE")
->addDocumentTax("S", "VAT", 275.0, 19.25, 7.0)
->addDocumentTax("S", "VAT", 198.0, 37.62, 19.0)
Expand Down
45 changes: 45 additions & 0 deletions examples/XRechnungSimple.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdProfiles;
use horstoeko\zugferd\codelists\ZugferdPaymentMeans;

require getcwd() . "/../vendor/autoload.php";

$document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_XRECHNUNG);
$document
->setDocumentInformation("471102", "380", \DateTime::createFromFormat("Ymd", "20180305"), "EUR")
->addDocumentNote('Rechnung gemäß Bestellung vom 01.03.2018.')
->addDocumentNote('Lieferant GmbH' . PHP_EOL . 'Lieferantenstraße 20' . PHP_EOL . '80333 München' . PHP_EOL . 'Deutschland' . PHP_EOL . 'Geschäftsführer: Hans Muster' . PHP_EOL . 'Handelsregisternummer: H A 123' . PHP_EOL . PHP_EOL, null, 'REG')
->setDocumentSupplyChainEvent(\DateTime::createFromFormat('Ymd', '20180305'))
->addDocumentPaymentMean(ZugferdPaymentMeans::UNTDID_4461_58, null, null, null, null, null, "DE12500105170648489890", null, null, null)
->setDocumentSeller("Lieferant GmbH", "549910")
->addDocumentSellerGlobalId("4000001123452", "0088")
->addDocumentSellerTaxRegistration("FC", "201/113/40209")
->addDocumentSellerTaxRegistration("VA", "DE123456789")
->setDocumentSellerAddress("Lieferantenstraße 20", "", "", "80333", "München", "DE")
->setDocumentSellerContact("Heinz Mükker", "Buchhaltung", "+49-111-2222222", "+49-111-3333333","info@lieferant.de")
->setDocumentBuyer("Kunden AG Mitte", "GE2020211")
->setDocumentBuyerReference("34676-342323")
->setDocumentBuyerAddress("Kundenstraße 15", "", "", "69876", "Frankfurt", "DE")
->addDocumentTax("S", "VAT", 275.0, 19.25, 7.0)
->addDocumentTax("S", "VAT", 198.0, 37.62, 19.0)
->setDocumentSummation(529.87, 529.87, 473.00, 0.0, 0.0, 473.00, 56.87, null, 0.0)
->addDocumentPaymentTerm("Zahlbar innerhalb 30 Tagen netto bis 04.04.2018, 3% Skonto innerhalb 10 Tagen bis 15.03.2018")
->addNewPosition("1")
->setDocumentPositionNote("Bemerkung zu Zeile 1")
->setDocumentPositionProductDetails("Trennblätter A4", "", "TB100A4")
->setDocumentPositionGrossPrice(9.9000)
->setDocumentPositionNetPrice(9.9000)
->setDocumentPositionQuantity(20, "H87")
->addDocumentPositionTax('S', 'VAT', 19)
->setDocumentPositionLineSummation(198.0)
->addNewPosition("2")
->setDocumentPositionNote("Bemerkung zu Zeile 2")
->setDocumentPositionProductDetails("Joghurt Banane", "", "ARNR2", null, "0160", "4000050986428")
->SetDocumentPositionGrossPrice(5.5000)
->SetDocumentPositionNetPrice(5.5000)
->SetDocumentPositionQuantity(50, "H87")
->AddDocumentPositionTax('S', 'VAT', 7)
->SetDocumentPositionLineSummation(275.0)
->writeFile(getcwd() . "/factur-x.xml");
4 changes: 2 additions & 2 deletions examples/XRechnungSimpleQuick.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
->doSetPaymentTerms("Zahlbar sofort", new \DateTime('+3 days'))
->doAddNote('Rechnung gemäß Bestellung vom 01.03.2018.')
->doAddNote('Lieferant GmbH' . PHP_EOL . 'Lieferantenstraße 20' . PHP_EOL . '80333 München' . PHP_EOL . 'Deutschland' . PHP_EOL . 'Geschäftsführer: Hans Muster' . PHP_EOL . 'Handelsregisternummer: H A 123' . PHP_EOL . PHP_EOL, ZugferdTextSubjectCodeQualifiers::UNTDID_4451_REG)
->doSetBuyer("Kunden AG Mitte", "69876", "Frankfurt", "Lieferantenstraße 20", "DE", "byeref")
->doSetBuyer("Kunden AG Mitte", "69876", "Frankfurt", "Lieferantenstraße 20", "DE", "34676-342323")
->doSetBuyerContact("Hans Miller")
->doSetSeller("Lieferant GmbH", "80333", "München", "Lieferantenstraße 20", "DE", null, "4000001123452", "0088")
->doAddSellerTaxRegistration("FC", "201/113/40209")
Expand All @@ -22,7 +22,7 @@
->doAddTradeLineItem("4", "Bierbrau Pils 20/0500", 12.0, 15.0, "XBC", 0.0, "", "S", "VAT", 19.0)
->doAddTradeLineItem("5", "Leergutpfand 20 x 0,5l", 3.10, 15.0, "C62", 0.0, "", "S", "VAT", 19.0)
->doAddTradeLineItem("6", "Mischpalette Joghurt Karton 3 x 20", 29.10, 2.0, "C62", 0.0, "", "S", "VAT", 7.0)
->doSetPaymentMeansForCreditTransfer(false, "DE00000000000000000000")
->doSetPaymentMeansForCreditTransfer(true, "DE12500105170648489890")
->doAddTradeAllowanceCharge(-5.60, "Rechnungsrabatt 1", "S", "VAT", 19.0)
->doAddTradeAllowanceCharge(-2.61, "Rechnungsrabatt 1", "S", "VAT", 7.0)
->doAddTradeAllowanceCharge(-2.50, "Rechnungsrabatt 2", "S", "VAT", 19.0)
Expand Down

0 comments on commit c097815

Please sign in to comment.