src/Entity/Invoice.php line 14

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\HasLifecycleCallbacks]
  9. #[ORM\Entity(repositoryClassInvoiceRepository::class)]
  10. class Invoice
  11. {
  12.     use IdentifiableTrait;
  13.     #[ORM\Column(length255)]
  14.     private ?string $invoiceNumber null;
  15.     #[ORM\ManyToOne(inversedBy'invoices')]
  16.     private ?Assignment $assignment null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $invoiceDate null;
  19.     #[ORM\ManyToOne(inversedBy'invoices')]
  20.     private ?Prescriber $prescriber null;
  21.     #[ORM\ManyToOne(inversedBy'invoices')]
  22.     private ?Commercial $commercial null;
  23.     #[ORM\ManyToOne(inversedBy'invoices')]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?Customer $customer null;
  26.     #[ORM\OneToMany(mappedBy'invoice'targetEntityInvoiceLine::class, cascade: ['remove'], orphanRemovaltrue)]
  27.     private Collection $invoiceLines;
  28.     #[ORM\ManyToOne(inversedBy'invoices')]
  29.     #[ORM\JoinColumn(nullablefalse)]
  30.     private ?Warehouse $warehouse null;
  31.     #[ORM\ManyToOne(inversedBy'invoices')]
  32.     private ?BillingCenter $billingCenter null;
  33.     #[ORM\Column]
  34.     private ?int $productQuantity null;
  35.     #[ORM\Column]
  36.     private ?float $totalProductsWithoutTax null;
  37.     #[ORM\Column]
  38.     private ?float $shippingCostWithoutTax null;
  39.     #[ORM\Column]
  40.     private ?float $ShippingTaxCost null;
  41.     #[ORM\Column]
  42.     private ?float $totalProductTaxes null;
  43.     #[ORM\ManyToOne(inversedBy'prescriberValidatedInvoices')]
  44.     private ?User $prescriberValidationUser null;
  45.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  46.     private ?\DateTimeInterface $prescriberValidatedDate null;
  47.     #[ORM\Column(length255nullabletrue)]
  48.     private ?string $businessNumber null;
  49.     #[ORM\ManyToOne(inversedBy'invoices')]
  50.     #[ORM\JoinColumn(nullablefalse)]
  51.     private ?Currency $currency null;
  52.     #[ORM\ManyToOne(inversedBy'invoices')]
  53.     private ?InvoiceAffectation $affectation null;
  54.     #[ORM\OneToMany(mappedBy'invoice'targetEntityPrescriberPoint::class)]
  55.     private Collection $prescriberPoints;
  56.     #[ORM\Column(length255nullabletrue)]
  57.     private ?string $commentary null;
  58.     #[ORM\Column(nullabletrue)]
  59.     private ?float $discountPoints null;
  60.     #[ORM\Column(nullabletrue)]
  61.     private ?float $currencyRate null;
  62.     #[ORM\Column(nullabletrue)]
  63.     private ?float $discountPointsUsed null;
  64.     #[ORM\Column]
  65.     private ?int $productFreeQty null;
  66.     #[ORM\Column]
  67.     private ?int $productSellQty null;
  68.     #[ORM\Column(nullabletrue)]
  69.     private ?bool $isPersonal null;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?bool $hidden null;
  72.     public function __construct()
  73.     {
  74.         $this->invoiceLines     = new ArrayCollection();
  75.         $this->prescriberPoints = new ArrayCollection();
  76.     }
  77.     public function getId(): ?int
  78.     {
  79.         return $this->id;
  80.     }
  81.     public function getAssignment(): ?Assignment
  82.     {
  83.         return $this->assignment;
  84.     }
  85.     public function setAssignment(?Assignment $assignment): self
  86.     {
  87.         $this->assignment $assignment;
  88.         return $this;
  89.     }
  90.     public function getInvoiceDate(): ?\DateTimeInterface
  91.     {
  92.         return $this->invoiceDate;
  93.     }
  94.     public function setInvoiceDate(\DateTimeInterface $invoiceDate): self
  95.     {
  96.         $this->invoiceDate $invoiceDate;
  97.         return $this;
  98.     }
  99.     public function getPrescriber(): ?Prescriber
  100.     {
  101.         return $this->prescriber;
  102.     }
  103.     public function setPrescriber(?Prescriber $prescriber): self
  104.     {
  105.         $this->prescriber $prescriber;
  106.         return $this;
  107.     }
  108.     public function getCustomer(): ?Customer
  109.     {
  110.         return $this->customer;
  111.     }
  112.     public function setCustomer(?Customer $customer): self
  113.     {
  114.         $this->customer $customer;
  115.         return $this;
  116.     }
  117.     /**
  118.      * @return Collection<int, InvoiceLine>
  119.      */
  120.     public function getInvoiceLines(): Collection
  121.     {
  122.         return $this->invoiceLines;
  123.     }
  124.     public function addInvoiceLine(InvoiceLine $invoiceLine): self
  125.     {
  126.         if (!$this->invoiceLines->contains($invoiceLine)) {
  127.             $this->invoiceLines->add($invoiceLine);
  128.             $invoiceLine->setInvoice($this);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeInvoiceLine(InvoiceLine $invoiceLine): self
  133.     {
  134.         if ($this->invoiceLines->removeElement($invoiceLine)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($invoiceLine->getInvoice() === $this) {
  137.                 $invoiceLine->setInvoice(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142.     public function getInvoiceNumber(): ?string
  143.     {
  144.         return $this->invoiceNumber;
  145.     }
  146.     public function setInvoiceNumber(string $invoiceNumber): self
  147.     {
  148.         $this->invoiceNumber $invoiceNumber;
  149.         return $this;
  150.     }
  151.     public function getWarehouse(): ?Warehouse
  152.     {
  153.         return $this->warehouse;
  154.     }
  155.     public function setWarehouse(?Warehouse $warehouse): self
  156.     {
  157.         $this->warehouse $warehouse;
  158.         return $this;
  159.     }
  160.     public function getBillingCenter(): ?BillingCenter
  161.     {
  162.         return $this->billingCenter;
  163.     }
  164.     public function setBillingCenter(?BillingCenter $billingCenter): self
  165.     {
  166.         $this->billingCenter $billingCenter;
  167.         return $this;
  168.     }
  169.     public function getProductQuantity(): ?int
  170.     {
  171.         return $this->productQuantity;
  172.     }
  173.     public function setProductQuantity(int $productQuantity): self
  174.     {
  175.         $this->productQuantity $productQuantity;
  176.         return $this;
  177.     }
  178.     public function getTotalProductsWithoutTax(): ?float
  179.     {
  180.         return $this->totalProductsWithoutTax;
  181.     }
  182.     public function setTotalProductsWithoutTax(float $totalProductsWithoutTax): self
  183.     {
  184.         $this->totalProductsWithoutTax $totalProductsWithoutTax;
  185.         return $this;
  186.     }
  187.     public function getShippingCostWithoutTax(): ?float
  188.     {
  189.         return $this->shippingCostWithoutTax;
  190.     }
  191.     public function setShippingCostWithoutTax(float $shippingCostWithoutTax): self
  192.     {
  193.         $this->shippingCostWithoutTax $shippingCostWithoutTax;
  194.         return $this;
  195.     }
  196.     public function getShippingTaxCost(): ?float
  197.     {
  198.         return $this->ShippingTaxCost;
  199.     }
  200.     public function setShippingTaxCost(float $ShippingTaxCost): self
  201.     {
  202.         $this->ShippingTaxCost $ShippingTaxCost;
  203.         return $this;
  204.     }
  205.     public function getTotalProductTaxes(): ?float
  206.     {
  207.         return $this->totalProductTaxes;
  208.     }
  209.     public function setTotalProductTaxes(float $totalProductTaxes): self
  210.     {
  211.         $this->totalProductTaxes $totalProductTaxes;
  212.         return $this;
  213.     }
  214.     public function getTotalProductsAndShippingCostTTC(): ?float
  215.     {
  216.         return ($this->totalProductsWithoutTax $this->totalProductTaxes $this->shippingCostWithoutTax $this->ShippingTaxCost);
  217.     }
  218.     public function getCommercial(): ?Commercial
  219.     {
  220.         return $this->commercial;
  221.     }
  222.     public function setCommercial(?Commercial $commercial): self
  223.     {
  224.         $this->commercial $commercial;
  225.         return $this;
  226.     }
  227.     public function getPrescriberValidationUser(): ?User
  228.     {
  229.         return $this->prescriberValidationUser;
  230.     }
  231.     public function setPrescriberValidationUser(?User $prescriberValidationUser): self
  232.     {
  233.         $this->prescriberValidationUser $prescriberValidationUser;
  234.         return $this;
  235.     }
  236.     public function getPrescriberValidatedDate(): ?\DateTimeInterface
  237.     {
  238.         return $this->prescriberValidatedDate;
  239.     }
  240.     public function setPrescriberValidatedDate(?\DateTimeInterface $prescriberValidatedDate): self
  241.     {
  242.         $this->prescriberValidatedDate $prescriberValidatedDate;
  243.         return $this;
  244.     }
  245.     public function getBusinessNumber(): ?string
  246.     {
  247.         return $this->businessNumber;
  248.     }
  249.     public function setBusinessNumber(?string $businessNumber): self
  250.     {
  251.         $this->businessNumber $businessNumber;
  252.         return $this;
  253.     }
  254.     public function getCurrency(): ?Currency
  255.     {
  256.         return $this->currency;
  257.     }
  258.     public function setCurrency(?Currency $currency): self
  259.     {
  260.         $this->currency $currency;
  261.         return $this;
  262.     }
  263.     public function getAffectation(): ?InvoiceAffectation
  264.     {
  265.         return $this->affectation;
  266.     }
  267.     public function setAffectation(?InvoiceAffectation $affectation): self
  268.     {
  269.         $this->affectation $affectation;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return Collection<int, PrescriberPoint>
  274.      */
  275.     public function getPrescriberPoints(): Collection
  276.     {
  277.         return $this->prescriberPoints;
  278.     }
  279.     public function addPrescriberPoint(PrescriberPoint $prescriberPoint): self
  280.     {
  281.         if (!$this->prescriberPoints->contains($prescriberPoint)) {
  282.             $this->prescriberPoints->add($prescriberPoint);
  283.             $prescriberPoint->setInvoice($this);
  284.         }
  285.         return $this;
  286.     }
  287.     public function removePrescriberPoint(PrescriberPoint $prescriberPoint): self
  288.     {
  289.         if ($this->prescriberPoints->removeElement($prescriberPoint)) {
  290.             // set the owning side to null (unless already changed)
  291.             if ($prescriberPoint->getInvoice() === $this) {
  292.                 $prescriberPoint->setInvoice(null);
  293.             }
  294.         }
  295.         return $this;
  296.     }
  297.     public function getCommentary(): ?string
  298.     {
  299.         return $this->commentary;
  300.     }
  301.     public function setCommentary(?string $commentary): self
  302.     {
  303.         $this->commentary $commentary;
  304.         return $this;
  305.     }
  306.     public function getDiscountPoints(): ?float
  307.     {
  308.         return $this->discountPoints;
  309.     }
  310.     public function setDiscountPoints(?float $discountPoints): self
  311.     {
  312.         $this->discountPoints $discountPoints;
  313.         return $this;
  314.     }
  315.     public function getCurrencyRate(): ?float
  316.     {
  317.         return $this->currencyRate;
  318.     }
  319.     public function setCurrencyRate(?float $currencyRate): self
  320.     {
  321.         $this->currencyRate $currencyRate;
  322.         return $this;
  323.     }
  324.     public function getDiscountPointsUsed(): ?float
  325.     {
  326.         return $this->discountPointsUsed;
  327.     }
  328.     public function setDiscountPointsUsed(?float $discountPointsUsed): self
  329.     {
  330.         $this->discountPointsUsed $discountPointsUsed;
  331.         return $this;
  332.     }
  333.     public function getProductFreeQty(): ?int
  334.     {
  335.         return $this->productFreeQty;
  336.     }
  337.     public function setProductFreeQty(int $productFreeQty): self
  338.     {
  339.         $this->productFreeQty $productFreeQty;
  340.         return $this;
  341.     }
  342.     public function getProductSellQty(): ?int
  343.     {
  344.         return $this->productSellQty;
  345.     }
  346.     public function setProductSellQty(int $productSellQty): self
  347.     {
  348.         $this->productSellQty $productSellQty;
  349.         return $this;
  350.     }
  351.     public function isIsPersonal(): ?bool
  352.     {
  353.         return $this->isPersonal;
  354.     }
  355.     public function setIsPersonal(?bool $isPersonal): self
  356.     {
  357.         $this->isPersonal $isPersonal;
  358.         return $this;
  359.     }
  360.     public function isHidden(): ?bool
  361.     {
  362.         return $this->hidden;
  363.     }
  364.     public function setHidden(?bool $hidden): static
  365.     {
  366.         $this->hidden $hidden;
  367.         return $this;
  368.     }
  369. }