src/Entity/CRM/Instalments.php line 11

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Entity\CRM\Order;
  4. use App\Repository\InstalmentsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassInstalmentsRepository::class)]
  8. class Instalments
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column]
  15.     private ?float $amount null;
  16.     #[ORM\Column]
  17.     private ?int $number null;
  18.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  19.     private ?\DateTimeInterface $paymentDate null;
  20.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  21.     private ?\DateTimeInterface $paymentTerm;
  22.     #[ORM\Column(nullabletrue)]
  23.     private bool $paid false;
  24.     #[ORM\ManyToOne(inversedBy'instalments')]
  25.     private ?Order $orderInstance null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $fv null;
  28.     #[ORM\Column]
  29.     private float $administrationFee 0;
  30.     private string $instalmentNumberInRelationToInstalmentsCount;
  31.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  32.     private ?\DateTimeInterface $dateAdded null;
  33.     #[ORM\Column]
  34.     private bool $received false;
  35.     public function __construct()
  36.     {
  37.         $this->received false;
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getNumber(): ?int
  44.     {
  45.         return $this->number;
  46.     }
  47.     public function setNumber(int $number): static
  48.     {
  49.         $this->number $number;
  50.         return $this;
  51.     }
  52.     public function getAmount(): ?float
  53.     {
  54.         return $this->amount;
  55.     }
  56.     public function setAmount(float $amount): static
  57.     {
  58.         $this->amount $amount;
  59.         return $this;
  60.     }
  61.     public function getPaymentDate(): ?\DateTimeInterface
  62.     {
  63.         return $this->paymentDate;
  64.     }
  65.     public function setPaymentDate(?\DateTimeInterface $paymentDate): static
  66.     {
  67.         $this->paymentDate $paymentDate;
  68.         return $this;
  69.     }
  70.     public function getPaymentTerm(): ?\DateTimeInterface
  71.     {
  72.         return $this->paymentTerm;
  73.     }
  74.     public function setPaymentTerm(?\DateTimeInterface $paymentTerm): static
  75.     {
  76.         $this->paymentTerm $paymentTerm;
  77.         return $this;
  78.     }
  79.     public function isPaid(): ?bool
  80.     {
  81.         return $this->paid;
  82.     }
  83.     public function setPaid(bool $paid): static
  84.     {
  85.         $this->paid $paid;
  86.         return $this;
  87.     }
  88.     public function getOrderInstance(): ?Order
  89.     {
  90.         return $this->orderInstance;
  91.     }
  92.     public function setOrderInstance(?Order $orderInstance): static
  93.     {
  94.         $this->orderInstance $orderInstance;
  95.         return $this;
  96.     }
  97.     public function getFv(): ?string
  98.     {
  99.         return $this->fv;
  100.     }
  101.     public function setFv(?string $fv): static
  102.     {
  103.         $this->fv $fv;
  104.         return $this;
  105.     }
  106.     public function getAdministrationFee(): float
  107.     {
  108.         return $this->administrationFee;
  109.     }
  110.     public function setAdministrationFee(float $administrationFee): static
  111.     {
  112.         $this->administrationFee $administrationFee;
  113.         return $this;
  114.     }
  115.     public function getInstalmentNumberInRelationToInstalmentsCount(): string
  116.     {
  117.         return $this->number '/' count($this->orderInstance->getInstalments());
  118.     }
  119.     public function getDateAdded(): ?\DateTimeInterface
  120.     {
  121.         return $this->dateAdded;
  122.     }
  123.     public function setDateAdded(?\DateTimeInterface $dateAdded): static
  124.     {
  125.         $this->dateAdded $dateAdded;
  126.         return $this;
  127.     }
  128.     public function isReceived(): bool
  129.     {
  130.         return $this->received;
  131.     }
  132.     public function setReceived(bool $received): static
  133.     {
  134.         $this->received $received;
  135.         return $this;
  136.     }
  137. }