| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507 |
- <?php
- namespace AppBundle\Entity\Billing;
- use AppBundle\Entity\AccessAndFunction\Access;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
- use AppBundle\Validator\Constraints\Billing as OpentalentAssert;
- /**
- * Paramètres de facturation pour un Access
- *
- * @Iri("http://schema.org/AccessBilling")
- * @OpentalentAssert\CustomerId
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Billing\Repository\AccessBillingRepository')]
- class AccessBilling
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['accessbilling', 'access_mass', 'access_details', 'access_details_accessbilling', 'student_registration', 'student_registration_guardians', 'accesses_list', 'student_list', 'guardians_list', 'adherent_list', 'personnels_list', 'payer_list', 'accessbilling_edit', 'sepa_debit_mandate', 'fusion_accesses', 'online_registration_access_details', 'account_balance_reimbursements', 'billpayment_list'])]
- private $id;
- /**
- * @var Access
- */
- #[Assert\Valid]
- #[ORM\OneToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'accessBilling', cascade: ['persist'], fetch: 'EAGER')]
- #[ORM\JoinColumn(nullable: true, onDelete: 'CASCADE')]
- #[Groups(['accessbilling', 'billpayment_list_accessbillingaccountbalancereimbursement'])]
- private $access;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_guardians', 'payer_list_accessbilling', 'accessbilling_edit_accessbilling'])]
- private $customerId;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PaymentChoiceEnum', 'toArray'])]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_guardians', 'bill_list_access', 'payer_list_accessbilling', 'accessbilling_edit_accessbilling', 'online_registration_access_details_accessbilling', 'build_bills_billlines', 'build_bills_access'])]
- private $paymentChoice;
- /**
- * @var FamilyQuotient
- */
- #[Assert\Valid]
- #[ORM\ManyToOne(targetEntity: 'FamilyQuotient', cascade: ['persist'], inversedBy: 'accessBilling')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_accessbilling', 'access_mass_accessbilling', 'payer_list_accessbilling', 'accessbilling_edit_accessbilling', 'fusion_accesses_accessbilling', 'student_list_accessbilling'])]
- private $familyQuotient;
- /**
- * @var ResidenceArea
- */
- #[Assert\Valid]
- #[ORM\ManyToOne(targetEntity: 'ResidenceArea', cascade: ['persist'], inversedBy: 'accessBilling')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['accessbilling', 'access_details_accessbilling', 'access_mass_accessbilling', 'student_registration_accessbilling', 'accesses_list_accessbilling', 'student_list_accessbilling', 'guardians_list_accessbilling', 'adherent_list_accessbilling', 'personnels_list_accessbilling', 'payer_list_accessbilling', 'accessbilling_edit_accessbilling', 'fusion_accesses_accessbilling', 'online_registration_access_details_accessbilling'])]
- private $residenceArea;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PeriodicityPaymentEnum', 'toArray'])]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_guardians', 'payer_list_accessbilling', 'accessbilling_edit_accessbilling', 'sepa_debit_mandate_accessbilling'])]
- private $periodicityPayment;
- /**
- * @var ArrayCollection<Billpayment>
- */
- #[ORM\OneToMany(targetEntity: 'BillPayment', mappedBy: 'accessBilling', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['accessbilling_billpayment'])]
- private $billDetachedPayments;
- /**
- * @var ArrayCollection<BillDebitBalance>
- */
- #[ORM\OneToMany(targetEntity: 'BillDebitBalance', mappedBy: 'accessBilling', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['accessbilling_billdebitbalance'])]
- private $billDebitBalances;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', options: ['default' => 'APPLY_ADHESION'])]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\AdhesionChoiceEnum', 'toArray'])]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_guardians', 'accessbilling_edit_accessbilling'])]
- private $adhesionChoice = "APPLY_ADHESION";
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['accessbilling', 'student_registration_accessbilling', 'student_registration_guardians', 'accessbilling_edit_accessbilling'])]
- private $adhesionAmount;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true, options: ['default' => '0.0'])]
- #[Assert\Type(type: 'float')]
- #[Groups(['accessbilling', 'payer_list_accessbilling'])]
- private $accountBalance = 0.0;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['accessbilling'])]
- private $accountBalanceUpdateDate;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true, options: ['default' => '0.0'])]
- #[Assert\Type(type: 'float')]
- #[Groups(['accessbilling'])]
- private $reportPaymentsAmount = 0.0;
- /**
- * @var ArrayCollection<Billpayment>
- */
- #[ORM\OneToMany(targetEntity: 'BillPayment', mappedBy: 'accessBillingAccountBalanceReimbursement', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['accessbilling_accountbalancereimbursements', 'account_balance_reimbursements_accessbilling'])]
- private $accountBalanceReimbursements;
- /**
- * The constructor
- */
- public function __construct() {
- $this->billDetachedPayments = new ArrayCollection();
- $this->billDebitBalances = new ArrayCollection();
- $this->accountBalanceReimbursements = new ArrayCollection();
- }
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set customerId
- *
- * @param string $customerId
- *
- * @return AccessBilling
- */
- public function setCustomerId($customerId = null)
- {
- if(empty($customerId))
- $customerId = null;
- $this->customerId = $customerId;
- return $this;
- }
- /**
- * Get customerId
- *
- * @return string
- */
- public function getCustomerId()
- {
- return $this->customerId;
- }
- /**
- * Set paymentChoice
- *
- * @param string $paymentChoice
- *
- * @return AccessBilling
- */
- public function setPaymentChoice($paymentChoice)
- {
- $this->paymentChoice = $paymentChoice;
- return $this;
- }
- /**
- * Get paymentChoice
- *
- * @return string
- */
- public function getPaymentChoice()
- {
- return $this->paymentChoice;
- }
- /**
- * Set familyQuotient
- *
- * @param \AppBundle\Entity\Billing\FamilyQuotient $familyQuotient
- *
- * @return AccessBilling
- */
- public function setFamilyQuotient(\AppBundle\Entity\Billing\FamilyQuotient $familyQuotient = null)
- {
- $this->familyQuotient = $familyQuotient;
- return $this;
- }
- /**
- * Get familyQuotient
- *
- * @return \AppBundle\Entity\Billing\FamilyQuotient
- */
- public function getFamilyQuotient()
- {
- return $this->familyQuotient;
- }
- /**
- * Set residenceArea
- *
- * @param \AppBundle\Entity\Billing\ResidenceArea $residenceArea
- *
- * @return AccessBilling
- */
- public function setResidenceArea(\AppBundle\Entity\Billing\ResidenceArea $residenceArea = null)
- {
- $this->residenceArea = $residenceArea;
- return $this;
- }
- /**
- * Get residenceArea
- *
- * @return \AppBundle\Entity\Billing\ResidenceArea
- */
- public function getResidenceArea()
- {
- return $this->residenceArea;
- }
- /**
- * Set access
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $access
- *
- * @return AccessBilling
- */
- public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access = null)
- {
- $this->access = $access;
- return $this;
- }
- /**
- * Get access
- *
- * @return \AppBundle\Entity\AccessAndFunction\Access
- */
- public function getAccess()
- {
- return $this->access;
- }
- /**
- * Set periodicityPayment
- *
- * @param string $periodicityPayment
- *
- * @return AccessBilling
- */
- public function setPeriodicityPayment($periodicityPayment)
- {
- $this->periodicityPayment = $periodicityPayment;
- return $this;
- }
- /**
- * Get periodicityPayment
- *
- * @return string
- */
- public function getPeriodicityPayment()
- {
- return $this->periodicityPayment;
- }
- /**
- * Add billDetachedPayment
- *
- * @param \AppBundle\Entity\Billing\BillPayment $billDetachedPayment
- *
- * @return AccessBilling
- */
- public function addBillDetachedPayment(\AppBundle\Entity\Billing\BillPayment $billDetachedPayment)
- {
- $billDetachedPayment->setAccessBilling($this);
- $this->billDetachedPayments[] = $billDetachedPayment;
- return $this;
- }
- /**
- * Remove billDetachedPayment
- *
- * @param \AppBundle\Entity\Billing\BillPayment $billDetachedPayment
- */
- public function removeBillDetachedPayment(\AppBundle\Entity\Billing\BillPayment $billDetachedPayment)
- {
- $this->billDetachedPayments->removeElement($billDetachedPayment);
- }
- /**
- * Get billDetachedPayments
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getBillDetachedPayments()
- {
- return $this->billDetachedPayments;
- }
- /**
- * Add billDebitBalance
- *
- * @param \AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance
- *
- * @return AccessBilling
- */
- public function addBillDebitBalance(\AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance)
- {
- $billDebitBalance->setAccessBilling($this);
- $this->billDebitBalances[] = $billDebitBalance;
- return $this;
- }
- /**
- * Remove billDebitBalance
- *
- * @param \AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance
- */
- public function removeBillDebitBalance(\AppBundle\Entity\Billing\BillDebitBalance $billDebitBalance)
- {
- $this->billDebitBalances->removeElement($billDebitBalance);
- }
- /**
- * Get billDebitBalances
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getBillDebitBalances()
- {
- return $this->billDebitBalances;
- }
- /**
- * Set adhesionChoice
- *
- * @param string $adhesionChoice
- *
- * @return AccessBilling
- */
- public function setAdhesionChoice($adhesionChoice)
- {
- $this->adhesionChoice = $adhesionChoice;
- return $this;
- }
- /**
- * Get adhesionChoice
- *
- * @return string
- */
- public function getAdhesionChoice()
- {
- return $this->adhesionChoice;
- }
- /**
- * Set adhesionAmount
- *
- * @param float $adhesionAmount
- *
- * @return AccessBilling
- */
- public function setAdhesionAmount($adhesionAmount)
- {
- $this->adhesionAmount = floatval($adhesionAmount);
- return $this;
- }
- /**
- * Get adhesionAmount
- *
- * @return float
- */
- public function getAdhesionAmount()
- {
- return $this->adhesionAmount;
- }
- /**
- * Set accountBalance
- *
- * @param float $accountBalance
- *
- * @return AccessBilling
- */
- public function setAccountBalance($accountBalance)
- {
- $this->accountBalance = $accountBalance;
- return $this;
- }
- /**
- * Get accountBalance
- *
- * @return float
- */
- public function getAccountBalance()
- {
- return $this->accountBalance;
- }
- /**
- * Set accountBalanceUpdateDate
- *
- * @param \DateTime $accountBalanceUpdateDate
- *
- * @return AccessBilling
- */
- public function setAccountBalanceUpdateDate($accountBalanceUpdateDate)
- {
- $this->accountBalanceUpdateDate = $accountBalanceUpdateDate;
- return $this;
- }
- /**
- * Get accountBalanceUpdateDate
- *
- * @return \DateTime
- */
- public function getAccountBalanceUpdateDate()
- {
- return $this->accountBalanceUpdateDate;
- }
- /**
- * Set reportPaymentsAmount
- *
- * @param float $reportPaymentsAmount
- *
- * @return AccessBilling
- */
- public function setReportPaymentsAmount($reportPaymentsAmount)
- {
- $this->reportPaymentsAmount = $reportPaymentsAmount;
- return $this;
- }
- /**
- * Get reportPaymentsAmount
- *
- * @return float
- */
- public function getReportPaymentsAmount()
- {
- return $this->reportPaymentsAmount;
- }
- /**
- * Add accountBalanceReimbursement
- *
- * @param \AppBundle\Entity\Billing\BillPayment $accountBalanceReimbursement
- *
- * @return AccessBilling
- */
- public function addAccountBalanceReimbursement(\AppBundle\Entity\Billing\BillPayment $accountBalanceReimbursement)
- {
- $accountBalanceReimbursement->setAccessBillingAccountBalanceReimbursement($this);
- $this->accountBalanceReimbursements[] = $accountBalanceReimbursement;
- return $this;
- }
- /**
- * Remove accountBalanceReimbursement
- *
- * @param \AppBundle\Entity\Billing\BillPayment $accountBalanceReimbursement
- */
- public function removeAccountBalanceReimbursement(\AppBundle\Entity\Billing\BillPayment $accountBalanceReimbursement)
- {
- $this->accountBalanceReimbursements->removeElement($accountBalanceReimbursement);
- }
- /**
- * Get accountBalanceReimbursements
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getAccountBalanceReimbursements()
- {
- return $this->accountBalanceReimbursements;
- }
- }
|