src/Entity/Payment.php line 20

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaymentRepository;
  4. use App\Traits\TimeStampTrait;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. use Symfony\Component\Uid\Uuid;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. #[ORM\Entity(repositoryClassPaymentRepository::class)]
  13. #[ORM\HasLifecycleCallbacks]
  14. #[UniqueEntity(
  15.     fields: ['code']
  16. )]
  17. class Payment
  18. {
  19.     use TimeStampTrait;
  20.     #[ORM\Id]
  21.     #[ORM\GeneratedValue]
  22.     #[ORM\Column(type'integer')]
  23.     private $id;
  24.     #[ORM\Column(type'uuid'uniquetruenullabletrue)]
  25.     private ?Uuid $code;
  26.     #[ORM\Column(length100nullabletrue)]
  27.     private ?string $verificationCode null;
  28.     #[ORM\Column(nullabletrue)]
  29.     private ?bool $status null;
  30.     #[ORM\Column(nullabletrue)]
  31.     private ?bool $step null;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?bool $paid null;
  34.     #[ORM\Column(nullabletrue)]
  35.     private ?bool $closed null;
  36.     #[ORM\Column(length100nullabletrue)]
  37.     private ?string $reference null;
  38.     #[ORM\Column(length30nullabletrue)]
  39.     private ?string $token null;
  40.     #[ORM\Column(nullabletrue)]
  41.     private ?bool $sent null;
  42.     #[ORM\ManyToOne(inversedBy'payments')]
  43.     private ?Annee $annee null;
  44.     #[ORM\Column(length100nullabletrue)]
  45.     private ?string $depositeur null;
  46.     #[ORM\Column(type'date'nullabletrue)]
  47.     private $paymentdate;
  48.     #[ORM\ManyToOne(inversedBy'payments')]
  49.     private ?PaymentMode $paymentmode null;
  50.     #[ORM\Column(length255nullabletrue)]
  51.     private ?string $commentaire null;
  52.     #[ORM\ManyToOne(inversedBy'payments')]
  53.     private ?User $createdBy null;
  54.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  55.     private ?string $totalAmount null;
  56.     #[ORM\Column(typeTypes::DECIMALprecision10scale2)]
  57.     private ?string $singleAmount null;
  58.     #[ORM\Column(length100nullabletrue)]
  59.     private ?string $type null;
  60.     #[ORM\ManyToOne(inversedBy'payments')]
  61.     private ?Entreprise $marchand null;
  62.     #[ORM\ManyToOne(cascade: ['all'], fetch'EAGER'inversedBy'payments')]
  63.     private ?Location $location null;
  64.     #[ORM\ManyToMany(targetEntityMois::class, inversedBy'payments')]
  65.     private Collection $mois;
  66.     #[ORM\Column(length25nullabletrue)]
  67.     private ?string $generatortype null;
  68.     #[ORM\Column(length50nullabletrue)]
  69.     private ?string $cashInBy null;
  70.     #[ORM\Column(nullabletrue)]
  71.     private ?bool $partialPayment null;
  72.     #[ORM\Column(typeTypes::DECIMALprecision10scale2nullabletrue)]
  73.     private ?string $partialAmount null;
  74.     #[ORM\OneToMany(mappedBy'payment'targetEntityPay::class, cascade: ['all'], fetch'EAGER')]
  75.     private Collection $pays;
  76.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  77.     private ?\DateTimeInterface $paidAt null;
  78.     #[ORM\Column(nullabletrue)]
  79.     private ?bool $monthlyNotif null;
  80.     #[ORM\Column(length50nullabletrue)]
  81.     private ?string $month null;
  82.     #[ORM\OneToMany(mappedBy'payment'targetEntityCharge::class, cascade: ['all'], fetch'EAGER')]
  83.     private Collection $charges;
  84.     #[ORM\Column(length50nullabletrue)]
  85.     private ?string $year null;
  86.     #[ORM\OneToMany(mappedBy'payment'targetEntityChargeAllocation::class)]
  87.     private Collection $chargeAllocations;
  88.     #[ORM\Column(length10nullabletrue)]
  89.     private ?string $dgiCurrencyCode null;
  90.     #[ORM\Column(typeTypes::DECIMALprecision18scale6nullabletrue)]
  91.     private ?string $dgiCurrencyRate null;
  92.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  93.     private ?\DateTimeInterface $dgiCurrencyDate null;
  94.     #[ORM\Column(typeTypes::DECIMALprecision14scale2nullabletrue)]
  95.     private ?string $dgiAmountCdf null;
  96.     #[ORM\Column(typeTypes::DECIMALprecision5scale2nullabletrue)]
  97.     private ?string $dgiTaxRate null;
  98.     #[ORM\Column(typeTypes::DECIMALprecision14scale2nullabletrue)]
  99.     private ?string $dgiTaxAmount null;
  100.     #[ORM\OneToOne(mappedBy'payment'targetEntityPaymentDgi::class, cascade: ['persist''remove'])]
  101.     private ?PaymentDgi $paymentDgi null;
  102.     public function getId()
  103.     {
  104.         return $this->id;
  105.     }
  106.     public function setId($id): void
  107.     {
  108.         $this->id $id;
  109.     }
  110.     public function getCode(): ?Uuid
  111.     {
  112.         return $this->code;
  113.     }
  114.     public function setCode(Uuid $code): self
  115.     {
  116.         $this->code $code;
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return string|null
  121.      */
  122.     public function getVerificationCode(): ?string
  123.     {
  124.         return $this->verificationCode;
  125.     }
  126.     /**
  127.      * @param string|null $verificationCode
  128.      */
  129.     public function setVerificationCode(?string $verificationCode): void
  130.     {
  131.         $this->verificationCode $verificationCode;
  132.     }
  133.     /**
  134.      * @return bool|null
  135.      */
  136.     public function getStatus(): ?bool
  137.     {
  138.         return $this->status;
  139.     }
  140.     /**
  141.      * @param bool|null $status
  142.      */
  143.     public function setStatus(?bool $status): void
  144.     {
  145.         $this->status $status;
  146.     }
  147.     /**
  148.      * @return bool|null
  149.      */
  150.     public function getStep(): ?bool
  151.     {
  152.         return $this->step;
  153.     }
  154.     /**
  155.      * @param bool|null $step
  156.      */
  157.     public function setStep(?bool $step): void
  158.     {
  159.         $this->step $step;
  160.     }
  161.     /**
  162.      * @return bool|null
  163.      */
  164.     public function getPaid(): ?bool
  165.     {
  166.         return $this->paid;
  167.     }
  168.     /**
  169.      * @param bool|null $paid
  170.      */
  171.     public function setPaid(?bool $paid): void
  172.     {
  173.         $this->paid $paid;
  174.     }
  175.     /**
  176.      * @return bool|null
  177.      */
  178.     public function getClosed(): ?bool
  179.     {
  180.         return $this->closed;
  181.     }
  182.     /**
  183.      * @param bool|null $closed
  184.      */
  185.     public function setClosed(?bool $closed): void
  186.     {
  187.         $this->closed $closed;
  188.     }
  189.     /**
  190.      * @return string|null
  191.      */
  192.     public function getReference(): ?string
  193.     {
  194.         return $this->reference;
  195.     }
  196.     /**
  197.      * @param string|null $reference
  198.      */
  199.     public function setReference(?string $reference): void
  200.     {
  201.         $this->reference $reference;
  202.     }
  203.     /**
  204.      * @return string|null
  205.      */
  206.     public function getToken(): ?string
  207.     {
  208.         return $this->token;
  209.     }
  210.     /**
  211.      * @param string|null $token
  212.      */
  213.     public function setToken(?string $token): void
  214.     {
  215.         $this->token $token;
  216.     }
  217.     /**
  218.      * @return bool|null
  219.      */
  220.     public function getSent(): ?bool
  221.     {
  222.         return $this->sent;
  223.     }
  224.     /**
  225.      * @param bool|null $sent
  226.      */
  227.     public function setSent(?bool $sent): void
  228.     {
  229.         $this->sent $sent;
  230.     }
  231.     /**
  232.      * @return Annee|null
  233.      */
  234.     public function getAnnee(): ?Annee
  235.     {
  236.         return $this->annee;
  237.     }
  238.     /**
  239.      * @param Annee|null $annee
  240.      */
  241.     public function setAnnee(?Annee $annee): void
  242.     {
  243.         $this->annee $annee;
  244.     }
  245.     /**
  246.      * @return string|null
  247.      */
  248.     public function getDepositeur(): ?string
  249.     {
  250.         return $this->depositeur;
  251.     }
  252.     /**
  253.      * @param string|null $depositeur
  254.      */
  255.     public function setDepositeur(?string $depositeur): void
  256.     {
  257.         $this->depositeur $depositeur;
  258.     }
  259.     /**
  260.      * @return mixed
  261.      */
  262.     public function getPaymentdate()
  263.     {
  264.         return $this->paymentdate;
  265.     }
  266.     /**
  267.      * @param mixed $paymentdate
  268.      */
  269.     public function setPaymentdate($paymentdate): void
  270.     {
  271.         $this->paymentdate $paymentdate;
  272.     }
  273.     /**
  274.      * @return PaymentMode|null
  275.      */
  276.     public function getPaymentmode(): ?PaymentMode
  277.     {
  278.         return $this->paymentmode;
  279.     }
  280.     /**
  281.      * @param PaymentMode|null $paymentmode
  282.      */
  283.     public function setPaymentmode(?PaymentMode $paymentmode): void
  284.     {
  285.         $this->paymentmode $paymentmode;
  286.     }
  287.     /**
  288.      * @return string|null
  289.      */
  290.     public function getCommentaire(): ?string
  291.     {
  292.         return $this->commentaire;
  293.     }
  294.     /**
  295.      * @param string|null $commentaire
  296.      */
  297.     public function setCommentaire(?string $commentaire): void
  298.     {
  299.         $this->commentaire $commentaire;
  300.     }
  301.     /**
  302.      * @return User|null
  303.      */
  304.     public function getCreatedBy(): ?User
  305.     {
  306.         return $this->createdBy;
  307.     }
  308.     /**
  309.      * @param User|null $createdBy
  310.      */
  311.     public function setCreatedBy(?User $createdBy): void
  312.     {
  313.         $this->createdBy $createdBy;
  314.     }
  315.     /**
  316.      * @return string|null
  317.      */
  318.     public function getTotalAmount(): ?string
  319.     {
  320.         return $this->totalAmount;
  321.     }
  322.     /**
  323.      * @param string|null $totalAmount
  324.      */
  325.     public function setTotalAmount(?string $totalAmount): void
  326.     {
  327.         $this->totalAmount $totalAmount;
  328.     }
  329.     /**
  330.      * @return string|null
  331.      */
  332.     public function getSingleAmount(): ?string
  333.     {
  334.         return $this->singleAmount;
  335.     }
  336.     /**
  337.      * @param string|null $singleAmount
  338.      */
  339.     public function setSingleAmount(?string $singleAmount): void
  340.     {
  341.         $this->singleAmount $singleAmount;
  342.     }
  343.     /**
  344.      * @return string|null
  345.      */
  346.     public function getType(): ?string
  347.     {
  348.         return $this->type;
  349.     }
  350.     /**
  351.      * @param string|null $type
  352.      */
  353.     public function setType(?string $type): void
  354.     {
  355.         $this->type $type;
  356.     }
  357.     /**
  358.      * @return Entreprise|null
  359.      */
  360.     public function getMarchand(): ?Entreprise
  361.     {
  362.         return $this->marchand;
  363.     }
  364.     /**
  365.      * @param Entreprise|null $marchand
  366.      */
  367.     public function setMarchand(?Entreprise $marchand): void
  368.     {
  369.         $this->marchand $marchand;
  370.     }
  371.     /**
  372.      * @return Location|null
  373.      */
  374.     public function getLocation(): ?Location
  375.     {
  376.         return $this->location;
  377.     }
  378.     /**
  379.      * @param Location|null $location
  380.      */
  381.     public function setLocation(?Location $location): void
  382.     {
  383.         $this->location $location;
  384.     }
  385.     public function __construct()
  386.     {
  387.         $this->mois = new ArrayCollection();
  388.         $this->pays = new ArrayCollection();
  389.         $this->charges = new ArrayCollection();
  390.         $this->chargeAllocations = new ArrayCollection();
  391.     }
  392.     /**
  393.      * @return Collection<int, Mois>
  394.      */
  395.     public function getMois(): Collection
  396.     {
  397.         return $this->mois;
  398.     }
  399.     public function addMoi(Mois $moi): static
  400.     {
  401.         if (!$this->mois->contains($moi)) {
  402.             $this->mois->add($moi);
  403.         }
  404.         return $this;
  405.     }
  406.     public function removeMoi(Mois $moi): static
  407.     {
  408.         $this->mois->removeElement($moi);
  409.         return $this;
  410.     }
  411.     public function getGeneratortype(): ?string
  412.     {
  413.         return $this->generatortype;
  414.     }
  415.     public function setGeneratortype(?string $generatortype): static
  416.     {
  417.         $this->generatortype $generatortype;
  418.         return $this;
  419.     }
  420.     public function getCashInBy(): ?string
  421.     {
  422.         return $this->cashInBy;
  423.     }
  424.     public function setCashInBy(?string $cashInBy): static
  425.     {
  426.         $this->cashInBy $cashInBy;
  427.         return $this;
  428.     }
  429.     public function isPartialPayment(): ?bool
  430.     {
  431.         return $this->partialPayment;
  432.     }
  433.     public function setPartialPayment(?bool $partialPayment): static
  434.     {
  435.         $this->partialPayment $partialPayment;
  436.         return $this;
  437.     }
  438.     public function getPartialAmount(): ?string
  439.     {
  440.         return $this->partialAmount;
  441.     }
  442.     public function setPartialAmount(?float $partialAmount): static
  443.     {
  444.         $this->partialAmount $partialAmount;
  445.         return $this;
  446.     }
  447.     /**
  448.      * @return Collection<int, Pay>
  449.      */
  450.     public function getPays(): Collection
  451.     {
  452.         return $this->pays;
  453.     }
  454.     public function addPay(Pay $pay): static
  455.     {
  456.         if (!$this->pays->contains($pay)) {
  457.             $this->pays->add($pay);
  458.             $pay->setPayment($this);
  459.         }
  460.         return $this;
  461.     }
  462.     public function removePay(Pay $pay): static
  463.     {
  464.         if ($this->pays->removeElement($pay)) {
  465.             // set the owning side to null (unless already changed)
  466.             if ($pay->getPayment() === $this) {
  467.                 $pay->setPayment(null);
  468.             }
  469.         }
  470.         return $this;
  471.     }
  472.     public function getPaidAt(): ?\DateTimeInterface
  473.     {
  474.         return $this->paidAt;
  475.     }
  476.     public function setPaidAt(?\DateTimeInterface $paidAt): static
  477.     {
  478.         $this->paidAt $paidAt;
  479.         return $this;
  480.     }
  481.     public function isMonthlyNotif(): ?bool
  482.     {
  483.         return $this->monthlyNotif;
  484.     }
  485.     public function setMonthlyNotif(?bool $monthlyNotif): static
  486.     {
  487.         $this->monthlyNotif $monthlyNotif;
  488.         return $this;
  489.     }
  490.     public function getMonth(): ?string
  491.     {
  492.         return $this->month;
  493.     }
  494.     public function setMonth(?string $month): static
  495.     {
  496.         $this->month $month;
  497.         return $this;
  498.     }
  499.     /**
  500.      * @return Collection<int, Charge>
  501.      */
  502.     public function getCharges(): Collection
  503.     {
  504.         return $this->charges;
  505.     }
  506.     public function addCharge(Charge $charge): static
  507.     {
  508.         if (!$this->charges->contains($charge)) {
  509.             $this->charges->add($charge);
  510.             $charge->setPayment($this);
  511.         }
  512.         return $this;
  513.     }
  514.     public function removeCharge(Charge $charge): static
  515.     {
  516.         if ($this->charges->removeElement($charge)) {
  517.             // set the owning side to null (unless already changed)
  518.             if ($charge->getPayment() === $this) {
  519.                 $charge->setPayment(null);
  520.             }
  521.         }
  522.         return $this;
  523.     }
  524.     public function getYear(): ?string
  525.     {
  526.         return $this->year;
  527.     }
  528.     public function setYear(?string $year): static
  529.     {
  530.         $this->year $year;
  531.         return $this;
  532.     }
  533.     /**
  534.      * @return Collection<int, ChargeAllocation>
  535.      */
  536.     public function getChargeAllocations(): Collection
  537.     {
  538.         return $this->chargeAllocations;
  539.     }
  540.     public function addChargeAllocation(ChargeAllocation $chargeAllocation): static
  541.     {
  542.         if (!$this->chargeAllocations->contains($chargeAllocation)) {
  543.             $this->chargeAllocations->add($chargeAllocation);
  544.             $chargeAllocation->setPayment($this);
  545.         }
  546.         return $this;
  547.     }
  548.     public function removeChargeAllocation(ChargeAllocation $chargeAllocation): static
  549.     {
  550.         if ($this->chargeAllocations->removeElement($chargeAllocation)) {
  551.             // set the owning side to null (unless already changed)
  552.             if ($chargeAllocation->getPayment() === $this) {
  553.                 $chargeAllocation->setPayment(null);
  554.             }
  555.         }
  556.         return $this;
  557.     }
  558.     public function getPaymentDgi(): ?PaymentDgi
  559.     {
  560.         return $this->paymentDgi;
  561.     }
  562.     public function setPaymentDgi(?PaymentDgi $paymentDgi): static
  563.     {
  564.         // unset the owning side of the relation if necessary
  565.         if ($paymentDgi === null && $this->paymentDgi !== null) {
  566.             $this->paymentDgi->setPayment(null);
  567.         }
  568.         // set the owning side of the relation if necessary
  569.         if ($paymentDgi !== null && $paymentDgi->getPayment() !== $this) {
  570.             $paymentDgi->setPayment($this);
  571.         }
  572.         $this->paymentDgi $paymentDgi;
  573.         return $this;
  574.     }
  575.     public function getDgiCurrencyCode(): ?string
  576.     {
  577.         return $this->dgiCurrencyCode;
  578.     }
  579.     public function setDgiCurrencyCode(?string $dgiCurrencyCode): static
  580.     {
  581.         $this->dgiCurrencyCode $dgiCurrencyCode;
  582.         return $this;
  583.     }
  584.     public function getDgiCurrencyRate(): ?string
  585.     {
  586.         return $this->dgiCurrencyRate;
  587.     }
  588.     public function setDgiCurrencyRate(?string $dgiCurrencyRate): static
  589.     {
  590.         $this->dgiCurrencyRate $dgiCurrencyRate;
  591.         return $this;
  592.     }
  593.     public function getDgiCurrencyDate(): ?\DateTimeInterface
  594.     {
  595.         return $this->dgiCurrencyDate;
  596.     }
  597.     public function setDgiCurrencyDate(?\DateTimeInterface $dgiCurrencyDate): static
  598.     {
  599.         $this->dgiCurrencyDate $dgiCurrencyDate;
  600.         return $this;
  601.     }
  602.     public function getDgiAmountCdf(): ?string
  603.     {
  604.         return $this->dgiAmountCdf;
  605.     }
  606.     public function setDgiAmountCdf(?string $dgiAmountCdf): static
  607.     {
  608.         $this->dgiAmountCdf $dgiAmountCdf;
  609.         return $this;
  610.     }
  611.     public function getDgiTaxRate(): ?string
  612.     {
  613.         return $this->dgiTaxRate;
  614.     }
  615.     public function setDgiTaxRate(?string $dgiTaxRate): static
  616.     {
  617.         $this->dgiTaxRate $dgiTaxRate;
  618.         return $this;
  619.     }
  620.     public function getDgiTaxAmount(): ?string
  621.     {
  622.         return $this->dgiTaxAmount;
  623.     }
  624.     public function setDgiTaxAmount(?string $dgiTaxAmount): static
  625.     {
  626.         $this->dgiTaxAmount $dgiTaxAmount;
  627.         return $this;
  628.     }
  629. }