<?php
namespace App\Entity;
use App\Repository\RegistrationStudentRegistrationRepository;
use App\Repository\SchoolReportCardRepository;
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=RegistrationStudentRegistrationRepository::class)
* Inscrits
* @Vich\Uploadable
*/
class RegistrationStudentRegistration
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="registrationStudentRegistrations")
* @ORM\JoinColumn(nullable=false)
*/
private $establishment;
/**
* @ORM\ManyToOne(targetEntity=RegistrationStudent::class, inversedBy="registrationStudentRegistrations")
* @ORM\JoinColumn(nullable=false)
*/
private $student;
/**
* @ORM\ManyToOne(targetEntity=SchoolYear::class, inversedBy="registrationStudentRegistrations")
* @ORM\JoinColumn(nullable=false)
*/
private $schoolYear;
/**
* @ORM\ManyToOne(targetEntity=SettingClassroom::class, inversedBy="registrationStudentRegistrations")
* @ORM\JoinColumn(nullable=false)
*/
private $classroom;
/**
* @ORM\Column(type="boolean")
*/
private $is_redoubling;
/**
* @ORM\Column(type="boolean")
* est boursier
*/
private $is_diet;
/**
* @ORM\Column(type="boolean")
* est interne
*/
private $is_internal;
/**
* @ORM\Column(type="boolean")
* est affecte(e)
*/
private $is_affected;
/**
* @ORM\Column(type="date_immutable")
*/
private $registered_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=AccountingStudentRegistrationFee::class, mappedBy="studentRegistration")
*/
private $accountingStudentRegistrationFees;
/**
* @ORM\OneToMany(targetEntity=SchoolReportCard::class, mappedBy="studentRegistration")
* @ORM\OrderBy({"id" = "ASC"})
*/
private $schoolReportCards;
/**
* @ORM\OneToMany(targetEntity=SchoolAverageReportCard::class, mappedBy="studentRegistration")
*/
private $schoolAverageReportCards;
/**
* @ORM\OneToMany(targetEntity=SchoolAssessmentByClass::class, mappedBy="studentRegistration")
*/
private $schoolAssessmentByClasses;
/**
* @ORM\OneToMany(targetEntity=SchoolAssessmentByLevel::class, mappedBy="studentRegistration")
*/
private $schoolAssessmentByLevels;
/**
* @ORM\OneToMany(targetEntity=SchoolAssessmentByClassByMatter::class, mappedBy="studentRegistration")
*/
private $schoolAssessmentByClassByMatters;
/**
* @ORM\OneToMany(targetEntity=SchoolAssessmentByLevelByMatter::class, mappedBy="studentRegistration")
*/
private $schoolAssessmentByLevelByMatters;
/**
* @ORM\OneToMany(targetEntity=AccountingStudentRegistrationPayment::class, mappedBy="studentRegistration")
*/
private $accountingStudentRegistrationPayments;
/**
* @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="string", length=255, nullable=true)
*/
private $image;
/**
* NOTE: This is not a mapped field of entity metadata, just a simple property.
*
* @Vich\UploadableField(mapping="student", fileNameProperty="image")
*
* @var File|null
* @Assert\File(
* maxSize = "25M",
* mimeTypes = {"image/png", "image/jpg", "image/jpeg"},
* mimeTypesMessage = "Veuillez télécharger une image valide (png, jpg, jpeg)",
* maxSizeMessage = "Le fichier est trop volumineux ({{size}} {{suffix}}). La taille maximale autorisée est {{limit}} {{suffix}}"
* )
*/
private $imageFile;
/**
* @ORM\OneToMany(targetEntity=RegistrationClassChange::class, mappedBy="studentRegistration")
*/
private $registrationClassChanges;
/**
* @ORM\OneToMany(targetEntity=RegistrationStudentDowngrade::class, mappedBy="registrationStudentRegistration")
*/
private $registrationStudentDowngrades;
/**
* @ORM\OneToMany(targetEntity=RegistrationStudentAbandonment::class, mappedBy="registrationStudentRegistration")
*/
private $registrationStudentAbandonments;
/**
* @ORM\Column(type="boolean")
*/
private $is_abandonned;
/**
* @ORM\ManyToOne(targetEntity=RegistrationStudentPreRegistration::class, inversedBy="registrationStudentRegistrations")
*/
private $registrationStudentPreRegistration;
/**
* @ORM\OneToMany(targetEntity=RegistrationTransportCheckpoint::class, mappedBy="registrationStudentRegistration")
*/
private $registrationTransportCheckpoints;
/**
* @ORM\Column(type="boolean")
*/
private $as_food_restrictions;
/**
* @ORM\Column(type="boolean")
*/
private $is_meatless_menu;
/**
* @ORM\Column(type="boolean")
*/
private $is_menu_without_pork;
/**
* @ORM\Column(type="boolean")
*/
private $is_can_eat_alone;
/**
* @ORM\Column(type="boolean")
*/
private $is_can_do_his_business_alone;
/**
* @ORM\Column(type="boolean")
*/
private $is_falls_sleep_easily;
/**
* @ORM\OneToMany(targetEntity=SchoolAbsenceAndDelay::class, mappedBy="studentRegistration")
*/
private $schoolAbsenceAndDelays;
/**
* @ORM\ManyToMany(targetEntity=SettingDocumentToProvide::class, inversedBy="registrationStudentRegistrations")
*/
private $documentProvides;
/**
* @ORM\ManyToMany(targetEntity=CommunicationMessage::class, mappedBy="studentRegistrations")
*/
private $communicationMessages;
/**
* @ORM\Column(type="boolean")
*/
private $is_new;
/**
* @ORM\OneToMany(targetEntity=StockStudentKitEntry::class, mappedBy="registrationStudent")
*/
private $stockStudentKitEntries;
/**
* @ORM\OneToMany(targetEntity=StockKitOut::class, mappedBy="registrationStudent")
*/
private $stockKitOuts;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $portal_login;
/**
* @ORM\Column(type="string", length=60, nullable=true)
*/
private $portal_password;
/**
* @ORM\OneToMany(targetEntity=AccountingCredit::class, mappedBy="studentRegistration")
*/
private $accountingCredits;
/**
* @ORM\OneToMany(targetEntity=SchoolStudentAverage::class, mappedBy="registrationStudentRegistration")
*/
private $schoolStudentAverages;
/**
* @ORM\OneToMany(targetEntity=NurseryTimeSheet::class, mappedBy="registrationStudentRegistration")
*/
private $nurseryTimeSheets;
/**
* @ORM\OneToMany(targetEntity=SchoolTeacherCallSheetLine::class, mappedBy="registrationStudentRegistration")
*/
private $schoolTeacherCallSheetLines;
/**
* @ORM\OneToMany(targetEntity=AccountingChequeTrackingLine::class, mappedBy="registrationStudentRegistration")
*/
private $accountingChequeTrackingLines;
/**
* @ORM\OneToMany(targetEntity=SchoolReportCardAbsence::class, mappedBy="studentRegistration")
*/
private $schoolReportCardAbsences;
/**
* @ORM\OneToMany(targetEntity=WavePayment::class, mappedBy="studentRegistration")
*/
private $wavePayments;
public function __construct()
{
$this->accountingStudentRegistrationFees = new ArrayCollection();
$this->schoolReportCards = new ArrayCollection();
$this->schoolAverageReportCards = new ArrayCollection();
$this->schoolAssessmentByClasses = new ArrayCollection();
$this->schoolAssessmentByLevels = new ArrayCollection();
$this->schoolAssessmentByClassByMatters = new ArrayCollection();
$this->schoolAssessmentByLevelByMatters = new ArrayCollection();
$this->is_affected = false;
$this->is_diet = false;
$this->is_internal = true;
$this->is_redoubling = false;
$this->is_abandonned = false;
$this->registered_at = new DateTimeImmutable();
$this->accountingStudentRegistrationPayments = new ArrayCollection();
$this->registrationClassChanges = new ArrayCollection();
$this->registrationStudentDowngrades = new ArrayCollection();
$this->registrationStudentAbandonments = new ArrayCollection();
$this->registrationTransportCheckpoints = new ArrayCollection();
$this->as_food_restrictions = false;
$this->is_meatless_menu = false;
$this->is_menu_without_pork = false;
$this->is_can_eat_alone = true;
$this->is_can_do_his_business_alone = true;
$this->is_falls_sleep_easily = false;
$this->schoolAbsenceAndDelays = new ArrayCollection();
$this->documentProvides = new ArrayCollection();
$this->communicationMessages = new ArrayCollection();
$this->is_new = false;
$this->stockStudentKitEntries = new ArrayCollection();
$this->stockKitOuts = new ArrayCollection();
$this->accountingCredits = new ArrayCollection();
$this->schoolStudentAverages = new ArrayCollection();
$this->nurseryTimeSheets = new ArrayCollection();
$this->schoolTeacherCallSheetLines = new ArrayCollection();
$this->accountingChequeTrackingLines = new ArrayCollection();
$this->schoolReportCardAbsences = new ArrayCollection();
$this->wavePayments = new ArrayCollection();
}
public function getName()
{
return $this->getStudent()->getName();
}
public function __toString()
{
return $this->getName().' ['.$this->getClassroom()->getLabel().']'.' ['.$this->getStudent()->getRegistrationNumber().']';
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'File' as the bundle will inject one here
* during Doctrine hydration.
*
* @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setImageFile(?File $imageFile = null): void
{
$this->imageFile = $imageFile;
if (null !== $imageFile) {
// It is required that at least one field changes if you are using doctrine
// otherwise the event listeners won't be called and the file is lost
$this->updated_at = new \DateTimeImmutable();
}
}
public function getImageFile(): ?File
{
return $this->imageFile;
}
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 getStudent(): ?RegistrationStudent
{
return $this->student;
}
public function setStudent(?RegistrationStudent $student): self
{
$this->student = $student;
return $this;
}
public function getSchoolYear(): ?SchoolYear
{
return $this->schoolYear;
}
public function setSchoolYear(?SchoolYear $schoolYear): self
{
$this->schoolYear = $schoolYear;
return $this;
}
public function getClassroom(): ?SettingClassroom
{
return $this->classroom;
}
public function setClassroom(?SettingClassroom $classroom): self
{
$this->classroom = $classroom;
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;
}
/**
* @return Collection|AccountingStudentRegistrationFee[]
*/
public function getAccountingStudentRegistrationFees(): Collection
{
return $this->accountingStudentRegistrationFees;
}
public function addAccountingStudentRegistrationFee(AccountingStudentRegistrationFee $accountingStudentRegistrationFee): self
{
if (!$this->accountingStudentRegistrationFees->contains($accountingStudentRegistrationFee)) {
$this->accountingStudentRegistrationFees[] = $accountingStudentRegistrationFee;
$accountingStudentRegistrationFee->setStudentRegistration($this);
}
return $this;
}
public function removeAccountingStudentRegistrationFee(AccountingStudentRegistrationFee $accountingStudentRegistrationFee): self
{
if ($this->accountingStudentRegistrationFees->removeElement($accountingStudentRegistrationFee)) {
// set the owning side to null (unless already changed)
if ($accountingStudentRegistrationFee->getStudentRegistration() === $this) {
$accountingStudentRegistrationFee->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolReportCard[]
*/
public function getSchoolReportCards(): Collection
{
return $this->schoolReportCards;
}
public function addSchoolReportCard(SchoolReportCard $schoolReportCard): self
{
if (!$this->schoolReportCards->contains($schoolReportCard)) {
$this->schoolReportCards[] = $schoolReportCard;
$schoolReportCard->setStudentRegistration($this);
}
return $this;
}
public function getOrderedSchoolReportCards(SchoolReportCardRepository $schoolReportCardRepository)
{
$schoolReportCards = $schoolReportCardRepository->createQueryBuilder('entity')
->innerJoin('entity.schoolYearPeriode', 'schoolYearPeriode')
->addSelect('schoolYearPeriode')
->andWhere('entity.studentRegistration = :studentRegistration')
->setParameter('studentRegistration', $this)
->orderBy('schoolYearPeriode.code', 'ASC')
->getQuery()
->getResult();
return $schoolReportCards;
}
public function removeSchoolReportCard(SchoolReportCard $schoolReportCard): self
{
if ($this->schoolReportCards->removeElement($schoolReportCard)) {
// set the owning side to null (unless already changed)
if ($schoolReportCard->getStudentRegistration() === $this) {
$schoolReportCard->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolAverageReportCard[]
*/
public function getSchoolAverageReportCards(): Collection
{
return $this->schoolAverageReportCards;
}
public function addSchoolAverageReportCard(SchoolAverageReportCard $schoolAverageReportCard): self
{
if (!$this->schoolAverageReportCards->contains($schoolAverageReportCard)) {
$this->schoolAverageReportCards[] = $schoolAverageReportCard;
$schoolAverageReportCard->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAverageReportCard(SchoolAverageReportCard $schoolAverageReportCard): self
{
if ($this->schoolAverageReportCards->removeElement($schoolAverageReportCard)) {
// set the owning side to null (unless already changed)
if ($schoolAverageReportCard->getStudentRegistration() === $this) {
$schoolAverageReportCard->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolAssessmentByClass[]
*/
public function getSchoolAssessmentByClasses(): Collection
{
return $this->schoolAssessmentByClasses;
}
public function addSchoolAssessmentByClass(SchoolAssessmentByClass $schoolAssessmentByClass): self
{
if (!$this->schoolAssessmentByClasses->contains($schoolAssessmentByClass)) {
$this->schoolAssessmentByClasses[] = $schoolAssessmentByClass;
$schoolAssessmentByClass->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAssessmentByClass(SchoolAssessmentByClass $schoolAssessmentByClass): self
{
if ($this->schoolAssessmentByClasses->removeElement($schoolAssessmentByClass)) {
// set the owning side to null (unless already changed)
if ($schoolAssessmentByClass->getStudentRegistration() === $this) {
$schoolAssessmentByClass->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolAssessmentByLevel[]
*/
public function getSchoolAssessmentByLevels(): Collection
{
return $this->schoolAssessmentByLevels;
}
public function addSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
{
if (!$this->schoolAssessmentByLevels->contains($schoolAssessmentByLevel)) {
$this->schoolAssessmentByLevels[] = $schoolAssessmentByLevel;
$schoolAssessmentByLevel->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAssessmentByLevel(SchoolAssessmentByLevel $schoolAssessmentByLevel): self
{
if ($this->schoolAssessmentByLevels->removeElement($schoolAssessmentByLevel)) {
// set the owning side to null (unless already changed)
if ($schoolAssessmentByLevel->getStudentRegistration() === $this) {
$schoolAssessmentByLevel->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolAssessmentByClassByMatter[]
*/
public function getSchoolAssessmentByClassByMatters(): Collection
{
return $this->schoolAssessmentByClassByMatters;
}
public function addSchoolAssessmentByClassByMatter(SchoolAssessmentByClassByMatter $schoolAssessmentByClassByMatter): self
{
if (!$this->schoolAssessmentByClassByMatters->contains($schoolAssessmentByClassByMatter)) {
$this->schoolAssessmentByClassByMatters[] = $schoolAssessmentByClassByMatter;
$schoolAssessmentByClassByMatter->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAssessmentByClassByMatter(SchoolAssessmentByClassByMatter $schoolAssessmentByClassByMatter): self
{
if ($this->schoolAssessmentByClassByMatters->removeElement($schoolAssessmentByClassByMatter)) {
// set the owning side to null (unless already changed)
if ($schoolAssessmentByClassByMatter->getStudentRegistration() === $this) {
$schoolAssessmentByClassByMatter->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolAssessmentByLevelByMatter[]
*/
public function getSchoolAssessmentByLevelByMatters(): Collection
{
return $this->schoolAssessmentByLevelByMatters;
}
public function addSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
{
if (!$this->schoolAssessmentByLevelByMatters->contains($schoolAssessmentByLevelByMatter)) {
$this->schoolAssessmentByLevelByMatters[] = $schoolAssessmentByLevelByMatter;
$schoolAssessmentByLevelByMatter->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAssessmentByLevelByMatter(SchoolAssessmentByLevelByMatter $schoolAssessmentByLevelByMatter): self
{
if ($this->schoolAssessmentByLevelByMatters->removeElement($schoolAssessmentByLevelByMatter)) {
// set the owning side to null (unless already changed)
if ($schoolAssessmentByLevelByMatter->getStudentRegistration() === $this) {
$schoolAssessmentByLevelByMatter->setStudentRegistration(null);
}
}
return $this;
}
public function getIsRedoubling(): ?bool
{
return $this->is_redoubling;
}
public function setIsRedoubling(bool $is_redoubling): self
{
$this->is_redoubling = $is_redoubling;
return $this;
}
public function getIsDiet(): ?bool
{
return $this->is_diet;
}
public function setIsDiet(bool $is_diet): self
{
$this->is_diet = $is_diet;
return $this;
}
public function getIsInternal(): ?bool
{
return $this->is_internal;
}
public function setIsInternal(bool $is_internal): self
{
$this->is_internal = $is_internal;
return $this;
}
public function getIsAffected(): ?bool
{
return $this->is_affected;
}
public function setIsAffected(bool $is_affected): self
{
$this->is_affected = $is_affected;
return $this;
}
public function getRegisteredAt(): ?\DateTimeImmutable
{
return $this->registered_at;
}
public function setRegisteredAt(\DateTimeImmutable $registered_at): self
{
$this->registered_at = $registered_at;
return $this;
}
public function getGleAmount(){
$amount = 0;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $fee) {
if (!$fee->getIsArchived()) {
$amount = $amount + $fee->getAmount();
}
}
return $amount;
}
public function getAmountPaid(){
$amount = 0;
foreach ($this->getAccountingStudentRegistrationPayments() as $key => $accountingStudentRegistrationPayment) {
$amount = $amount + $accountingStudentRegistrationPayment->getAmount();
}
$payArchived = 0;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getIsArchived()) {
$payArchived = $payArchived + $accountingStudentRegistrationFee->getAmountPaid();
}
}
return $amount - $payArchived;
}
public function getAmountCancel(): ?float
{
$amountCancel = 0;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
//if (!$accountingStudentRegistrationFee->getIsArchived()) {
$amountCancel = $amountCancel + $accountingStudentRegistrationFee->getAmountReported();
//}
}
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if (!$accountingStudentRegistrationFee->getIsArchived()) {
$amountCancel = $amountCancel + $accountingStudentRegistrationFee->getAmountCancel();
}
}
return $amountCancel;
}
public function getAmountRest(): ?float
{
return ($this->getGleAmount() - ($this->getAmountPaid() + $this->getAmountCancel()));
}
/**
* @return Collection|AccountingStudentRegistrationPayment[]
*/
public function getAccountingStudentRegistrationPayments(): Collection
{
return $this->accountingStudentRegistrationPayments;
}
public function addAccountingStudentRegistrationPayment(AccountingStudentRegistrationPayment $accountingStudentRegistrationPayment): self
{
if (!$this->accountingStudentRegistrationPayments->contains($accountingStudentRegistrationPayment)) {
$this->accountingStudentRegistrationPayments[] = $accountingStudentRegistrationPayment;
$accountingStudentRegistrationPayment->setStudentRegistration($this);
}
return $this;
}
public function removeAccountingStudentRegistrationPayment(AccountingStudentRegistrationPayment $accountingStudentRegistrationPayment): self
{
if ($this->accountingStudentRegistrationPayments->removeElement($accountingStudentRegistrationPayment)) {
// set the owning side to null (unless already changed)
if ($accountingStudentRegistrationPayment->getStudentRegistration() === $this) {
$accountingStudentRegistrationPayment->setStudentRegistration(null);
}
}
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 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 getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
/**
* @return Collection|RegistrationClassChange[]
*/
public function getRegistrationClassChanges(): Collection
{
return $this->registrationClassChanges;
}
public function addRegistrationClassChange(RegistrationClassChange $registrationClassChange): self
{
if (!$this->registrationClassChanges->contains($registrationClassChange)) {
$this->registrationClassChanges[] = $registrationClassChange;
$registrationClassChange->setStudentRegistration($this);
}
return $this;
}
public function removeRegistrationClassChange(RegistrationClassChange $registrationClassChange): self
{
if ($this->registrationClassChanges->removeElement($registrationClassChange)) {
// set the owning side to null (unless already changed)
if ($registrationClassChange->getStudentRegistration() === $this) {
$registrationClassChange->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|RegistrationStudentDowngrade[]
*/
public function getRegistrationStudentDowngrades(): Collection
{
return $this->registrationStudentDowngrades;
}
public function addRegistrationStudentDowngrade(RegistrationStudentDowngrade $registrationStudentDowngrade): self
{
if (!$this->registrationStudentDowngrades->contains($registrationStudentDowngrade)) {
$this->registrationStudentDowngrades[] = $registrationStudentDowngrade;
$registrationStudentDowngrade->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeRegistrationStudentDowngrade(RegistrationStudentDowngrade $registrationStudentDowngrade): self
{
if ($this->registrationStudentDowngrades->removeElement($registrationStudentDowngrade)) {
// set the owning side to null (unless already changed)
if ($registrationStudentDowngrade->getRegistrationStudentRegistration() === $this) {
$registrationStudentDowngrade->setRegistrationStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|RegistrationStudentAbandonment[]
*/
public function getRegistrationStudentAbandonments(): Collection
{
return $this->registrationStudentAbandonments;
}
public function addRegistrationStudentAbandonment(RegistrationStudentAbandonment $registrationStudentAbandonment): self
{
if (!$this->registrationStudentAbandonments->contains($registrationStudentAbandonment)) {
$this->registrationStudentAbandonments[] = $registrationStudentAbandonment;
$registrationStudentAbandonment->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeRegistrationStudentAbandonment(RegistrationStudentAbandonment $registrationStudentAbandonment): self
{
if ($this->registrationStudentAbandonments->removeElement($registrationStudentAbandonment)) {
// set the owning side to null (unless already changed)
if ($registrationStudentAbandonment->getRegistrationStudentRegistration() === $this) {
$registrationStudentAbandonment->setRegistrationStudentRegistration(null);
}
}
return $this;
}
public function getIsAbandonned(): ?bool
{
return $this->is_abandonned;
}
public function setIsAbandonned(bool $is_abandonned): self
{
$this->is_abandonned = $is_abandonned;
return $this;
}
public function getRegistrationStudentPreRegistration(): ?RegistrationStudentPreRegistration
{
return $this->registrationStudentPreRegistration;
}
public function setRegistrationStudentPreRegistration(?RegistrationStudentPreRegistration $registrationStudentPreRegistration): self
{
$this->registrationStudentPreRegistration = $registrationStudentPreRegistration;
return $this;
}
/**
* @return Collection|RegistrationTransportCheckpoint[]
*/
public function getRegistrationTransportCheckpoints(): Collection
{
return $this->registrationTransportCheckpoints;
}
public function addRegistrationTransportCheckpoint(RegistrationTransportCheckpoint $registrationTransportCheckpoint): self
{
if (!$this->registrationTransportCheckpoints->contains($registrationTransportCheckpoint)) {
$this->registrationTransportCheckpoints[] = $registrationTransportCheckpoint;
$registrationTransportCheckpoint->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeRegistrationTransportCheckpoint(RegistrationTransportCheckpoint $registrationTransportCheckpoint): self
{
if ($this->registrationTransportCheckpoints->removeElement($registrationTransportCheckpoint)) {
// set the owning side to null (unless already changed)
if ($registrationTransportCheckpoint->getRegistrationStudentRegistration() === $this) {
$registrationTransportCheckpoint->setRegistrationStudentRegistration(null);
}
}
return $this;
}
public function hasTransportFee(){
$reponse = false;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::TRANSPORT_FEE && !$accountingStudentRegistrationFee->getIsCancel() && $accountingStudentRegistrationFee->getAmountPaid() > 0 && !$accountingStudentRegistrationFee->getIsArchived()) {
$reponse = true;
break;
}
}
return $reponse;
}
public function hasGardeMidiFee(){
$reponse = false;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::GARDE_MIDI_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
$reponse = true;
break;
}
}
return $reponse;
}
public function hasExtraFee(){
$reponse = false;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::ACTIVITE_EXTAT_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
$reponse = true;
break;
}
}
return $reponse;
}
public function hasCanteenFee(){
$reponse = false;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::CANTINE_FEE && !$accountingStudentRegistrationFee->getIsCancel()) {
$reponse = true;
break;
}
}
return $reponse;
}
public function hasMobileApp(){
$reponse = false;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == SettingFee::MOBILE_APP && !$accountingStudentRegistrationFee->getIsCancel()) {
$reponse = true;
break;
}
}
return $reponse;
}
public function getAmountDueAt(DateTimeImmutable $dueDate, $category = '0'){
$amountDue = 0;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if (!$accountingStudentRegistrationFee->getIsArchived()) {
foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() >= 0) {
if ('0' != $category) {
if ($accountingStudentRegistrationFee->getFee()->getCategory() == $category) {
$amountDue = $amountDue + $accountingStudentRegistrationFeeShedul->getAmountRest();
}
}else {
$amountDue = $amountDue + $accountingStudentRegistrationFeeShedul->getAmountRest();
}
}
}
}
}
$amountChequeTracking = 0;
foreach ($this->getAccountingChequeTrackingLines() as $key => $accountingChequeTrackingLine) {
if ($accountingChequeTrackingLine->getAccountingChequeTracking()->getStatus() == AccountingChequeTracking::EN_TRAITEMENT) {
$amountChequeTracking += $accountingChequeTrackingLine->getAmount();
}
}
return $amountDue - $amountChequeTracking;
}
public function getAmountDueAtByFee(DateTimeImmutable $dueDate, SettingFee $settingFee){
$amountDue = 0;
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if (!$accountingStudentRegistrationFee->getIsArchived()) {
foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
if ($accountingStudentRegistrationFee->getFee() == $settingFee) {
$amountDue = $amountDue + $accountingStudentRegistrationFeeShedul->getAmountRest();
}
}
}
}
}
return $amountDue;
}
public function getFeeShedulDues(DateTimeImmutable $dueDate){
$feeShedulDues = new ArrayCollection();
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if (!$accountingStudentRegistrationFee->getIsArchived()) {
foreach ($accountingStudentRegistrationFee->getAccountingStudentRegistrationFeeSheduls() as $key => $accountingStudentRegistrationFeeShedul) {
if ($accountingStudentRegistrationFeeShedul->getDateDue() <= $dueDate && $accountingStudentRegistrationFeeShedul->getAmountRest() > 0) {
$feeShedulDues->add($accountingStudentRegistrationFeeShedul);
}
}
}
}
return $feeShedulDues;
}
public function getAsFoodRestrictions(): ?bool
{
return $this->as_food_restrictions;
}
public function setAsFoodRestrictions(bool $as_food_restrictions): self
{
$this->as_food_restrictions = $as_food_restrictions;
return $this;
}
public function getIsMeatlessMenu(): ?bool
{
return $this->is_meatless_menu;
}
public function setIsMeatlessMenu(bool $is_meatless_menu): self
{
$this->is_meatless_menu = $is_meatless_menu;
return $this;
}
public function getIsMenuWithoutPork(): ?bool
{
return $this->is_menu_without_pork;
}
public function setIsMenuWithoutPork(bool $is_menu_without_pork): self
{
$this->is_menu_without_pork = $is_menu_without_pork;
return $this;
}
public function getIsCanEatAlone(): ?bool
{
return $this->is_can_eat_alone;
}
public function setIsCanEatAlone(bool $is_can_eat_alone): self
{
$this->is_can_eat_alone = $is_can_eat_alone;
return $this;
}
public function getIsCanDoHisBusinessAlone(): ?bool
{
return $this->is_can_do_his_business_alone;
}
public function setIsCanDoHisBusinessAlone(bool $is_can_do_his_business_alone): self
{
$this->is_can_do_his_business_alone = $is_can_do_his_business_alone;
return $this;
}
public function getIsFallsSleepEasily(): ?bool
{
return $this->is_falls_sleep_easily;
}
public function setIsFallsSleepEasily(bool $is_falls_sleep_easily): self
{
$this->is_falls_sleep_easily = $is_falls_sleep_easily;
return $this;
}
/**
* @return Collection|SchoolAbsenceAndDelay[]
*/
public function getSchoolAbsenceAndDelays(): Collection
{
return $this->schoolAbsenceAndDelays;
}
public function addSchoolAbsenceAndDelay(SchoolAbsenceAndDelay $schoolAbsenceAndDelay): self
{
if (!$this->schoolAbsenceAndDelays->contains($schoolAbsenceAndDelay)) {
$this->schoolAbsenceAndDelays[] = $schoolAbsenceAndDelay;
$schoolAbsenceAndDelay->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolAbsenceAndDelay(SchoolAbsenceAndDelay $schoolAbsenceAndDelay): self
{
if ($this->schoolAbsenceAndDelays->removeElement($schoolAbsenceAndDelay)) {
// set the owning side to null (unless already changed)
if ($schoolAbsenceAndDelay->getStudentRegistration() === $this) {
$schoolAbsenceAndDelay->setStudentRegistration(null);
}
}
return $this;
}
public function getDelayByPeriode(SchoolYearPeriode $schoolYearPeriode){
$minute = 0;
$heure = 0;
foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
if ($schoolAbsenceAndDelay->getSituation() == 'RETARD') {
if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
$minute += $schoolAbsenceAndDelay->getDuration();
}
if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
$heure += $schoolAbsenceAndDelay->getDuration();
}
}
}
}
$heure = ceil($heure + ($minute / 60));
return $heure;
}
public function getAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
$minute = 0;
$heure = 0;
foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
$minute += $schoolAbsenceAndDelay->getDuration();
}
if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
$heure += $schoolAbsenceAndDelay->getDuration();
}
}
}
}
$heure = ceil($heure + ($minute / 60));
return $heure;
}
/**
* @return Collection|SettingDocumentToProvide[]
*/
public function getDocumentProvides(): Collection
{
return $this->documentProvides;
}
public function addDocumentProvide(SettingDocumentToProvide $documentProvide): self
{
if (!$this->documentProvides->contains($documentProvide)) {
$this->documentProvides[] = $documentProvide;
}
return $this;
}
public function removeDocumentProvide(SettingDocumentToProvide $documentProvide): self
{
$this->documentProvides->removeElement($documentProvide);
return $this;
}
/**
* @return Collection|CommunicationMessage[]
*/
public function getCommunicationMessages(): Collection
{
return $this->communicationMessages;
}
public function addCommunicationMessage(CommunicationMessage $communicationMessage): self
{
if (!$this->communicationMessages->contains($communicationMessage)) {
$this->communicationMessages[] = $communicationMessage;
$communicationMessage->addStudentRegistration($this);
}
return $this;
}
public function removeCommunicationMessage(CommunicationMessage $communicationMessage): self
{
if ($this->communicationMessages->removeElement($communicationMessage)) {
$communicationMessage->removeStudentRegistration($this);
}
return $this;
}
public function getIsNew(): ?bool
{
return $this->is_new;
}
public function setIsNew(bool $is_new): self
{
$this->is_new = $is_new;
return $this;
}
/**
* @return Collection|StockStudentKitEntry[]
*/
public function getStockStudentKitEntries(): Collection
{
return $this->stockStudentKitEntries;
}
public function addStockStudentKitEntry(StockStudentKitEntry $stockStudentKitEntry): self
{
if (!$this->stockStudentKitEntries->contains($stockStudentKitEntry)) {
$this->stockStudentKitEntries[] = $stockStudentKitEntry;
$stockStudentKitEntry->setRegistrationStudent($this);
}
return $this;
}
public function removeStockStudentKitEntry(StockStudentKitEntry $stockStudentKitEntry): self
{
if ($this->stockStudentKitEntries->removeElement($stockStudentKitEntry)) {
// set the owning side to null (unless already changed)
if ($stockStudentKitEntry->getRegistrationStudent() === $this) {
$stockStudentKitEntry->setRegistrationStudent(null);
}
}
return $this;
}
/**
* @return Collection|StockKitOut[]
*/
public function getStockKitOuts(): Collection
{
return $this->stockKitOuts;
}
public function addStockKitOut(StockKitOut $stockKitOut): self
{
if (!$this->stockKitOuts->contains($stockKitOut)) {
$this->stockKitOuts[] = $stockKitOut;
$stockKitOut->setRegistrationStudent($this);
}
return $this;
}
public function removeStockKitOut(StockKitOut $stockKitOut): self
{
if ($this->stockKitOuts->removeElement($stockKitOut)) {
// set the owning side to null (unless already changed)
if ($stockKitOut->getRegistrationStudent() === $this) {
$stockKitOut->setRegistrationStudent(null);
}
}
return $this;
}
public function getPortalLogin(): ?string
{
return $this->portal_login;
}
public function setPortalLogin(?string $portal_login): self
{
$this->portal_login = $portal_login;
return $this;
}
public function getPortalPassword(): ?string
{
return $this->portal_password;
}
public function setPortalPassword(?string $portal_password): self
{
$this->portal_password = $portal_password;
return $this;
}
/**
* @return Collection|AccountingCredit[]
*/
public function getAccountingCredits(): Collection
{
return $this->accountingCredits;
}
public function addAccountingCredit(AccountingCredit $accountingCredit): self
{
if (!$this->accountingCredits->contains($accountingCredit)) {
$this->accountingCredits[] = $accountingCredit;
$accountingCredit->setStudentRegistration($this);
}
return $this;
}
public function removeAccountingCredit(AccountingCredit $accountingCredit): self
{
if ($this->accountingCredits->removeElement($accountingCredit)) {
// set the owning side to null (unless already changed)
if ($accountingCredit->getStudentRegistration() === $this) {
$accountingCredit->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolStudentAverage[]
*/
public function getSchoolStudentAverages(): Collection
{
return $this->schoolStudentAverages;
}
public function addSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
{
if (!$this->schoolStudentAverages->contains($schoolStudentAverage)) {
$this->schoolStudentAverages[] = $schoolStudentAverage;
$schoolStudentAverage->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
{
if ($this->schoolStudentAverages->removeElement($schoolStudentAverage)) {
// set the owning side to null (unless already changed)
if ($schoolStudentAverage->getRegistrationStudentRegistration() === $this) {
$schoolStudentAverage->setRegistrationStudentRegistration(null);
}
}
return $this;
}
public function computePeriodeAverage(SchoolMatter $schoolMatter, ReportCard $reportCard, SchoolAverageReportCard $schoolAverageReportCard){
if (count($schoolMatter->getSchoolSubMatters()) > 0) {
$averages = 0;
$periodeAverage = 0;
$count = 0;
$coeffecient = 0;
//foreach ($schoolMatter->getSchoolSubMatters() as $key => $schoolSubMatter) {
foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
$schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
if (!$schoolStudentAverage->getIsUnclassified()) {
if ($schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
if ($schoolStudentAverage->getSubMatter() != null) {
if ($schoolStudentAverage->getMatter() == $schoolMatter) {
$count ++;
if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote();
$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
}
}else {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote() * $schoolStudentAverage->getSubMatter()->getCoefficient();
$coeffecient += $schoolStudentAverage->getSubMatter()->getCoefficient();
}
}
}
}
}
}
}
}
if ($coeffecient > 0) {
$periodeAverage = $averages / $coeffecient;
}else {
$periodeAverage = 999;
}
return $periodeAverage;
//}
}else {
$averages = 0;
$periodeAverage = 0;
$count = 0;
$coeffecient = 0;
foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
$schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
if (!$schoolStudentAverage->getIsUnclassified()) {
if ($schoolStudentAverage->getMatter() == $schoolMatter && $schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
$count++;
if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote();
$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
}
}else {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote() * $schoolStudentAverage->getMatter()->getCoefficient();
$coeffecient += $schoolStudentAverage->getMatter()->getCoefficient();
}
}
}
}
}
}
if ($coeffecient > 0) {
$periodeAverage = $averages / $coeffecient;
}else {
$periodeAverage = 999;
}
return $periodeAverage;
}
}
public function computeSubPeriodeAverage(SchoolSubMatter $schoolSubMatter, ReportCard $reportCard, SchoolAverageReportCard $schoolAverageReportCard){
$averages = 0;
$periodeAverage = 0;
$count = 0;
$coeffecient = 0;
foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
if ($schoolStudentAverage->getSchoolAverage()->getIsValidated()) {
$schoolAverageReportCard->setSchoolTeacher($schoolStudentAverage->getSchoolAverage()->getSchoolTeacher());
if (!$schoolStudentAverage->getIsUnclassified()) {
if ($schoolStudentAverage->getSubMatter() == $schoolSubMatter && $schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
$count++;
if ($this->getEstablishment()->getType() == Establishment::ESTABLISHMENT_PRESCOLAIRE_PRIMAIRE_TYPES) {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote();
$coeffecient += ($schoolStudentAverage->getNoteOn() / $reportCard->getNoteOn());
}
}else {
if($schoolStudentAverage->getNote() < 999){
$averages += $schoolStudentAverage->getNote() * $schoolSubMatter->getCoefficient();
$coeffecient += $schoolSubMatter->getCoefficient();
}
}
}
}
}
}
if ($coeffecient > 0) {
$periodeAverage = $averages / $coeffecient;
}else {
$periodeAverage = 999;
}
return $periodeAverage;
}
public function asMatterDone(SchoolMatter $schoolMatter, ReportCard $reportCard){
$count = 0;
foreach ($this->getSchoolStudentAverages() as $key => $schoolStudentAverage) {
if ($schoolStudentAverage->getMatter() == $schoolMatter && $schoolStudentAverage->getSchoolYearPeriode() == $reportCard->getSchoolYearPeriode()) {
$count++;
}
}
return $count > 0;
}
public function getAnnualAverage(): ?float
{
$annual_average = 0;
foreach ($this->getSchoolReportCards() as $key => $schoolReportCard) {
$annual_average = $schoolReportCard->getAnnualAverage();
}
return $annual_average;
}
public function getAnnualRank(): ?string
{
$annual_rank = 0;
foreach ($this->getSchoolReportCards() as $key => $schoolReportCard) {
$annual_rank = $schoolReportCard->getAnnualRank();
}
return $annual_rank;
}
/**
* @return Collection|NurseryTimeSheet[]
*/
public function getNurseryTimeSheets(): Collection
{
return $this->nurseryTimeSheets;
}
public function addNurseryTimeSheet(NurseryTimeSheet $nurseryTimeSheet): self
{
if (!$this->nurseryTimeSheets->contains($nurseryTimeSheet)) {
$this->nurseryTimeSheets[] = $nurseryTimeSheet;
$nurseryTimeSheet->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeNurseryTimeSheet(NurseryTimeSheet $nurseryTimeSheet): self
{
if ($this->nurseryTimeSheets->removeElement($nurseryTimeSheet)) {
// set the owning side to null (unless already changed)
if ($nurseryTimeSheet->getRegistrationStudentRegistration() === $this) {
$nurseryTimeSheet->setRegistrationStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|SchoolTeacherCallSheetLine[]
*/
public function getSchoolTeacherCallSheetLines(): Collection
{
return $this->schoolTeacherCallSheetLines;
}
public function addSchoolTeacherCallSheetLine(SchoolTeacherCallSheetLine $schoolTeacherCallSheetLine): self
{
if (!$this->schoolTeacherCallSheetLines->contains($schoolTeacherCallSheetLine)) {
$this->schoolTeacherCallSheetLines[] = $schoolTeacherCallSheetLine;
$schoolTeacherCallSheetLine->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeSchoolTeacherCallSheetLine(SchoolTeacherCallSheetLine $schoolTeacherCallSheetLine): self
{
if ($this->schoolTeacherCallSheetLines->removeElement($schoolTeacherCallSheetLine)) {
// set the owning side to null (unless already changed)
if ($schoolTeacherCallSheetLine->getRegistrationStudentRegistration() === $this) {
$schoolTeacherCallSheetLine->setRegistrationStudentRegistration(null);
}
}
return $this;
}
public function getJustifydAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
$minute = 0;
$heure = 0;
foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
if ($schoolAbsenceAndDelay->getIsJustify()) {
if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
$minute += $schoolAbsenceAndDelay->getDuration();
}
if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
$heure += $schoolAbsenceAndDelay->getDuration();
}
}
}
}
}
$heure = ceil($heure + ($minute / 60));
return $heure;
}
public function getNotJustifydAbsenceByPeriode(SchoolYearPeriode $schoolYearPeriode){
$minute = 0;
$heure = 0;
foreach ($this->getSchoolAbsenceAndDelays() as $key => $schoolAbsenceAndDelay) {
if (!$schoolAbsenceAndDelay->getIsJustify()) {
if ($schoolAbsenceAndDelay->getSchoolYearPeriode() == $schoolYearPeriode) {
if ($schoolAbsenceAndDelay->getSituation() == 'ABSENCE') {
if ($schoolAbsenceAndDelay->getDurationType() == 'MINUTE') {
$minute += $schoolAbsenceAndDelay->getDuration();
}
if ($schoolAbsenceAndDelay->getDurationType() == 'HEURE') {
$heure += $schoolAbsenceAndDelay->getDuration();
}
}
}
}
}
$heure = ceil($heure + ($minute / 60));
return $heure;
}
public function isReported(){
foreach ($this->getAccountingStudentRegistrationFees() as $key => $accountingStudentRegistrationFee) {
if ($accountingStudentRegistrationFee->getIsReported()) {
return true;
break;
}
}
return false;
}
public function getNurseryPresence(DateTimeImmutable $startDate, DateTimeImmutable $endDate){
$data = new ArrayCollection();
foreach ($this->getSchoolTeacherCallSheetLines() as $key => $schoolTeacherCallSheetLine) {
if ($startDate <= $schoolTeacherCallSheetLine->getCreateDate() && $schoolTeacherCallSheetLine->getCreateDate() <= $endDate) {
$data->add($schoolTeacherCallSheetLine);
}
}
return $data;
}
/**
* @return Collection|AccountingChequeTrackingLine[]
*/
public function getAccountingChequeTrackingLines(): Collection
{
return $this->accountingChequeTrackingLines;
}
public function addAccountingChequeTrackingLine(AccountingChequeTrackingLine $accountingChequeTrackingLine): self
{
if (!$this->accountingChequeTrackingLines->contains($accountingChequeTrackingLine)) {
$this->accountingChequeTrackingLines[] = $accountingChequeTrackingLine;
$accountingChequeTrackingLine->setRegistrationStudentRegistration($this);
}
return $this;
}
public function removeAccountingChequeTrackingLine(AccountingChequeTrackingLine $accountingChequeTrackingLine): self
{
if ($this->accountingChequeTrackingLines->removeElement($accountingChequeTrackingLine)) {
// set the owning side to null (unless already changed)
if ($accountingChequeTrackingLine->getRegistrationStudentRegistration() === $this) {
$accountingChequeTrackingLine->setRegistrationStudentRegistration(null);
}
}
return $this;
}
public function getAbsenceStatus($day){
$nb = 0;
foreach ($this->getSchoolTeacherCallSheetLines() as $key => $schoolTeacherCallSheetLine) {
//if ($day == $schoolTeacherCallSheetLine->getCreateDate()->format('Y-m-d') && $schoolTeacherCallSheetLine->getSchoolTeacherCallSheet()->getSettingTimeTable() == $settingTimeTable) {
if ($day == $schoolTeacherCallSheetLine->getCreateDate()->format('Y-m-d') && $schoolTeacherCallSheetLine->getIsAbsent()) {
$nb++;
}
}
return $nb;
}
/**
* @return Collection|SchoolReportCardAbsence[]
*/
public function getSchoolReportCardAbsences(): Collection
{
return $this->schoolReportCardAbsences;
}
public function addSchoolReportCardAbsence(SchoolReportCardAbsence $schoolReportCardAbsence): self
{
if (!$this->schoolReportCardAbsences->contains($schoolReportCardAbsence)) {
$this->schoolReportCardAbsences[] = $schoolReportCardAbsence;
$schoolReportCardAbsence->setStudentRegistration($this);
}
return $this;
}
public function removeSchoolReportCardAbsence(SchoolReportCardAbsence $schoolReportCardAbsence): self
{
if ($this->schoolReportCardAbsences->removeElement($schoolReportCardAbsence)) {
// set the owning side to null (unless already changed)
if ($schoolReportCardAbsence->getStudentRegistration() === $this) {
$schoolReportCardAbsence->setStudentRegistration(null);
}
}
return $this;
}
/**
* @return Collection|WavePayment[]
*/
public function getWavePayments(): Collection
{
return $this->wavePayments;
}
public function addWavePayment(WavePayment $wavePayment): self
{
if (!$this->wavePayments->contains($wavePayment)) {
$this->wavePayments[] = $wavePayment;
$wavePayment->setStudentRegistration($this);
}
return $this;
}
public function removeWavePayment(WavePayment $wavePayment): self
{
if ($this->wavePayments->removeElement($wavePayment)) {
// set the owning side to null (unless already changed)
if ($wavePayment->getStudentRegistration() === $this) {
$wavePayment->setStudentRegistration(null);
}
}
return $this;
}
}