src/Billing/Entity/InvoiceLine.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Billing\Entity;
  3. use App\Repository\InvoiceLineRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassInvoiceLineRepository::class)]
  7. class InvoiceLine
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'lines')]
  14.     #[ORM\JoinColumn(nullablefalse)]
  15.     private ?Invoice $invoice null;
  16.     #[ORM\Column(length255)]
  17.     private ?string $description null;
  18.     #[ORM\Column]
  19.     private ?int $quantity 1;
  20.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  21.     private ?string $unitPrice null;
  22.     #[ORM\Column(typeTypes::DECIMALprecision5scale2)]
  23.     private ?string $taxRate '0.00'// Percentage, e.g. 20.00 for 20%
  24.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  25.     private ?string $totalHt null;
  26.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  27.     private ?string $totalTtc null;
  28.     // Polymorphic link to related entity (e.g., Inscription ID 123)
  29.     // We store Class + ID. 
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $relatedEntityClass null;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?int $relatedEntityId null;
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getInvoice(): ?Invoice
  39.     {
  40.         return $this->invoice;
  41.     }
  42.     public function setInvoice(?Invoice $invoice): static
  43.     {
  44.         $this->invoice $invoice;
  45.         return $this;
  46.     }
  47.     public function getDescription(): ?string
  48.     {
  49.         return $this->description;
  50.     }
  51.     public function setDescription(string $description): static
  52.     {
  53.         $this->description $description;
  54.         return $this;
  55.     }
  56.     public function getQuantity(): ?int
  57.     {
  58.         return $this->quantity;
  59.     }
  60.     public function setQuantity(int $quantity): static
  61.     {
  62.         $this->quantity $quantity;
  63.         return $this;
  64.     }
  65.     public function getUnitPrice(): ?string
  66.     {
  67.         return $this->unitPrice;
  68.     }
  69.     public function setUnitPrice(string $unitPrice): static
  70.     {
  71.         $this->unitPrice $unitPrice;
  72.         return $this;
  73.     }
  74.     public function getTaxRate(): ?string
  75.     {
  76.         return $this->taxRate;
  77.     }
  78.     public function setTaxRate(string $taxRate): static
  79.     {
  80.         $this->taxRate $taxRate;
  81.         return $this;
  82.     }
  83.     public function getTotalHt(): ?string
  84.     {
  85.         return $this->totalHt;
  86.     }
  87.     public function setTotalHt(string $totalHt): static
  88.     {
  89.         $this->totalHt $totalHt;
  90.         return $this;
  91.     }
  92.     public function getTotalTtc(): ?string
  93.     {
  94.         return $this->totalTtc;
  95.     }
  96.     public function setTotalTtc(string $totalTtc): static
  97.     {
  98.         $this->totalTtc $totalTtc;
  99.         return $this;
  100.     }
  101.     public function getRelatedEntityClass(): ?string
  102.     {
  103.         return $this->relatedEntityClass;
  104.     }
  105.     public function setRelatedEntityClass(?string $relatedEntityClass): static
  106.     {
  107.         $this->relatedEntityClass $relatedEntityClass;
  108.         return $this;
  109.     }
  110.     public function getRelatedEntityId(): ?int
  111.     {
  112.         return $this->relatedEntityId;
  113.     }
  114.     public function setRelatedEntityId(?int $relatedEntityId): static
  115.     {
  116.         $this->relatedEntityId $relatedEntityId;
  117.         return $this;
  118.     }
  119. }