src/Entity/Reglement.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\Company;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\ReglementRepository")
  9.  */
  10. class Reglement
  11. {
  12.     const MODE_CHEQUE 'cheque';
  13.     const MODE_CB 'cb';
  14.     const MODE_ESPECES 'especes';
  15.     const MODE_VIREMENT 'virement';
  16.     const MODE_SEPA 'sepa';
  17.     const STATUS_ISSUED 'Emis';
  18.     const STATUS_CANCEL 'Annulé';
  19.     const CANCEL_STATUS_1 'Régularisation';
  20.     const CANCEL_STATUS_2 'Provision insuffisante';
  21.     const CANCEL_STATUS_3 'Contestation débiteur';
  22.     const CANCEL_STATUS_4 'Compte clôturé';
  23.     const CANCEL_STATUS_5 'Autre';
  24.     const CANCEL_STATUS_6 'Remboursement';
  25.     /**
  26.      * @ORM\Id()
  27.      * @ORM\GeneratedValue()
  28.      * @ORM\Column(type="integer")
  29.      */
  30.     private $id;
  31.     /**
  32.      * @ORM\Column(type="string", length=500, nullable=true)
  33.      */
  34.     private $mode;
  35.     /**
  36.      * @ORM\Column(type="string", length=500, nullable=true)
  37.      */
  38.     private $reference;
  39.     /**
  40.      * @ORM\Column(type="string", length=500, nullable=true)
  41.      */
  42.     private $status;
  43.     /**
  44.      * @ORM\OneToMany(targetEntity="App\Entity\Billing", mappedBy="reglement")
  45.      */
  46.     private $billings;
  47.     /**
  48.      * @ORM\Column(type="datetime")
  49.      */
  50.     private $date;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true)
  53.      */
  54.     private $dateRemiseChaque;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\Client", inversedBy="reglements")
  57.      */
  58.     private $client;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Company::class, inversedBy="reglements")
  61.      */
  62.     private $company;
  63.     /**
  64.      * @ORM\Column(type="float", nullable=true)
  65.      */
  66.     private $ttc;
  67.     /**
  68.      * @ORM\Column(type="string", length=500, nullable=true)
  69.      */
  70.     private $numeroRemise;
  71.     /**
  72.      * @ORM\Column(type="string", length=500, nullable=true)
  73.      */
  74.     private $motifCancel;
  75.     public function __construct()
  76.     {
  77.         $this->status self::STATUS_ISSUED;
  78.         $this->billings = new ArrayCollection();
  79.         $this->date = new \DateTime('now');
  80.     }
  81.     public function __toString()
  82.     {
  83.         return (string) $this->id;
  84.     }
  85.     public function getId()
  86.     {
  87.         return $this->id;
  88.     }
  89.     public function getMode(): ?string
  90.     {
  91.         return $this->mode;
  92.     }
  93.     public function setMode(?string $mode): self
  94.     {
  95.         $this->mode $mode;
  96.         return $this;
  97.     }
  98.     public function getReference(): ?string
  99.     {
  100.         return $this->reference;
  101.     }
  102.     public function setReference(?string $reference): self
  103.     {
  104.         $this->reference $reference;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection|Billing[]
  109.      */
  110.     public function getBillings(): Collection
  111.     {
  112.         return $this->billings;
  113.     }
  114.     /**
  115.      * @return Collection|Billing[]
  116.      */
  117.     public function setBillings($billings)
  118.     {
  119.         $this->billings $billings;
  120.     }
  121.     public function addBilling(Billing $billing): self
  122.     {
  123.         if (!$this->billings->contains($billing)) {
  124.             $this->billings[] = $billing;
  125.             $billing->setReglement($this);
  126.         }
  127.         return $this;
  128.     }
  129.     public function removeBilling(Billing $billing): self
  130.     {
  131.         if ($this->billings->contains($billing)) {
  132.             $this->billings->removeElement($billing);
  133.             // set the owning side to null (unless already changed)
  134.             if ($billing->getReglement() === $this) {
  135.                 $billing->setReglement(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     public function getDate(): ?\DateTimeInterface
  141.     {
  142.         return $this->date;
  143.     }
  144.     public function setDate(\DateTimeInterface $date): self
  145.     {
  146.         $this->date $date;
  147.         return $this;
  148.     }
  149.     public function getClient(): ?Client
  150.     {
  151.         return $this->client;
  152.     }
  153.     public function setClient(?Client $client): self
  154.     {
  155.         $this->client $client;
  156.         return $this;
  157.     }
  158.     public function getTtc(): ?float
  159.     {
  160.         return $this->ttc;
  161.     }
  162.     public function setTtc(?float $ttc): self
  163.     {
  164.         $this->ttc $ttc;
  165.         return $this;
  166.     }
  167.     public function getNumeroRemise(): ?string
  168.     {
  169.         return $this->numeroRemise;
  170.     }
  171.     public function setNumeroRemise(?string $numeroRemise): self
  172.     {
  173.         $this->numeroRemise $numeroRemise;
  174.         return $this;
  175.     }
  176.     /**
  177.      * @return mixed
  178.      */
  179.     public function getDateRemiseChaque()
  180.     {
  181.         return $this->dateRemiseChaque;
  182.     }
  183.     /**
  184.      * @param mixed $dateRemiseChaque
  185.      */
  186.     public function setDateRemiseChaque($dateRemiseChaque): void
  187.     {
  188.         $this->dateRemiseChaque $dateRemiseChaque;
  189.     }
  190.     /**
  191.      * @return Company
  192.      */
  193.     public function getCompany()
  194.     {
  195.         return $this->company;
  196.     }
  197.     /**
  198.      * @param mixed $company
  199.      */
  200.     public function setCompany($company): void
  201.     {
  202.         $this->company $company;
  203.     }
  204.     /**
  205.      * @return mixed
  206.      */
  207.     public function getStatus()
  208.     {
  209.         return $this->status;
  210.     }
  211.     /**
  212.      * @param mixed $status
  213.      */
  214.     public function setStatus($status): void
  215.     {
  216.         $this->status $status;
  217.     }
  218.     /**
  219.      * @return mixed
  220.      */
  221.     public function getMotifCancel()
  222.     {
  223.         return $this->motifCancel;
  224.     }
  225.     /**
  226.      * @param mixed $motifCancel
  227.      */
  228.     public function setMotifCancel($motifCancel): void
  229.     {
  230.         $this->motifCancel $motifCancel;
  231.     }
  232. }