src/Entity/FacturePatient.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\Collection;
  5. use App\Repository\FacturePatientRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  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.     /**
  70.      * @ORM\Column(type="float", nullable=true)
  71.      */
  72.     private $remise;
  73.     /**
  74.      * @ORM\OneToOne(targetEntity=PrisEnCharge::class, inversedBy="facturePatient", cascade={"persist", "remove"})
  75.      */
  76.     private $prisencharge;
  77.     public function __construct()
  78.     {
  79.         $this->detailFacturePatients = new ArrayCollection();
  80.         $this->ictusReclamations = new ArrayCollection();
  81.     }
  82.     public function getId(): ?int
  83.     {
  84.         return $this->id;
  85.     }
  86.     public function getDate(): ?\DateTimeInterface
  87.     {
  88.         return $this->date;
  89.     }
  90.     public function setDate(\DateTimeInterface $date): self
  91.     {
  92.         $this->date $date;
  93.         return $this;
  94.     }
  95.     public function isIsPayer(): ?bool
  96.     {
  97.         return $this->isPayer;
  98.     }
  99.     public function setIsPayer(?bool $isPayer): self
  100.     {
  101.         $this->isPayer $isPayer;
  102.         return $this;
  103.     }
  104.     public function isIsLivrer(): ?bool
  105.     {
  106.         return $this->isLivrer;
  107.     }
  108.     public function setIsLivrer(?bool $isLivrer): self
  109.     {
  110.         $this->isLivrer $isLivrer;
  111.         return $this;
  112.     }
  113.     public function getTypefacture(): ?TypeFacture
  114.     {
  115.         return $this->typefacture;
  116.     }
  117.     public function setTypefacture(?TypeFacture $typefacture): self
  118.     {
  119.         $this->typefacture $typefacture;
  120.         return $this;
  121.     }
  122.     public function getPharmacie(): ?IctusPharmacie
  123.     {
  124.         return $this->pharmacie;
  125.     }
  126.     public function setPharmacie(?IctusPharmacie $pharmacie): self
  127.     {
  128.         $this->pharmacie $pharmacie;
  129.         return $this;
  130.     }
  131.     public function getUser(): ?User
  132.     {
  133.         return $this->User;
  134.     }
  135.     public function setUser(?User $User): self
  136.     {
  137.         $this->User $User;
  138.         return $this;
  139.     }
  140.     public function getCommandespecial(): ?CommandeSpecial
  141.     {
  142.         return $this->commandespecial;
  143.     }
  144.     public function setCommandespecial(?CommandeSpecial $commandespecial): self
  145.     {
  146.         $this->commandespecial $commandespecial;
  147.         return $this;
  148.     }
  149.     /**
  150.      * @return Collection<int, DetailFacturePatient>
  151.      */
  152.     public function getDetailFacturePatients(): Collection
  153.     {
  154.         return $this->detailFacturePatients;
  155.     }
  156.     public function addDetailFacturePatient(DetailFacturePatient $detailFacturePatient): self
  157.     {
  158.         if (!$this->detailFacturePatients->contains($detailFacturePatient)) {
  159.             $this->detailFacturePatients[] = $detailFacturePatient;
  160.             $detailFacturePatient->setFacturePatient($this);
  161.         }
  162.         return $this;
  163.     }
  164.     public function removeDetailFacturePatient(DetailFacturePatient $detailFacturePatient): self
  165.     {
  166.         if ($this->detailFacturePatients->removeElement($detailFacturePatient)) {
  167.             // set the owning side to null (unless already changed)
  168.             if ($detailFacturePatient->getFacturePatient() === $this) {
  169.                 $detailFacturePatient->setFacturePatient(null);
  170.             }
  171.         }
  172.         return $this;
  173.     }
  174.     public function getMontantTotal()
  175.     {
  176.         $total 0;
  177.         foreach ($this->detailFacturePatients as $detail) {
  178.             $total += $detail->getPrixUnitaireTTC() * $detail->getQuantite();
  179.         }
  180.         return $total $this->typefacture->getValue();
  181.     }
  182.     public function getReference(): ?int
  183.     {
  184.         return $this->reference;
  185.     }
  186.     public function getStringReference(): ?string
  187.     {
  188.         return "ICTFACT_".$this->getPharmacie()->getId()."_".$this->getReference();
  189.     }
  190.     public function setReference(int $reference): self
  191.     {
  192.         $this->reference $reference;
  193.         return $this;
  194.     }
  195.     public function getCommande(): ?IctusCommande
  196.     {
  197.         return $this->commande;
  198.     }
  199.     public function setCommande(?IctusCommande $commande): self
  200.     {
  201.         $this->commande $commande;
  202.         return $this;
  203.     }
  204.     public function isIsCanceled(): ?bool
  205.     {
  206.         return $this->isCanceled;
  207.     }
  208.     public function setIsCanceled(?bool $isCanceled): self
  209.     {
  210.         $this->isCanceled $isCanceled;
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection<int, IctusReclamation>
  215.      */
  216.     public function getIctusReclamations(): Collection
  217.     {
  218.         return $this->ictusReclamations;
  219.     }
  220.     public function addIctusReclamation(IctusReclamation $ictusReclamation): self
  221.     {
  222.         if (!$this->ictusReclamations->contains($ictusReclamation)) {
  223.             $this->ictusReclamations[] = $ictusReclamation;
  224.             $ictusReclamation->setFacture($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeIctusReclamation(IctusReclamation $ictusReclamation): self
  229.     {
  230.         if ($this->ictusReclamations->removeElement($ictusReclamation)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($ictusReclamation->getFacture() === $this) {
  233.                 $ictusReclamation->setFacture(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238.     public function getRemise(): ?float
  239.     {
  240.         return $this->remise;
  241.     }
  242.     public function setRemise(?float $remise): self
  243.     {
  244.         $this->remise $remise;
  245.         return $this;
  246.     }
  247.     public function getPrisencharge(): ?PrisEnCharge
  248.     {
  249.         return $this->prisencharge;
  250.     }
  251.     public function setPrisencharge(?PrisEnCharge $prisencharge): self
  252.     {
  253.         $this->prisencharge $prisencharge;
  254.         return $this;
  255.     }
  256. }