From 5ed8d504e93a406c6854d9cfce4e0c96d3ef216a Mon Sep 17 00:00:00 2001 From: HorstOeko Date: Tue, 7 May 2024 17:02:07 +0200 Subject: [PATCH] Added Test for Issue #43 --- build/phpunit.xml | 1 + tests/testcases/issues/Issue43Test.php | 48 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/testcases/issues/Issue43Test.php diff --git a/build/phpunit.xml b/build/phpunit.xml index 27a0d27..fc3415a 100644 --- a/build/phpunit.xml +++ b/build/phpunit.xml @@ -52,6 +52,7 @@ ../tests/testcases/issues/Issue10Test.php ../tests/testcases/issues/Issue18Test.php ../tests/testcases/issues/Issue32Test.php + ../tests/testcases/issues/Issue43Test.php diff --git a/tests/testcases/issues/Issue43Test.php b/tests/testcases/issues/Issue43Test.php new file mode 100644 index 0000000..9feef3e --- /dev/null +++ b/tests/testcases/issues/Issue43Test.php @@ -0,0 +1,48 @@ +setDocumentInformation( + $invoice, + ZugferdInvoiceType::INVOICE, + \DateTime::createFromFormat("d.m.y", $date), + "EUR", + $invoice, + null, + \DateTime::createFromFormat("d.m.y", $duedate) + ); + + self::$document->addDocumentPaymentTerm('PaymentTerm', \DateTime::createFromFormat("d.m.y", $duedate), "MandateId"); + + $this->assertXPathValueWithAttribute('/rsm:CrossIndustryInvoice/rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString', "20240505", "format", "102"); + $this->assertXPathValueWithIndexAndAttribute('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:DueDateDateTime/udt:DateTimeString', 0, "20240605", "format", "102"); + } +}