Skip to content

Commit

Permalink
Merge pull request #177 from LinioIT/fix/SCP-4530-fix-invoice-model
Browse files Browse the repository at this point in the history
fix: invoice date to string
  • Loading branch information
Maferamosp authored Mar 6, 2024
2 parents 1fca65f + 4f1a824 commit feea780
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Model/Order/InvoiceDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit feea780

Please sign in to comment.