From dc8e42a7e41564164d071bc85e6aa0251c8ea3e1 Mon Sep 17 00:00:00 2001 From: HorstOeko Date: Tue, 12 Sep 2023 06:49:49 +0200 Subject: [PATCH 1/3] Updated to Validation Tool 1.5.0, New validation config --- build.ant.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.ant.xml b/build.ant.xml index 03963694..120d84e8 100644 --- a/build.ant.xml +++ b/build.ant.xml @@ -2,8 +2,8 @@ - - + + @@ -319,7 +319,9 @@ - + + + @@ -334,7 +336,9 @@ - + + + From 295ada2e83b2c32eef659346e128a7be631c4cb2 Mon Sep 17 00:00:00 2001 From: HorstOeko Date: Tue, 12 Sep 2023 07:08:52 +0200 Subject: [PATCH 2/3] Added QuickDescriptor for XRechnung 3 --- build.ant.xml | 12 ++--- examples/XRechnung3Simple.php | 45 +++++++++++++++++++ examples/XRechnung3SimpleQuick.php | 31 +++++++++++++ .../ZugferdQuickDescriptorXRechnung2.php | 2 +- .../ZugferdQuickDescriptorXRechnung3.php | 33 ++++++++++++++ 5 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 examples/XRechnung3Simple.php create mode 100644 examples/XRechnung3SimpleQuick.php create mode 100644 src/quick/ZugferdQuickDescriptorXRechnung3.php diff --git a/build.ant.xml b/build.ant.xml index 120d84e8..fc4dea68 100644 --- a/build.ant.xml +++ b/build.ant.xml @@ -309,14 +309,14 @@ - - + + - + - - + + @@ -333,7 +333,7 @@ - + diff --git a/examples/XRechnung3Simple.php b/examples/XRechnung3Simple.php new file mode 100644 index 00000000..c961ec74 --- /dev/null +++ b/examples/XRechnung3Simple.php @@ -0,0 +1,45 @@ +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"); diff --git a/examples/XRechnung3SimpleQuick.php b/examples/XRechnung3SimpleQuick.php new file mode 100644 index 00000000..3c2f3cad --- /dev/null +++ b/examples/XRechnung3SimpleQuick.php @@ -0,0 +1,31 @@ +doCreateInvoice("471102", \DateTime::createFromFormat("Ymd", "20180305"), "EUR") + ->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", "34676-342323") + ->doSetBuyerContact("Hans Miller") + ->doSetSeller("Lieferant GmbH", "80333", "München", "Lieferantenstraße 20", "DE", null, "4000001123452", "0088") + ->doAddSellerTaxRegistration("FC", "201/113/40209") + ->doAddSellerTaxRegistration("VA", "DE123456789") + ->doSetSellerContact("Horst Meier", null, "horst@nowhere.all", "+49-0000-8888888") + ->doAddTradeLineItem("1", "Zitronensäure 100ml", 1.0, 100.0, "H87", 0.0, "", "S", "VAT", 19.0) + ->doAddTradeLineItem("2", "Gelierzucker Extra 250g", 1.45, 50.0, "H87", 0.0, "", "S", "VAT", 7.0) + ->doAddTradeLineItem("3", "Gelierzucker Extra 250g", 0.0, 10.0, "H87", 0.0, "", "S", "VAT", 7.0) + ->doSetDocumentPositionNote("Artikel wie vereinbart ohne Berechnung") + ->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(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) + ->doAddTradeAllowanceCharge(-0.50, "Rechnungsrabatt 2", "S", "VAT", 7.0) + ->writeFile(getcwd() . "/factur-x.xml"); diff --git a/src/quick/ZugferdQuickDescriptorXRechnung2.php b/src/quick/ZugferdQuickDescriptorXRechnung2.php index 75e2f8d7..73f05f29 100644 --- a/src/quick/ZugferdQuickDescriptorXRechnung2.php +++ b/src/quick/ZugferdQuickDescriptorXRechnung2.php @@ -28,6 +28,6 @@ class ZugferdQuickDescriptorXRechnung2 extends ZugferdQuickDescriptor */ protected static function getProfile(): int { - return ZugferdProfiles::PROFILE_XRECHNUNG_2; + return ZugferdProfiles::PROFILE_XRECHNUNG_2_3; } } diff --git a/src/quick/ZugferdQuickDescriptorXRechnung3.php b/src/quick/ZugferdQuickDescriptorXRechnung3.php new file mode 100644 index 00000000..8670ec16 --- /dev/null +++ b/src/quick/ZugferdQuickDescriptorXRechnung3.php @@ -0,0 +1,33 @@ + + * @license https://opensource.org/licenses/MIT MIT + * @link https://github.com/horstoeko/zugferd + */ +class ZugferdQuickDescriptorXRechnung3 extends ZugferdQuickDescriptor +{ + /** + * @inheritDoc + */ + protected static function getProfile(): int + { + return ZugferdProfiles::PROFILE_XRECHNUNG_3; + } +} From ef6c00fb751df2e75c4f6408b262d42683c8a7a8 Mon Sep 17 00:00:00 2001 From: HorstOeko Date: Tue, 12 Sep 2023 07:15:56 +0200 Subject: [PATCH 3/3] Failonerror="false" for Schematron Checks --- build.ant.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ant.xml b/build.ant.xml index fc4dea68..2c038ab8 100644 --- a/build.ant.xml +++ b/build.ant.xml @@ -317,7 +317,7 @@ - + @@ -334,7 +334,7 @@ - +