From 09df4ad0092c6b96e5e68f8346d467b7864d723d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hevesi=20Gerg=C5=91?= Date: Tue, 6 Jan 2026 13:00:11 +0100 Subject: [PATCH 1/3] Include IssueTime in XML serialization when set, formatted as H:i:s in Invoice xml tag --- src/Invoice.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Invoice.php b/src/Invoice.php index 141d9d9..8102f56 100644 --- a/src/Invoice.php +++ b/src/Invoice.php @@ -21,6 +21,7 @@ class Invoice implements XmlSerializable, XmlDeserializable private $id; private $copyIndicator; private $issueDate; + private ?DateTime $issueTime; protected $invoiceTypeCode = InvoiceTypeCode::INVOICE; private $note; private $taxPointDate; @@ -144,6 +145,25 @@ public function setIssueDate(?DateTime $issueDate) return $this; } + /** + * @return DateTime + */ + public function getIssueTime() : ?DateTime + { + return $this->issueTime ?? null; + } + + /** + * @param DateTime $issueTime + * @return static + */ + public function setIssueTime(?DateTime $issueTime = null) : self + { + $this->issueTime = $issueTime; + + return $this; + } + /** * @return DateTime */ @@ -756,6 +776,12 @@ public function xmlSerialize(Writer $writer): void Schema::CBC . "IssueDate" => $this->issueDate->format("Y-m-d"), ]); + if (isset($this->issueTime)) { + $writer->write([ + Schema::CBC . 'IssueTime' => $this->issueTime->format('H:i:s'), + ]); + } + if ($this->dueDate !== null && $this->xmlTagName === "Invoice") { $writer->write([ Schema::CBC . "DueDate" => $this->dueDate->format("Y-m-d"), From 3cabacd0495e12016b2eca521141f733107d8f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hevesi=20Gerg=C5=91?= Date: Tue, 6 Jan 2026 13:25:34 +0100 Subject: [PATCH 2/3] Added issueTime for the SimpleInvoiceTest --- tests/Write/SimpleInvoiceTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Write/SimpleInvoiceTest.php b/tests/Write/SimpleInvoiceTest.php index 8b6a87a..5208312 100644 --- a/tests/Write/SimpleInvoiceTest.php +++ b/tests/Write/SimpleInvoiceTest.php @@ -138,6 +138,7 @@ public function testIfXMLIsValid() ->setId(1234) ->setCopyIndicator(false) ->setIssueDate(new \DateTime()) + ->setIssueTime(new \DateTime()) ->setAccountingSupplierParty($accountingSupplierParty) ->setAccountingCustomerParty($accountingCustomerParty) ->setInvoiceLines($invoiceLines) From 4ae1bc6374cdb1687cfe7114fa9b8e48552dfdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hevesi=20Gerg=C5=91?= Date: Wed, 7 Jan 2026 13:50:21 +0100 Subject: [PATCH 3/3] IssueTime is filled in deserializeTag --- src/Invoice.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Invoice.php b/src/Invoice.php index 8102f56..e06d12b 100644 --- a/src/Invoice.php +++ b/src/Invoice.php @@ -1022,6 +1022,14 @@ protected static function deserializedTag(array $mixedContent) ), )->toDateTime(), ) + ->setIssueTime( + Carbon::parse( + ReaderHelper::getTagValue( + Schema::CBC . "IssueTime", + $collection, + ), + )->toDateTime(), + ) ->setDueDate( Carbon::parse( ReaderHelper::getTagValue(