src/Entity/FacturePatient.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FacturePatientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FacturePatientRepository::class)
  9.  */
  10. class FacturePatient
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime")
  20.      */
  21.     private $date;
  22.     /**
  23.      * @ORM\Column(type="boolean", nullable=true)
  24.      */
  25.     private $isPayer;
  26.     /**
  27.      * @ORM\Column(type="boolean", nullable=true)
  28.      */
  29.     private $isLivrer;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=TypeFacture::class, inversedBy="facturePatients")
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private $typefacture;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=IctusPharmacie::class, inversedBy="facturePatients")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $pharmacie;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="facturePatients")
  42.      * @ORM\JoinColumn(nullable=false)
  43.      */
  44.     private $User;
  45.     /**
  46.      * @ORM\OneToOne(targetEntity=CommandeSpecial::class, inversedBy="facturePatient", cascade={"persist", "remove"})
  47.      */
  48.     private $commandespecial;
  49.     /**
  50.      * @ORM\OneToMany(targetEntity=DetailFacturePatient::class, mappedBy="facturePatient", orphanRemoval=true)
  51.      */
  52.     private $detailFacturePatients;
  53.     /**
  54.      * @ORM\Column(type="integer")
  55.      */
  56.     private $reference;
  57.     /**
  58.      * @ORM\ManyToOne(targetEntity=IctusCommande::class, inversedBy="facturePatients")
  59.      */
  60.     private $commande;
  61.     /**
  62.      * @ORM\Column(type="boolean", nullable=true)
  63.      */
  64.     private $isCanceled;
  65.     /**
  66.      * @ORM\OneToMany(targetEntity=IctusReclamation::class, mappedBy="facture")
  67.      */
  68.     private $ictusReclamations;
  69.     public function __construct()
  70.     {
  71.         $this->detailFacturePatients = new ArrayCollection();
  72.         $this->ictusReclamations = new ArrayCollection();
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getDate(): ?\DateTimeInterface
  79.     {
  80.         return $this->date;
  81.     }
  82.     public function setDate(\DateTimeInterface $date): self
  83.     {
  84.         $this->date $date;
  85.         return $this;
  86.     }
  87.     public function isIsPayer(): ?bool
  88.     {
  89.         return $this->isPayer;
  90.     }
  91.     public function setIsPayer(?bool $isPayer): self
  92.     {
  93.         $this->isPayer $isPayer;
  94.         return $this;
  95.     }
  96.     public function isIsLivrer(): ?bool
  97.     {
  98.         return $this->isLivrer;
  99.     }
  100.     public function setIsLivrer(?bool $isLivrer): self
  101.     {
  102.         $this->isLivrer $isLivrer;
  103.         return $this;
  104.     }
  105.     public function getTypefacture(): ?TypeFacture
  106.     {
  107.         return $this->typefacture;
  108.     }
  109.     public function setTypefacture(?TypeFacture $typefacture): self
  110.     {
  111.         $this->typefacture $typefacture;
  112.         return $this;
  113.     }
  114.     public function getPharmacie(): ?IctusPharmacie
  115.     {
  116.         return $this->pharmacie;
  117.     }
  118.     public function setPharmacie(?IctusPharmacie $pharmacie): self
  119.     {
  120.         $this->pharmacie $pharmacie;
  121.         return $this;
  122.     }
  123.     public function getUser(): ?User
  124.     {
  125.         return $this->User;
  126.     }
  127.     public function setUser(?User $User): self
  128.     {
  129.         $this->User $User;
  130.         return $this;
  131.     }
  132.     public function getCommandespecial(): ?CommandeSpecial
  133.     {
  134.         return $this->commandespecial;
  135.     }
  136.     public function setCommandespecial(?CommandeSpecial $commandespecial): self
  137.     {
  138.         $this->commandespecial $commandespecial;
  139.         return $this;
  140.     }
  141.     /**
  142.      * @return Collection<int, DetailFacturePatient>
  143.      */
  144.     public function getDetailFacturePatients(): Collection
  145.     {
  146.         return $this->detailFacturePatients;
  147.     }
  148.     public function addDetailFacturePatient(DetailFacturePatient $detailFacturePatient): self
  149.     {
  150.         if (!$this->detailFacturePatients->contains($detailFacturePatient)) {
  151.             $this->detailFacturePatients[] = $detailFacturePatient;
  152.             $detailFacturePatient->setFacturePatient($this);
  153.         }
  154.         return $this;
  155.     }
  156.     public function removeDetailFacturePatient(DetailFacturePatient $detailFacturePatient): self
  157.     {
  158.         if ($this->detailFacturePatients->removeElement($detailFacturePatient)) {
  159.             // set the owning side to null (unless already changed)
  160.             if ($detailFacturePatient->getFacturePatient() === $this) {
  161.                 $detailFacturePatient->setFacturePatient(null);
  162.             }
  163.         }
  164.         return $this;
  165.     }
  166.     public function getMontantTotal()
  167.     {
  168.         $total 0;
  169.         foreach ($this->detailFacturePatients as $detail) {
  170.             $total += $detail->getPrixUnitaireTTC() * $detail->getQuantite();
  171.         }
  172.         return $total $this->typefacture->getValue();
  173.     }
  174.     public function getReference(): ?int
  175.     {
  176.         return $this->reference;
  177.     }
  178.     public function setReference(int $reference): self
  179.     {
  180.         $this->reference $reference;
  181.         return $this;
  182.     }
  183.     public function getCommande(): ?IctusCommande
  184.     {
  185.         return $this->commande;
  186.     }
  187.     public function setCommande(?IctusCommande $commande): self
  188.     {
  189.         $this->commande $commande;
  190.         return $this;
  191.     }
  192.     public function isIsCanceled(): ?bool
  193.     {
  194.         return $this->isCanceled;
  195.     }
  196.     public function setIsCanceled(?bool $isCanceled): self
  197.     {
  198.         $this->isCanceled $isCanceled;
  199.         return $this;
  200.     }
  201.     /**
  202.      * @return Collection<int, IctusReclamation>
  203.      */
  204.     public function getIctusReclamations(): Collection
  205.     {
  206.         return $this->ictusReclamations;
  207.     }
  208.     public function addIctusReclamation(IctusReclamation $ictusReclamation): self
  209.     {
  210.         if (!$this->ictusReclamations->contains($ictusReclamation)) {
  211.             $this->ictusReclamations[] = $ictusReclamation;
  212.             $ictusReclamation->setFacture($this);
  213.         }
  214.         return $this;
  215.     }
  216.     public function removeIctusReclamation(IctusReclamation $ictusReclamation): self
  217.     {
  218.         if ($this->ictusReclamations->removeElement($ictusReclamation)) {
  219.             // set the owning side to null (unless already changed)
  220.             if ($ictusReclamation->getFacture() === $this) {
  221.                 $ictusReclamation->setFacture(null);
  222.             }
  223.         }
  224.         return $this;
  225.     }
  226. }