<?php
namespace App\Entity;
use App\Repository\CustomerInvoiceSettingsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CustomerInvoiceSettingsRepository::class)]
class CustomerInvoiceSettings
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $token = null;
#[ORM\Column(length: 10, nullable: true)]
private ?string $freeField = null;
#[ORM\Column(nullable: true)]
private ?int $nextValue = null;
#[ORM\Column]
private ?int $minLength = null;
#[ORM\Column]
private ?int $taxRate = null;
#[ORM\Column]
private ?int $invoiceDue = null;
#[ORM\Column]
private bool $automaticSend;
#[ORM\Column]
private ?int $paymentTermInDays = null;
#[ORM\JoinTable(name: 'customer_settings_invoice_interval')]
#[ORM\JoinColumn(name: 'customer_settings_id', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'invoice_interval_id', referencedColumnName: 'id')]
#[ORM\ManyToMany(targetEntity: InvoiceInterval::class, inversedBy: 'customerInvoiceSettings')]
private Collection $invoiceIntervals;
public function __construct()
{
$this->invoiceIntervals = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getToken(): ?string
{
return $this->token;
}
public function setToken(?string $token): self
{
$this->token = $token;
return $this;
}
public function getFreeField(): ?string
{
return $this->freeField;
}
public function setFreeField(?string $freeField): self
{
$this->freeField = $freeField;
return $this;
}
public function getNextValue(): ?int
{
return $this->nextValue;
}
public function setNextValue(?int $nextValue): self
{
$this->nextValue = $nextValue;
return $this;
}
public function getMinLength(): ?int
{
return $this->minLength;
}
public function setMinLength(int $minLength): self
{
$this->minLength = $minLength;
return $this;
}
public function getTaxRate(): ?int
{
return $this->taxRate;
}
public function setTaxRate(int $taxRate): self
{
$this->taxRate = $taxRate;
return $this;
}
public function getInvoiceDue(): ?int
{
return $this->invoiceDue;
}
public function setInvoiceDue(int $invoiceDue): self
{
$this->invoiceDue = $invoiceDue;
return $this;
}
public function isAutomaticSend(): ?bool
{
return $this->automaticSend;
}
public function setAutomaticSend(bool $automaticSend): self
{
$this->automaticSend = $automaticSend;
return $this;
}
/**
* @return Collection<int, InvoiceInterval>
*/
public function getInvoiceIntervals(): Collection
{
return $this->invoiceIntervals;
}
public function addInvoiceInterval(InvoiceInterval $invoiceInterval): self
{
if (!$this->invoiceIntervals->contains($invoiceInterval)) {
$this->invoiceIntervals->add($invoiceInterval);
}
return $this;
}
public function removeInvoiceInterval(InvoiceInterval $invoiceInterval): self
{
$this->invoiceIntervals->removeElement($invoiceInterval);
return $this;
}
public function getPaymentTermInDays(): ?int
{
return $this->paymentTermInDays;
}
public function setPaymentTermInDays(int $paymentTermInDays): self
{
$this->paymentTermInDays = $paymentTermInDays;
return $this;
}
}