src/Entity/Invoice.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\InvoiceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassInvoiceRepository::class)]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Invoice
  11. {
  12.     use \App\Traits\EntityDateTimeAbleTrait;
  13.     
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\ManyToOne(inversedBy'invoices')]
  19.     private ?Program $program null;
  20.     #[ORM\ManyToOne(inversedBy'invoices')]
  21.     private ?Billing $billing null;
  22.     #[ORM\Column(nullabletrue)]
  23.     private ?float $price null;
  24.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  25.     private ?\DateTimeInterface $startDate null;
  26.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  27.     private ?\DateTimeInterface $endDate null;
  28.     #[ORM\Column(nullabletrue)]
  29.     private ?int $method null;
  30.     #[ORM\Column(nullabletrue)]
  31.     private ?float $fixPrice null;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?int $paymentDeadline null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     private ?string $name null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $number null;
  38.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  39.     private ?\DateTimeInterface $invoiceDate null;
  40.     #[ORM\ManyToOne(inversedBy'invoices')]
  41.     private ?InvoiceAddress $address null;
  42.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  43.     private ?string $note null;
  44.     #[ORM\Column(length255nullabletrue)]
  45.     private ?string $orderNumber null;
  46.     #[ORM\Column(nullabletrue)]
  47.     private ?float $amount null;
  48.     #[ORM\Column(nullabletrue)]
  49.     private ?float $vat null;
  50.     #[ORM\Column(nullabletrue)]
  51.     private ?float $totalTTC null;
  52.     #[ORM\Column(nullabletrue)]
  53.     private ?int $paymentMethod null;
  54.     #[ORM\Column(nullabletrue)]
  55.     private ?int $year null;
  56.     #[ORM\ManyToOne(inversedBy'invoices')]
  57.     private ?Bank $bank null;
  58.     #[ORM\OneToMany(mappedBy'invoice'targetEntityPayment::class, orphanRemovaltruecascade: ['persist''remove'])]
  59.     private Collection $payments;
  60.     #[ORM\ManyToOne(inversedBy'invoices')]
  61.     private ?InvoiceContact $invoiceContact null;
  62.     #[ORM\ManyToOne(inversedBy'invoices')]
  63.     private ?InvoicedEntity $invoicedEntity null;
  64.     #[ORM\OneToMany(mappedBy'invoice'targetEntityInvoicedEntity::class)]
  65.     private Collection $invoicedEntities;
  66.     #[ORM\OneToOne(mappedBy'invoice'cascade: ['persist''remove'])]
  67.     private ?InvoiceInfo $invoiceInfo null;
  68.     #[ORM\Column(nullabletrue)]
  69.     private ?int $receipt null;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?float $totalTH null;
  72.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  73.     private ?\DateTimeInterface $activeDate null;
  74.     public function __construct()
  75.     {
  76.         $this->payments = new ArrayCollection();
  77.         $this->invoicedEntities = new ArrayCollection();
  78.     }
  79.     public function getId(): ?int
  80.     {
  81.         return $this->id;
  82.     }
  83.     public function getProgram(): ?Program
  84.     {
  85.         return $this->program;
  86.     }
  87.     public function setProgram(?Program $program): static
  88.     {
  89.         $this->program $program;
  90.         return $this;
  91.     }
  92.     public function getBilling(): ?Billing
  93.     {
  94.         return $this->billing;
  95.     }
  96.     public function setBilling(?Billing $billing): static
  97.     {
  98.         $this->billing $billing;
  99.         return $this;
  100.     }
  101.     public function getPrice(): ?float
  102.     {
  103.         return $this->price;
  104.     }
  105.     public function setPrice(?float $price): static
  106.     {
  107.         $this->price $price;
  108.         return $this;
  109.     }
  110.     public function getStartDate(): ?\DateTimeInterface
  111.     {
  112.         return $this->startDate;
  113.     }
  114.     public function setStartDate(?\DateTimeInterface $startDate): static
  115.     {
  116.         $this->startDate $startDate;
  117.         return $this;
  118.     }
  119.     public function getEndDate(): ?\DateTimeInterface
  120.     {
  121.         return $this->endDate;
  122.     }
  123.     public function setEndDate(?\DateTimeInterface $endDate): static
  124.     {
  125.         $this->endDate $endDate;
  126.         return $this;
  127.     }
  128.     public function getMethod(): ?int
  129.     {
  130.         return $this->method;
  131.     }
  132.     public function setMethod(?int $method): static
  133.     {
  134.         $this->method $method;
  135.         return $this;
  136.     }
  137.     public function getFixPrice(): ?float
  138.     {
  139.         return $this->fixPrice;
  140.     }
  141.     public function setFixPrice(?float $fixPrice): static
  142.     {
  143.         $this->fixPrice $fixPrice;
  144.         return $this;
  145.     }
  146.     public function getPaymentDeadline(): ?int
  147.     {
  148.         return $this->paymentDeadline;
  149.     }
  150.     public function setPaymentDeadline(?int $paymentDeadline): static
  151.     {
  152.         $this->paymentDeadline $paymentDeadline;
  153.         return $this;
  154.     }
  155.     public function getName(): ?string
  156.     {
  157.         return $this->name;
  158.     }
  159.     public function setName(?string $name): static
  160.     {
  161.         $this->name $name;
  162.         return $this;
  163.     }
  164.     public function getNumber(): ?string
  165.     {
  166.         return $this->number;
  167.     }
  168.     public function setNumber(?string $number): static
  169.     {
  170.         $this->number $number;
  171.         return $this;
  172.     }
  173.     public function getInvoiceDate(): ?\DateTimeInterface
  174.     {
  175.         return $this->invoiceDate;
  176.     }
  177.     public function setInvoiceDate(\DateTimeInterface $invoiceDate): static
  178.     {
  179.         $this->invoiceDate $invoiceDate;
  180.         return $this;
  181.     }
  182.     public function getAddress(): ?InvoiceAddress
  183.     {
  184.         return $this->address;
  185.     }
  186.     public function setAddress(?InvoiceAddress $address): static
  187.     {
  188.         $this->address $address;
  189.         return $this;
  190.     }
  191.     public function getNote(): ?string
  192.     {
  193.         return $this->note;
  194.     }
  195.     public function setNote(?string $note): static
  196.     {
  197.         $this->note $note;
  198.         return $this;
  199.     }
  200.     public function getOrderNumber(): ?string
  201.     {
  202.         return $this->orderNumber;
  203.     }
  204.     public function setOrderNumber(?string $orderNumber): static
  205.     {
  206.         $this->orderNumber $orderNumber;
  207.         return $this;
  208.     }
  209.     public function getAmount(): ?float
  210.     {
  211.         return $this->amount;
  212.     }
  213.     public function setAmount(?float $amount): static
  214.     {
  215.         $this->amount $amount;
  216.         return $this;
  217.     }
  218.     public function getVat(): ?float
  219.     {
  220.         return $this->vat;
  221.     }
  222.     public function setVat(?float $vat): static
  223.     {
  224.         $this->vat $vat;
  225.         return $this;
  226.     }
  227.     public function getTotalTTC(): ?float
  228.     {
  229.         return $this->totalTTC;
  230.     }
  231.     public function setTotalTTC(?float $totalTTC): static
  232.     {
  233.         $this->totalTTC $totalTTC;
  234.         return $this;
  235.     }
  236.     public function getPaymentMethod(): ?int
  237.     {
  238.         return $this->paymentMethod;
  239.     }
  240.     public function setPaymentMethod(?int $paymentMethod): static
  241.     {
  242.         $this->paymentMethod $paymentMethod;
  243.         return $this;
  244.     }
  245.     public function getYear(): ?int
  246.     {
  247.         return $this->year;
  248.     }
  249.     public function setYear(?int $year): static
  250.     {
  251.         $this->year $year;
  252.         return $this;
  253.     }
  254.     public function getBank(): ?Bank
  255.     {
  256.         return $this->bank;
  257.     }
  258.     public function setBank(?Bank $bank): static
  259.     {
  260.         $this->bank $bank;
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return Collection<int, Payment>
  265.      */
  266.     public function getPayments(): Collection
  267.     {
  268.         return $this->payments;
  269.     }
  270.     public function addPayment(Payment $payment): static
  271.     {
  272.         if (!$this->payments->contains($payment)) {
  273.             $this->payments->add($payment);
  274.             $payment->setInvoice($this);
  275.         }
  276.         return $this;
  277.     }
  278.     public function removePayment(Payment $payment): static
  279.     {
  280.         if ($this->payments->removeElement($payment)) {
  281.             // set the owning side to null (unless already changed)
  282.             if ($payment->getInvoice() === $this) {
  283.                 $payment->setInvoice(null);
  284.             }
  285.         }
  286.         return $this;
  287.     }
  288.     public function getInvoiceContact(): ?InvoiceContact
  289.     {
  290.         return $this->invoiceContact;
  291.     }
  292.     public function setInvoiceContact(?InvoiceContact $invoiceContact): static
  293.     {
  294.         $this->invoiceContact $invoiceContact;
  295.         return $this;
  296.     }
  297.     public function getInvoicedEntity(): ?InvoicedEntity
  298.     {
  299.         return $this->invoicedEntity;
  300.     }
  301.     public function setInvoicedEntity(?InvoicedEntity $invoicedEntity): static
  302.     {
  303.         $this->invoicedEntity $invoicedEntity;
  304.         return $this;
  305.     }
  306.     /**
  307.      * @return Collection<int, InvoicedEntity>
  308.      */
  309.     public function getInvoicedEntities(): Collection
  310.     {
  311.         return $this->invoicedEntities;
  312.     }
  313.     public function addInvoicedEntity(InvoicedEntity $invoicedEntity): static
  314.     {
  315.         if (!$this->invoicedEntities->contains($invoicedEntity)) {
  316.             $this->invoicedEntities->add($invoicedEntity);
  317.             $invoicedEntity->setInvoice($this);
  318.         }
  319.         return $this;
  320.     }
  321.     public function removeInvoicedEntity(InvoicedEntity $invoicedEntity): static
  322.     {
  323.         if ($this->invoicedEntities->removeElement($invoicedEntity)) {
  324.             // set the owning side to null (unless already changed)
  325.             if ($invoicedEntity->getInvoice() === $this) {
  326.                 $invoicedEntity->setInvoice(null);
  327.             }
  328.         }
  329.         return $this;
  330.     }
  331.     public function getInvoiceInfo(): ?InvoiceInfo
  332.     {
  333.         return $this->invoiceInfo;
  334.     }
  335.     public function setInvoiceInfo(?InvoiceInfo $invoiceInfo): static
  336.     {
  337.         // unset the owning side of the relation if necessary
  338.         if ($invoiceInfo === null && $this->invoiceInfo !== null) {
  339.             $this->invoiceInfo->setInvoice(null);
  340.         }
  341.         // set the owning side of the relation if necessary
  342.         if ($invoiceInfo !== null && $invoiceInfo->getInvoice() !== $this) {
  343.             $invoiceInfo->setInvoice($this);
  344.         }
  345.         $this->invoiceInfo $invoiceInfo;
  346.         return $this;
  347.     }
  348.     public function getReceipt(): ?int
  349.     {
  350.         return $this->receipt;
  351.     }
  352.     public function setReceipt(?int $receipt): static
  353.     {
  354.         $this->receipt $receipt;
  355.         return $this;
  356.     }
  357.     public function getTotalTH(): ?float
  358.     {
  359.         return $this->totalTH;
  360.     }
  361.     public function setTotalTH(?float $totalTH): static
  362.     {
  363.         $this->totalTH $totalTH;
  364.         return $this;
  365.     }
  366.     public function getActiveDate(): ?\DateTimeInterface
  367.     {
  368.         return $this->activeDate;
  369.     }
  370.     public function setActiveDate(?\DateTimeInterface $activeDate): static
  371.     {
  372.         $this->activeDate $activeDate;
  373.         return $this;
  374.     }
  375. }