<?php
namespace App\Entity;
use App\Entity\Base\AbstractTimestampableEntity;
use App\Repository\FacturiHeaderRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=FacturiHeaderRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class FacturiHeader extends AbstractTimestampableEntity
{
/**
* @ORM\ManyToOne(targetEntity=Company::class, inversedBy="facturiHeaders")
* @ORM\JoinColumn(nullable=false)
*/
private Company $company;
/**
* @ORM\Column(type="string", length=255)
*/
private string $facturaSeria;
/**
* @ORM\Column(type="integer", nullable=false)
*/
private int $facturaNr;
/**
* @ORM\Column(type="date")
*/
private \DateTime $facturaData;
/**
* @ORM\Column(type="decimal", precision=20, scale=2)
*/
private float $value;
/**
* @ORM\Column(type="decimal", precision=20, scale=2)
*/
private float $paidValue;
/**
* @ORM\OneToMany(targetEntity=FacturaBody::class, mappedBy="facturaHeader")
*/
private Collection $facturaBodies;
/**
* @ORM\Column(type="boolean")
*/
private bool $anulat;
/**
* @ORM\ManyToOne(targetEntity=Currency::class, inversedBy="facturiHeaders")
*/
private $currency;
/**
* @ORM\Column(type="decimal", precision=21, scale=6)
*/
private $exchangeRate;
/**
* @ORM\OneToMany(targetEntity=Payment::class, mappedBy="facturiHeader")
*/
private $payments;
/**
* @ORM\Column(type="boolean", nullable=true, options={"default":false})
*/
private bool $fgoExported;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private string $fgoLink;
public function __construct()
{
$this->dispozitieLivrareHeaders = new ArrayCollection();
$this->facturaBodies = new ArrayCollection();
$this->payments = new ArrayCollection();
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
public function getFacturaSeria(): ?string
{
return $this->facturaSeria;
}
public function setFacturaSeria(string $facturaSeria): self
{
$this->facturaSeria = $facturaSeria;
return $this;
}
public function getFacturaNr(): ?int
{
return $this->facturaNr;
}
public function setFacturaNr(int $facturaNr): self
{
$this->facturaNr = $facturaNr;
return $this;
}
public function getFacturaData(): ?\DateTimeInterface
{
return $this->facturaData;
}
public function setFacturaData(\DateTimeInterface $facturaData): self
{
$this->facturaData = $facturaData;
return $this;
}
public function getValue(): ?string
{
return $this->value;
}
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getPaidValue(): ?string
{
return $this->paidValue;
}
public function setPaidValue(string $paidValue): self
{
$this->paidValue = $paidValue;
return $this;
}
/**
* @return Collection<int, FacturaBody>
*/
public function getFacturaBodies(): Collection
{
return $this->facturaBodies;
}
public function addFacturaBody(FacturaBody $facturaBody): self
{
if (!$this->facturaBodies->contains($facturaBody)) {
$this->facturaBodies[] = $facturaBody;
$facturaBody->setFacturaHeader($this);
}
return $this;
}
public function removeFacturaBody(FacturaBody $facturaBody): self
{
if ($this->facturaBodies->removeElement($facturaBody)) {
// set the owning side to null (unless already changed)
if ($facturaBody->getFacturaHeader() === $this) {
$facturaBody->setFacturaHeader(null);
}
}
return $this;
}
public function isAnulat(): ?bool
{
return $this->anulat;
}
public function setAnulat(bool $anulat): self
{
$this->anulat = $anulat;
return $this;
}
public function getCurrency(): ?Currency
{
return $this->currency;
}
public function setCurrency(?Currency $currency): self
{
$this->currency = $currency;
return $this;
}
public function getExchangeRate(): ?string
{
return $this->exchangeRate;
}
public function setExchangeRate(string $exchangeRate): self
{
$this->exchangeRate = $exchangeRate;
return $this;
}
/**
* @return Collection<int, Payment>
*/
public function getPayments(): Collection
{
return $this->payments;
}
public function addPayment(Payment $payment): self
{
if (!$this->payments->contains($payment)) {
$this->payments[] = $payment;
$payment->setFacturiHeader($this);
}
return $this;
}
public function removePayment(Payment $payment): self
{
if ($this->payments->removeElement($payment)) {
// set the owning side to null (unless already changed)
if ($payment->getFacturiHeader() === $this) {
$payment->setFacturiHeader(null);
}
}
return $this;
}
/**
* @return bool
*/
public function isFgoExported(): bool
{
return $this->fgoExported;
}
/**
* @param bool $fgoExported
*/
public function setFgoExported(bool $fgoExported): void
{
$this->fgoExported = $fgoExported;
}
/**
* @return string
*/
public function getFgoLink(): string
{
return $this->fgoLink;
}
/**
* @param string $fgoLink
*/
public function setFgoLink(string $fgoLink): void
{
$this->fgoLink = $fgoLink;
}
}