2024-10-23 04:00:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\EDocument\Gateway\Storecove\Models;
|
|
|
|
|
2024-10-25 08:51:01 +02:00
|
|
|
use JsonSerializable;
|
|
|
|
use Symfony\Component\Serializer\Annotation\SerializedName;
|
|
|
|
use DateTime;
|
|
|
|
|
|
|
|
class Invoice implements JsonSerializable
|
2024-10-23 04:00:25 +02:00
|
|
|
{
|
2024-10-25 08:51:01 +02:00
|
|
|
#[SerializedName('taxSystem')]
|
|
|
|
private string $taxSystem = 'tax_line_percentages';
|
|
|
|
|
|
|
|
#[SerializedName('documentCurrency')]
|
|
|
|
private string $documentCurrency = '';
|
|
|
|
|
|
|
|
#[SerializedName('invoiceNumber')]
|
|
|
|
private string $invoiceNumber = '';
|
|
|
|
|
|
|
|
#[SerializedName('issueDate')]
|
|
|
|
private DateTime $issueDate;
|
|
|
|
|
|
|
|
#[SerializedName('taxPointDate')]
|
|
|
|
private ?DateTime $taxPointDate = null;
|
|
|
|
|
|
|
|
#[SerializedName('dueDate')]
|
|
|
|
private DateTime $dueDate;
|
|
|
|
|
|
|
|
#[SerializedName('invoicePeriod')]
|
|
|
|
private array $invoicePeriod = [];
|
|
|
|
|
|
|
|
#[SerializedName('references')]
|
|
|
|
private array $references = [];
|
|
|
|
|
|
|
|
#[SerializedName('accountingCost')]
|
|
|
|
private ?string $accountingCost = null;
|
|
|
|
|
|
|
|
#[SerializedName('note')]
|
|
|
|
private string $note = '';
|
|
|
|
|
|
|
|
#[SerializedName('amountIncludingVat')]
|
|
|
|
private float $amountIncludingVat = 0.0;
|
|
|
|
|
|
|
|
#[SerializedName('prepaidAmount')]
|
|
|
|
private ?float $prepaidAmount = null;
|
|
|
|
|
|
|
|
#[SerializedName('accountingSupplierParty')]
|
|
|
|
private array $accountingSupplierParty = [];
|
|
|
|
|
|
|
|
#[SerializedName('accountingCustomerParty')]
|
|
|
|
private array $accountingCustomerParty = [];
|
|
|
|
|
|
|
|
#[SerializedName('paymentMeans')]
|
|
|
|
private array $paymentMeans = [];
|
|
|
|
|
|
|
|
#[SerializedName('taxTotal')]
|
|
|
|
private array $taxTotal = [];
|
2024-10-23 04:00:25 +02:00
|
|
|
|
|
|
|
/**
|
2024-10-25 08:51:01 +02:00
|
|
|
* @var InvoiceLines[]
|
2024-10-23 04:00:25 +02:00
|
|
|
*/
|
2024-10-25 08:51:01 +02:00
|
|
|
private array $invoiceLines = [];
|
|
|
|
|
|
|
|
// Getters and setters for all properties
|
|
|
|
|
|
|
|
public function setDocumentCurrency(string $documentCurrency): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->documentCurrency = $documentCurrency;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setInvoiceNumber(string $invoiceNumber): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->invoiceNumber = $invoiceNumber;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setIssueDate(DateTime $issueDate): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->issueDate = $issueDate;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setTaxPointDate(?DateTime $taxPointDate): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->taxPointDate = $taxPointDate;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setDueDate(DateTime $dueDate): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->dueDate = $dueDate;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setInvoicePeriod(array $invoicePeriod): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->invoicePeriod = $invoicePeriod;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setReferences(array $references): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->references = $references;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setAccountingCost(?string $accountingCost): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->accountingCost = $accountingCost;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setNote(string $note): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->note = $note;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setAmountIncludingVat(float $amountIncludingVat): void
|
|
|
|
{
|
|
|
|
$this->amountIncludingVat = $amountIncludingVat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setPrepaidAmount(?float $prepaidAmount): void
|
|
|
|
{
|
|
|
|
$this->prepaidAmount = $prepaidAmount;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setAccountingSupplierParty(array $accountingSupplierParty): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->accountingSupplierParty = $accountingSupplierParty;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setAccountingCustomerParty(array $accountingCustomerParty): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->accountingCustomerParty = $accountingCustomerParty;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function setPaymentMeans(array $paymentMeans): void
|
|
|
|
{
|
|
|
|
$this->paymentMeans = $paymentMeans;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setTaxTotal(array $taxTotal): void
|
|
|
|
{
|
|
|
|
$this->taxTotal = $taxTotal;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param InvoiceLines[] $invoiceLines
|
|
|
|
*/
|
|
|
|
public function setInvoiceLines(array $invoiceLines): void
|
|
|
|
{
|
2024-10-23 04:00:25 +02:00
|
|
|
$this->invoiceLines = $invoiceLines;
|
2024-10-25 08:51:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function jsonSerialize(): mixed
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'taxSystem' => $this->taxSystem,
|
|
|
|
'documentCurrency' => $this->documentCurrency,
|
|
|
|
'invoiceNumber' => $this->invoiceNumber,
|
|
|
|
'issueDate' => $this->issueDate->format('Y-m-d'),
|
|
|
|
'taxPointDate' => $this->taxPointDate ? $this->taxPointDate->format('Y-m-d') : null,
|
|
|
|
'dueDate' => $this->dueDate->format('Y-m-d'),
|
|
|
|
'invoicePeriod' => $this->invoicePeriod,
|
|
|
|
'references' => $this->references,
|
|
|
|
'accountingCost' => $this->accountingCost,
|
|
|
|
'note' => $this->note,
|
|
|
|
'amountIncludingVat' => $this->amountIncludingVat,
|
|
|
|
'prepaidAmount' => $this->prepaidAmount,
|
|
|
|
'accountingSupplierParty' => $this->accountingSupplierParty,
|
|
|
|
'accountingCustomerParty' => $this->accountingCustomerParty,
|
|
|
|
'paymentMeans' => $this->paymentMeans,
|
|
|
|
'taxTotal' => $this->taxTotal,
|
|
|
|
'invoiceLines' => $this->invoiceLines,
|
|
|
|
];
|
2024-10-23 04:00:25 +02:00
|
|
|
}
|
|
|
|
}
|