<?phpnamespace App\Entity;use App\Repository\InvoiceRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\HasLifecycleCallbacks]#[ORM\Entity(repositoryClass: InvoiceRepository::class)]class Invoice{ use IdentifiableTrait; #[ORM\Column(length: 255)] private ?string $invoiceNumber = null; #[ORM\ManyToOne(inversedBy: 'invoices')] private ?Assignment $assignment = null; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $invoiceDate = null; #[ORM\ManyToOne(inversedBy: 'invoices')] private ?Prescriber $prescriber = null; #[ORM\ManyToOne(inversedBy: 'invoices')] private ?Commercial $commercial = null; #[ORM\ManyToOne(inversedBy: 'invoices')] #[ORM\JoinColumn(nullable: false)] private ?Customer $customer = null; #[ORM\OneToMany(mappedBy: 'invoice', targetEntity: InvoiceLine::class, cascade: ['remove'], orphanRemoval: true)] private Collection $invoiceLines; #[ORM\ManyToOne(inversedBy: 'invoices')] #[ORM\JoinColumn(nullable: false)] private ?Warehouse $warehouse = null; #[ORM\ManyToOne(inversedBy: 'invoices')] private ?BillingCenter $billingCenter = null; #[ORM\Column] private ?int $productQuantity = null; #[ORM\Column] private ?float $totalProductsWithoutTax = null; #[ORM\Column] private ?float $shippingCostWithoutTax = null; #[ORM\Column] private ?float $ShippingTaxCost = null; #[ORM\Column] private ?float $totalProductTaxes = null; #[ORM\ManyToOne(inversedBy: 'prescriberValidatedInvoices')] private ?User $prescriberValidationUser = null; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $prescriberValidatedDate = null; #[ORM\Column(length: 255, nullable: true)] private ?string $businessNumber = null; #[ORM\ManyToOne(inversedBy: 'invoices')] #[ORM\JoinColumn(nullable: false)] private ?Currency $currency = null; #[ORM\ManyToOne(inversedBy: 'invoices')] private ?InvoiceAffectation $affectation = null; #[ORM\OneToMany(mappedBy: 'invoice', targetEntity: PrescriberPoint::class)] private Collection $prescriberPoints; #[ORM\Column(length: 255, nullable: true)] private ?string $commentary = null; #[ORM\Column(nullable: true)] private ?float $discountPoints = null; #[ORM\Column(nullable: true)] private ?float $currencyRate = null; #[ORM\Column(nullable: true)] private ?float $discountPointsUsed = null; #[ORM\Column] private ?int $productFreeQty = null; #[ORM\Column] private ?int $productSellQty = null; #[ORM\Column(nullable: true)] private ?bool $isPersonal = null; #[ORM\Column(nullable: true)] private ?bool $hidden = null; public function __construct() { $this->invoiceLines = new ArrayCollection(); $this->prescriberPoints = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getAssignment(): ?Assignment { return $this->assignment; } public function setAssignment(?Assignment $assignment): self { $this->assignment = $assignment; return $this; } public function getInvoiceDate(): ?\DateTimeInterface { return $this->invoiceDate; } public function setInvoiceDate(\DateTimeInterface $invoiceDate): self { $this->invoiceDate = $invoiceDate; return $this; } public function getPrescriber(): ?Prescriber { return $this->prescriber; } public function setPrescriber(?Prescriber $prescriber): self { $this->prescriber = $prescriber; return $this; } public function getCustomer(): ?Customer { return $this->customer; } public function setCustomer(?Customer $customer): self { $this->customer = $customer; return $this; } /** * @return Collection<int, InvoiceLine> */ public function getInvoiceLines(): Collection { return $this->invoiceLines; } public function addInvoiceLine(InvoiceLine $invoiceLine): self { if (!$this->invoiceLines->contains($invoiceLine)) { $this->invoiceLines->add($invoiceLine); $invoiceLine->setInvoice($this); } return $this; } public function removeInvoiceLine(InvoiceLine $invoiceLine): self { if ($this->invoiceLines->removeElement($invoiceLine)) { // set the owning side to null (unless already changed) if ($invoiceLine->getInvoice() === $this) { $invoiceLine->setInvoice(null); } } return $this; } public function getInvoiceNumber(): ?string { return $this->invoiceNumber; } public function setInvoiceNumber(string $invoiceNumber): self { $this->invoiceNumber = $invoiceNumber; return $this; } public function getWarehouse(): ?Warehouse { return $this->warehouse; } public function setWarehouse(?Warehouse $warehouse): self { $this->warehouse = $warehouse; return $this; } public function getBillingCenter(): ?BillingCenter { return $this->billingCenter; } public function setBillingCenter(?BillingCenter $billingCenter): self { $this->billingCenter = $billingCenter; return $this; } public function getProductQuantity(): ?int { return $this->productQuantity; } public function setProductQuantity(int $productQuantity): self { $this->productQuantity = $productQuantity; return $this; } public function getTotalProductsWithoutTax(): ?float { return $this->totalProductsWithoutTax; } public function setTotalProductsWithoutTax(float $totalProductsWithoutTax): self { $this->totalProductsWithoutTax = $totalProductsWithoutTax; return $this; } public function getShippingCostWithoutTax(): ?float { return $this->shippingCostWithoutTax; } public function setShippingCostWithoutTax(float $shippingCostWithoutTax): self { $this->shippingCostWithoutTax = $shippingCostWithoutTax; return $this; } public function getShippingTaxCost(): ?float { return $this->ShippingTaxCost; } public function setShippingTaxCost(float $ShippingTaxCost): self { $this->ShippingTaxCost = $ShippingTaxCost; return $this; } public function getTotalProductTaxes(): ?float { return $this->totalProductTaxes; } public function setTotalProductTaxes(float $totalProductTaxes): self { $this->totalProductTaxes = $totalProductTaxes; return $this; } public function getTotalProductsAndShippingCostTTC(): ?float { return ($this->totalProductsWithoutTax + $this->totalProductTaxes + $this->shippingCostWithoutTax + $this->ShippingTaxCost); } public function getCommercial(): ?Commercial { return $this->commercial; } public function setCommercial(?Commercial $commercial): self { $this->commercial = $commercial; return $this; } public function getPrescriberValidationUser(): ?User { return $this->prescriberValidationUser; } public function setPrescriberValidationUser(?User $prescriberValidationUser): self { $this->prescriberValidationUser = $prescriberValidationUser; return $this; } public function getPrescriberValidatedDate(): ?\DateTimeInterface { return $this->prescriberValidatedDate; } public function setPrescriberValidatedDate(?\DateTimeInterface $prescriberValidatedDate): self { $this->prescriberValidatedDate = $prescriberValidatedDate; return $this; } public function getBusinessNumber(): ?string { return $this->businessNumber; } public function setBusinessNumber(?string $businessNumber): self { $this->businessNumber = $businessNumber; return $this; } public function getCurrency(): ?Currency { return $this->currency; } public function setCurrency(?Currency $currency): self { $this->currency = $currency; return $this; } public function getAffectation(): ?InvoiceAffectation { return $this->affectation; } public function setAffectation(?InvoiceAffectation $affectation): self { $this->affectation = $affectation; return $this; } /** * @return Collection<int, PrescriberPoint> */ public function getPrescriberPoints(): Collection { return $this->prescriberPoints; } public function addPrescriberPoint(PrescriberPoint $prescriberPoint): self { if (!$this->prescriberPoints->contains($prescriberPoint)) { $this->prescriberPoints->add($prescriberPoint); $prescriberPoint->setInvoice($this); } return $this; } public function removePrescriberPoint(PrescriberPoint $prescriberPoint): self { if ($this->prescriberPoints->removeElement($prescriberPoint)) { // set the owning side to null (unless already changed) if ($prescriberPoint->getInvoice() === $this) { $prescriberPoint->setInvoice(null); } } return $this; } public function getCommentary(): ?string { return $this->commentary; } public function setCommentary(?string $commentary): self { $this->commentary = $commentary; return $this; } public function getDiscountPoints(): ?float { return $this->discountPoints; } public function setDiscountPoints(?float $discountPoints): self { $this->discountPoints = $discountPoints; return $this; } public function getCurrencyRate(): ?float { return $this->currencyRate; } public function setCurrencyRate(?float $currencyRate): self { $this->currencyRate = $currencyRate; return $this; } public function getDiscountPointsUsed(): ?float { return $this->discountPointsUsed; } public function setDiscountPointsUsed(?float $discountPointsUsed): self { $this->discountPointsUsed = $discountPointsUsed; return $this; } public function getProductFreeQty(): ?int { return $this->productFreeQty; } public function setProductFreeQty(int $productFreeQty): self { $this->productFreeQty = $productFreeQty; return $this; } public function getProductSellQty(): ?int { return $this->productSellQty; } public function setProductSellQty(int $productSellQty): self { $this->productSellQty = $productSellQty; return $this; } public function isIsPersonal(): ?bool { return $this->isPersonal; } public function setIsPersonal(?bool $isPersonal): self { $this->isPersonal = $isPersonal; return $this; } public function isHidden(): ?bool { return $this->hidden; } public function setHidden(?bool $hidden): static { $this->hidden = $hidden; return $this; }}