src/Entity/FacturiHeader.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Base\AbstractTimestampableEntity;
  4. use App\Repository\FacturiHeaderRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FacturiHeaderRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class FacturiHeader extends AbstractTimestampableEntity
  13. {
  14.     /**
  15.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="facturiHeaders")
  16.      * @ORM\JoinColumn(nullable=false)
  17.      */
  18.     private Company $company;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private string $facturaSeria;
  23.     /**
  24.      * @ORM\Column(type="integer", nullable=false)
  25.      */
  26.     private int $facturaNr;
  27.     /**
  28.      * @ORM\Column(type="date")
  29.      */
  30.     private \DateTime $facturaData;
  31.     /**
  32.      * @ORM\Column(type="decimal", precision=20, scale=2)
  33.      */
  34.     private float $value;
  35.     /**
  36.      * @ORM\Column(type="decimal", precision=20, scale=2)
  37.      */
  38.     private float $paidValue;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity=FacturaBody::class, mappedBy="facturaHeader")
  41.      */
  42.     private Collection $facturaBodies;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      */
  46.     private bool $anulat;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=Currency::class, inversedBy="facturiHeaders")
  49.      */
  50.     private $currency;
  51.     /**
  52.      * @ORM\Column(type="decimal", precision=21, scale=6)
  53.      */
  54.     private $exchangeRate;
  55.     /**
  56.      * @ORM\OneToMany(targetEntity=Payment::class, mappedBy="facturiHeader")
  57.      */
  58.     private $payments;
  59.     /**
  60.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  61.      */
  62.     private bool $fgoExported;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private string $fgoLink;
  67.     public function __construct()
  68.     {
  69.         $this->dispozitieLivrareHeaders = new ArrayCollection();
  70.         $this->facturaBodies = new ArrayCollection();
  71.         $this->payments = new ArrayCollection();
  72.     }
  73.     public function getCompany(): ?Company
  74.     {
  75.         return $this->company;
  76.     }
  77.     public function setCompany(?Company $company): self
  78.     {
  79.         $this->company $company;
  80.         return $this;
  81.     }
  82.     public function getFacturaSeria(): ?string
  83.     {
  84.         return $this->facturaSeria;
  85.     }
  86.     public function setFacturaSeria(string $facturaSeria): self
  87.     {
  88.         $this->facturaSeria $facturaSeria;
  89.         return $this;
  90.     }
  91.     public function getFacturaNr(): ?int
  92.     {
  93.         return $this->facturaNr;
  94.     }
  95.     public function setFacturaNr(int $facturaNr): self
  96.     {
  97.         $this->facturaNr $facturaNr;
  98.         return $this;
  99.     }
  100.     public function getFacturaData(): ?\DateTimeInterface
  101.     {
  102.         return $this->facturaData;
  103.     }
  104.     public function setFacturaData(\DateTimeInterface $facturaData): self
  105.     {
  106.         $this->facturaData $facturaData;
  107.         return $this;
  108.     }
  109.     public function getValue(): ?string
  110.     {
  111.         return $this->value;
  112.     }
  113.     public function setValue(string $value): self
  114.     {
  115.         $this->value $value;
  116.         return $this;
  117.     }
  118.     public function getPaidValue(): ?string
  119.     {
  120.         return $this->paidValue;
  121.     }
  122.     public function setPaidValue(string $paidValue): self
  123.     {
  124.         $this->paidValue $paidValue;
  125.         return $this;
  126.     }
  127.     /**
  128.      * @return Collection<int, FacturaBody>
  129.      */
  130.     public function getFacturaBodies(): Collection
  131.     {
  132.         return $this->facturaBodies;
  133.     }
  134.     public function addFacturaBody(FacturaBody $facturaBody): self
  135.     {
  136.         if (!$this->facturaBodies->contains($facturaBody)) {
  137.             $this->facturaBodies[] = $facturaBody;
  138.             $facturaBody->setFacturaHeader($this);
  139.         }
  140.         return $this;
  141.     }
  142.     public function removeFacturaBody(FacturaBody $facturaBody): self
  143.     {
  144.         if ($this->facturaBodies->removeElement($facturaBody)) {
  145.             // set the owning side to null (unless already changed)
  146.             if ($facturaBody->getFacturaHeader() === $this) {
  147.                 $facturaBody->setFacturaHeader(null);
  148.             }
  149.         }
  150.         return $this;
  151.     }
  152.     public function isAnulat(): ?bool
  153.     {
  154.         return $this->anulat;
  155.     }
  156.     public function setAnulat(bool $anulat): self
  157.     {
  158.         $this->anulat $anulat;
  159.         return $this;
  160.     }
  161.     public function getCurrency(): ?Currency
  162.     {
  163.         return $this->currency;
  164.     }
  165.     public function setCurrency(?Currency $currency): self
  166.     {
  167.         $this->currency $currency;
  168.         return $this;
  169.     }
  170.     public function getExchangeRate(): ?string
  171.     {
  172.         return $this->exchangeRate;
  173.     }
  174.     public function setExchangeRate(string $exchangeRate): self
  175.     {
  176.         $this->exchangeRate $exchangeRate;
  177.         return $this;
  178.     }
  179.     /**
  180.      * @return Collection<int, Payment>
  181.      */
  182.     public function getPayments(): Collection
  183.     {
  184.         return $this->payments;
  185.     }
  186.     public function addPayment(Payment $payment): self
  187.     {
  188.         if (!$this->payments->contains($payment)) {
  189.             $this->payments[] = $payment;
  190.             $payment->setFacturiHeader($this);
  191.         }
  192.         return $this;
  193.     }
  194.     public function removePayment(Payment $payment): self
  195.     {
  196.         if ($this->payments->removeElement($payment)) {
  197.             // set the owning side to null (unless already changed)
  198.             if ($payment->getFacturiHeader() === $this) {
  199.                 $payment->setFacturiHeader(null);
  200.             }
  201.         }
  202.         return $this;
  203.     }
  204.     /**
  205.      * @return bool
  206.      */
  207.     public function isFgoExported(): bool
  208.     {
  209.         return $this->fgoExported;
  210.     }
  211.     /**
  212.      * @param bool $fgoExported
  213.      */
  214.     public function setFgoExported(bool $fgoExported): void
  215.     {
  216.         $this->fgoExported $fgoExported;
  217.     }
  218.     /**
  219.      * @return string
  220.      */
  221.     public function getFgoLink(): string
  222.     {
  223.         return $this->fgoLink;
  224.     }
  225.     /**
  226.      * @param string $fgoLink
  227.      */
  228.     public function setFgoLink(string $fgoLink): void
  229.     {
  230.         $this->fgoLink $fgoLink;
  231.     }
  232. }