diff --git a/src/Model/Order/InvoiceDocument.php b/src/Model/Order/InvoiceDocument.php index 169a223..390c0f2 100644 --- a/src/Model/Order/InvoiceDocument.php +++ b/src/Model/Order/InvoiceDocument.php @@ -107,6 +107,11 @@ public function getInvoiceDate(): DateTime return $this->invoiceDate; } + public function getInvoiceDateString(): string + { + return $this->invoiceDate->format('Y-m-d'); + } + public function getInvoiceType(): string { return $this->invoiceType; @@ -137,7 +142,7 @@ public function jsonSerialize(): stdClass $serialized->orderItemIds = $orderItems ?? []; $serialized->invoiceNumber = $this->invoiceNumber; - $serialized->invoiceDate = $this->invoiceDate->format('Y-m-d'); + $serialized->invoiceDate = $this->getInvoiceDateString(); $serialized->invoiceType = $this->invoiceType; $serialized->operatorCode = strtoupper($this->operatorCode); $serialized->invoiceDocumentFormat = $this->invoiceDocumentFormat;