<?php
namespace App\Entity;
use App\Repository\AccountingStudentRegistrationFeeShedulRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AccountingStudentRegistrationFeeShedulRepository::class)
*/
class AccountingStudentRegistrationFeeShedul
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="accountingStudentRegistrationFeeSheduls")
* @ORM\JoinColumn(nullable=false)
*/
private $establishment;
/**
* @ORM\ManyToOne(targetEntity=AccountingStudentRegistrationFee::class, inversedBy="accountingStudentRegistrationFeeSheduls")
* @ORM\JoinColumn(nullable=false)
*/
private $studentRegistrationFee;
/**
* @ORM\Column(type="integer")
*/
private $order_num;
/**
* @ORM\Column(type="date_immutable")
*/
private $date_due;
/**
* @ORM\Column(type="float")
*/
private $amount;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $amount_paid;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $last_amount_paid;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $last_payment_id;
/**
* @ORM\Column(type="datetime_immutable", nullable=true)
*/
private $last_payment_at;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updated_at;
/**
* @ORM\Column(type="integer")
*/
private $created_by;
/**
* @ORM\Column(type="integer")
*/
private $updated_by;
/**
* @ORM\OneToMany(targetEntity=AccountingStudentRegistrationFeeShedulPayment::class, mappedBy="studentRegistrationFeeShedul")
*/
private $accountingStudentRegistrationFeeShedulPayments;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $amount_cancel;
/**
* @ORM\Column(type="boolean")
*/
private $is_cancel;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $amount_reported;
/**
* @ORM\Column(type="boolean")
*/
private $is_reported;
public function __construct()
{
$this->accountingStudentRegistrationFeeShedulPayments = new ArrayCollection();
$this->amount_paid = 0;
$this->amount_cancel = 0;
$this->is_cancel = false;
$this->is_reported = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getEstablishment(): ?Establishment
{
return $this->establishment;
}
public function setEstablishment(?Establishment $establishment): self
{
$this->establishment = $establishment;
return $this;
}
public function getStudentRegistrationFee(): ?AccountingStudentRegistrationFee
{
return $this->studentRegistrationFee;
}
public function setStudentRegistrationFee(?AccountingStudentRegistrationFee $studentRegistrationFee): self
{
$this->studentRegistrationFee = $studentRegistrationFee;
return $this;
}
/**
* @return Collection|AccountingStudentRegistrationFeeShedulPayment[]
*/
public function getAccountingStudentRegistrationFeeShedulPayments(): Collection
{
return $this->accountingStudentRegistrationFeeShedulPayments;
}
public function addAccountingStudentRegistrationFeeShedulPayment(AccountingStudentRegistrationFeeShedulPayment $accountingStudentRegistrationFeeShedulPayment): self
{
if (!$this->accountingStudentRegistrationFeeShedulPayments->contains($accountingStudentRegistrationFeeShedulPayment)) {
$this->accountingStudentRegistrationFeeShedulPayments[] = $accountingStudentRegistrationFeeShedulPayment;
$accountingStudentRegistrationFeeShedulPayment->setStudentRegistrationFeeShedul($this);
}
return $this;
}
public function removeAccountingStudentRegistrationFeeShedulPayment(AccountingStudentRegistrationFeeShedulPayment $accountingStudentRegistrationFeeShedulPayment): self
{
if ($this->accountingStudentRegistrationFeeShedulPayments->removeElement($accountingStudentRegistrationFeeShedulPayment)) {
// set the owning side to null (unless already changed)
if ($accountingStudentRegistrationFeeShedulPayment->getStudentRegistrationFeeShedul() === $this) {
$accountingStudentRegistrationFeeShedulPayment->setStudentRegistrationFeeShedul(null);
}
}
return $this;
}
public function getOrderNum(): ?int
{
return $this->order_num;
}
public function setOrderNum(int $order_num): self
{
$this->order_num = $order_num;
return $this;
}
public function getDateDue(): ?\DateTimeImmutable
{
return $this->date_due;
}
public function setDateDue(\DateTimeImmutable $date_due): self
{
$this->date_due = $date_due;
return $this;
}
public function getAmount(): ?float
{
return $this->amount;
}
public function setAmount(float $amount): self
{
$this->amount = $amount;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeImmutable $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getCreatedBy(): ?int
{
return $this->created_by;
}
public function setCreatedBy(int $created_by): self
{
$this->created_by = $created_by;
return $this;
}
public function getUpdatedBy(): ?int
{
return $this->updated_by;
}
public function setUpdatedBy(int $updated_by): self
{
$this->updated_by = $updated_by;
return $this;
}
public function getAmountPaid(): ?float
{
return $this->amount_paid;
}
public function setAmountPaid(?float $amount_paid): self
{
$this->amount_paid = $amount_paid;
return $this;
}
public function getAmountRest(): ?float
{
$amountRest = $this->getAmount() - ($this->getAmountPaid() + $this->getAmountCancel());
return $amountRest;
}
public function getLastPaymentAt(): ?\DateTimeImmutable
{
return $this->last_payment_at;
}
public function setLastPaymentAt(\DateTimeImmutable $last_payment_at): self
{
$this->last_payment_at = $last_payment_at;
return $this;
}
public function getLastAmountPaid(): ?float
{
return $this->last_amount_paid;
}
public function setLastAmountPaid(?float $last_amount_paid): self
{
$this->last_amount_paid = $last_amount_paid;
return $this;
}
public function getLastPaymentId(): ?int
{
return $this->last_payment_id;
}
public function setLastPaymentId(?int $last_payment_id): self
{
$this->last_payment_id = $last_payment_id;
return $this;
}
public function getAmountCancel(): ?float
{
return $this->amount_cancel;
}
public function setAmountCancel(?float $amount_cancel): self
{
$this->amount_cancel = $amount_cancel;
return $this;
}
public function getIsCancel(): ?bool
{
return $this->is_cancel;
}
public function setIsCancel(bool $is_cancel): self
{
$this->is_cancel = $is_cancel;
return $this;
}
public function getAmountReported(): ?float
{
return $this->amount_reported;
}
public function setAmountReported(?float $amount_reported): self
{
$this->amount_reported = $amount_reported;
return $this;
}
public function getIsReported(): ?bool
{
return $this->is_reported;
}
public function setIsReported(bool $is_reported): self
{
$this->is_reported = $is_reported;
return $this;
}
}