src/Entity/CRM/PurchaseInvoice.php line 14

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\PurchaseInvoiceRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. #[ORM\Entity(repositoryClassPurchaseInvoiceRepository::class)]
  9. #[ORM\Table(name'purchase_invoices')]
  10. #[Vich\Uploadable]
  11. class PurchaseInvoice
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  18.     private ?\DateTimeInterface $receiptDate null;
  19.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  20.     private ?\DateTimeInterface $invoiceDate null;
  21.     #[ORM\Column(length255)]
  22.     private ?string $invoiceNumber null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $companyName null;
  25.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  26.     private ?string $netAmount null;
  27.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  28.     private ?string $notes null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $fileName null;
  31.     #[Vich\UploadableField(mapping'purchase_invoices'fileNameProperty'fileName')]
  32.     private ?File $invoiceFile null;
  33.     #[ORM\ManyToOne(targetEntityBranch::class)]
  34.     #[ORM\JoinColumn(nullablefalse)]
  35.     private ?Branch $branch null;
  36.     #[ORM\ManyToOne(targetEntityAdmin::class)]
  37.     #[ORM\JoinColumn(nullablefalse)]
  38.     private ?Admin $admin null;
  39.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  40.     private ?\DateTimeInterface $createdAt null;
  41.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  42.     private ?\DateTimeInterface $updatedAt null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $type null;
  45.     #[ORM\Column]
  46.     private ?int $registryNumber null;
  47.     #[ORM\Column(length255)]
  48.     private ?string $companyInvoiceName null;
  49.     public function __construct()
  50.     {
  51.         $this->createdAt = new \DateTime();
  52.         $this->updatedAt = new \DateTime();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getReceiptDate(): ?\DateTimeInterface
  59.     {
  60.         return $this->receiptDate;
  61.     }
  62.     public function setReceiptDate(\DateTimeInterface $receiptDate): static
  63.     {
  64.         $this->receiptDate $receiptDate;
  65.         return $this;
  66.     }
  67.     public function getInvoiceDate(): ?\DateTimeInterface
  68.     {
  69.         return $this->invoiceDate;
  70.     }
  71.     public function setInvoiceDate(\DateTimeInterface $invoiceDate): static
  72.     {
  73.         $this->invoiceDate $invoiceDate;
  74.         return $this;
  75.     }
  76.     public function getInvoiceNumber(): ?string
  77.     {
  78.         return $this->invoiceNumber;
  79.     }
  80.     public function setInvoiceNumber(string $invoiceNumber): static
  81.     {
  82.         $this->invoiceNumber $invoiceNumber;
  83.         return $this;
  84.     }
  85.     public function getCompanyName(): ?string
  86.     {
  87.         return $this->companyName;
  88.     }
  89.     public function setCompanyName(string $companyName): static
  90.     {
  91.         $this->companyName $companyName;
  92.         return $this;
  93.     }
  94.     public function getNetAmount(): ?string
  95.     {
  96.         return $this->netAmount;
  97.     }
  98.     public function setNetAmount(string $netAmount): static
  99.     {
  100.         $this->netAmount $netAmount;
  101.         return $this;
  102.     }
  103.     public function getNotes(): ?string
  104.     {
  105.         return $this->notes;
  106.     }
  107.     public function setNotes(?string $notes): static
  108.     {
  109.         $this->notes $notes;
  110.         return $this;
  111.     }
  112.     public function getFileName(): ?string
  113.     {
  114.         return $this->fileName;
  115.     }
  116.     public function setFileName(?string $fileName): static
  117.     {
  118.         $this->fileName $fileName;
  119.         return $this;
  120.     }
  121.     public function getInvoiceFile(): ?File
  122.     {
  123.         return $this->invoiceFile;
  124.     }
  125.     public function setInvoiceFile(?File $invoiceFile null): void
  126.     {
  127.         $this->invoiceFile $invoiceFile;
  128.         if (null !== $invoiceFile) {
  129.             $this->updatedAt = new \DateTime();
  130.         }
  131.     }
  132.     public function getBranch(): ?Branch
  133.     {
  134.         return $this->branch;
  135.     }
  136.     public function setBranch(?Branch $branch): static
  137.     {
  138.         $this->branch $branch;
  139.         return $this;
  140.     }
  141.     public function getAdmin(): ?Admin
  142.     {
  143.         return $this->admin;
  144.     }
  145.     public function setAdmin(?Admin $admin): static
  146.     {
  147.         $this->admin $admin;
  148.         return $this;
  149.     }
  150.     public function getCreatedAt(): ?\DateTimeInterface
  151.     {
  152.         return $this->createdAt;
  153.     }
  154.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  155.     {
  156.         $this->createdAt $createdAt;
  157.         return $this;
  158.     }
  159.     public function getUpdatedAt(): ?\DateTimeInterface
  160.     {
  161.         return $this->updatedAt;
  162.     }
  163.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  164.     {
  165.         $this->updatedAt $updatedAt;
  166.         return $this;
  167.     }
  168.     public function __toString(): string
  169.     {
  170.         return sprintf('%s - %s'$this->invoiceNumber$this->companyName);
  171.     }
  172.     public function getType(): ?string
  173.     {
  174.         return $this->type;
  175.     }
  176.     public function setType(?string $type): static
  177.     {
  178.         $this->type $type;
  179.         return $this;
  180.     }
  181.     public function getRegistryNumber(): ?int
  182.     {
  183.         return $this->registryNumber;
  184.     }
  185.     public function setRegistryNumber(int $registryNumber): static
  186.     {
  187.         $this->registryNumber $registryNumber;
  188.         return $this;
  189.     }
  190.     public function getCompanyInvoiceName(): ?string
  191.     {
  192.         return $this->companyInvoiceName;
  193.     }
  194.     public function setCompanyInvoiceName(string $companyInvoiceName): static
  195.     {
  196.         $this->companyInvoiceName $companyInvoiceName;
  197.         return $this;
  198.     }
  199. }