src/Entity/Debourse.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * Debourse.php
  4.  * Created by Stéphane Brun
  5.  * Date: 14/08/2018 at 20:08
  6.  */
  7. namespace App\Entity;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use App\Entity\Comptes;
  10. use Doctrine\ORM\Mapping\JoinColumn;
  11. /**
  12.  * @ORM\Entity(repositoryClass="App\Repository\DebourseRepository")
  13.  * @ORM\Table(name="debourse")
  14.  */
  15. class Debourse
  16. {
  17.     /**
  18.      * @ORM\Column(type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     /**
  24.      * @ORM\Column(name="date", type="datetime")
  25.      */
  26.     protected $date;
  27.     /**
  28.      * @ORM\Column(name="montant", type="float")
  29.      */
  30.     protected $montant 0;
  31.     /**
  32.      * @ORM\Column(name="tps", type="float")
  33.      */
  34.     protected $tps 0;
  35.     /**
  36.      * @ORM\Column(name="tvq", type="float")
  37.      */
  38.     protected $tvq 0;
  39.     /**
  40.      * Many Features have One Product.
  41.      * @ORM\ManyToOne(targetEntity="Comptes", inversedBy="debourse")
  42.      * @ORM\JoinColumn(name="compte", referencedColumnName="id")
  43.      */
  44.     protected $compte;
  45.     /**
  46.      * @ORM\Column(name="commentaire", type="string", length=50, nullable=true)
  47.      */
  48.     protected $commentaire;
  49.     /**
  50.      * @ORM\Column(name="comptant", type="float")
  51.      */
  52.     protected $comptant 0;
  53.     /**
  54.      * @ORM\Column(name="interact", type="float")
  55.      */
  56.     protected $interact 0;
  57.     /**
  58.      * @ORM\Column(name="mc", type="float")
  59.      */
  60.     protected $mc 0;
  61.     /**
  62.      * @ORM\Column(name="visa", type="float")
  63.      */
  64.     protected $visa 0;
  65.     /**
  66.      * @ORM\Column(name="certificat", type="float")
  67.      */
  68.     protected $certificat 0;
  69.     /**
  70.      * @ORM\Column(name="caisse", type="string", length=50, nullable=true)
  71.      */
  72.     protected $caisse;
  73.     /**
  74.      * has one SysUser
  75.      *
  76.      * @ORM\ManyToOne(targetEntity="App\Entity\SysUsers")
  77.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  78.      */
  79.     protected $user;
  80.     /**
  81.      * has one Company
  82.      *
  83.      * @ORM\ManyToOne(targetEntity="App\Entity\Company")
  84.      * @ORM\JoinColumn(name="company_id", referencedColumnName="id")
  85.      */
  86.     protected $company;
  87.     /**
  88.      * has one CommandeSpecialeDetail
  89.      *
  90.      * @ORM\ManyToOne(targetEntity="App\Entity\CommandeSpecialeDetail")
  91.      * @ORM\JoinColumn(name="cs_detail_id", referencedColumnName="id")
  92.      */
  93.     protected $recu;
  94.     
  95.     /**
  96.      * has one CommandeSpeciale
  97.      *
  98.      * @ORM\ManyToOne(targetEntity="App\Entity\CommandeSpeciale")
  99.      * @ORM\JoinColumn(name="cs_id", referencedColumnName="id")
  100.      */
  101.     protected $csId;
  102.     protected $total;
  103.     public function __construct()
  104.     {
  105.         $this->date = new \DateTime();
  106.     }
  107.     /**
  108.      * @return mixed
  109.      */
  110.     public function getId()
  111.     {
  112.         return $this->id;
  113.     }
  114.     /**
  115.      * @param mixed $id
  116.      */
  117.     public function setId($id)
  118.     {
  119.         $this->id $id;
  120.     }
  121.     /**
  122.      * @return mixed
  123.      */
  124.     public function getDate()
  125.     {
  126.         return $this->date;
  127.     }
  128.     /**
  129.      * @param mixed $date
  130.      * @return Debourse
  131.      */
  132.     public function setDate($date)
  133.     {
  134.         $this->date $date;
  135.         return $this;
  136.     }
  137.     /**
  138.      * @return mixed
  139.      */
  140.     public function getMontant()
  141.     {
  142.         return $this->montant;
  143.     }
  144.     /**
  145.      * @param mixed $montant
  146.      * @return Debourse
  147.      */
  148.     public function setMontant($montant)
  149.     {
  150.         $this->montant $montant;
  151.         return $this;
  152.     }
  153.     /**
  154.      * @return mixed
  155.      */
  156.     public function getTps()
  157.     {
  158.         return $this->tps;
  159.     }
  160.     /**
  161.      * @param mixed $tps
  162.      * @return Debourse
  163.      */
  164.     public function setTps($tps)
  165.     {
  166.         $this->tps $tps;
  167.         return $this;
  168.     }
  169.     /**
  170.      * @return mixed
  171.      */
  172.     public function getTvq()
  173.     {
  174.         return $this->tvq;
  175.     }
  176.     /**
  177.      * @param mixed $tvq
  178.      * @return Debourse
  179.      */
  180.     public function setTvq($tvq)
  181.     {
  182.         $this->tvq $tvq;
  183.         return $this;
  184.     }
  185.     /**
  186.      * @return mixed
  187.      */
  188.     public function getCompte()
  189.     {
  190.         return $this->compte;
  191.     }
  192.     /**
  193.      * @param mixed $compte
  194.      * @return Debourse
  195.      */
  196.     public function setCompte($compte)
  197.     {
  198.         $this->compte $compte;
  199.         return $this;
  200.     }
  201.     /**
  202.      * @return mixed
  203.      */
  204.     public function getCommentaire()
  205.     {
  206.         return $this->commentaire;
  207.     }
  208.     /**
  209.      * @param mixed $commentaire
  210.      * @return Debourse
  211.      */
  212.     public function setCommentaire($commentaire)
  213.     {
  214.         $this->commentaire $commentaire;
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return mixed
  219.      */
  220.     public function getRecu()
  221.     {
  222.         return $this->recu;
  223.     }
  224.     /**
  225.      * @param mixed $recu
  226.      * @return Debourse
  227.      */
  228.     public function setRecu($recu)
  229.     {
  230.         $this->recu $recu;
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return mixed
  235.      */
  236.     public function getComptant()
  237.     {
  238.         return $this->comptant;
  239.     }
  240.     /**
  241.      * @param mixed $comptant
  242.      * @return Debourse
  243.      */
  244.     public function setComptant($comptant)
  245.     {
  246.         $this->comptant $comptant;
  247.         return $this;
  248.     }
  249.     /**
  250.      * @return mixed
  251.      */
  252.     public function getInteract()
  253.     {
  254.         return $this->interact;
  255.     }
  256.     /**
  257.      * @param mixed $interact
  258.      * @return Debourse
  259.      */
  260.     public function setInteract($interact)
  261.     {
  262.         $this->interact $interact;
  263.         return $this;
  264.     }
  265.     /**
  266.      * @return mixed
  267.      */
  268.     public function getMc()
  269.     {
  270.         return $this->mc;
  271.     }
  272.     /**
  273.      * @param mixed $mc
  274.      * @return Debourse
  275.      */
  276.     public function setMc($mc)
  277.     {
  278.         $this->mc $mc;
  279.         return $this;
  280.     }
  281.     /**
  282.      * @return mixed
  283.      */
  284.     public function getVisa()
  285.     {
  286.         return $this->visa;
  287.     }
  288.     /**
  289.      * @param mixed $visa
  290.      * @return Debourse
  291.      */
  292.     public function setVisa($visa)
  293.     {
  294.         $this->visa $visa;
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return mixed
  299.      */
  300.     public function getCertificat()
  301.     {
  302.         return $this->certificat;
  303.     }
  304.     /**
  305.      * @param mixed $certificat
  306.      * @return Debourse
  307.      */
  308.     public function setCertificat($certificat)
  309.     {
  310.         $this->certificat $certificat;
  311.         return $this;
  312.     }
  313.     /**
  314.      * @return mixed
  315.      */
  316.     public function getCaisse()
  317.     {
  318.         return $this->caisse;
  319.     }
  320.     /**
  321.      * @param mixed $caisse
  322.      * @return Debourse
  323.      */
  324.     public function setCaisse($caisse)
  325.     {
  326.         $this->caisse $caisse;
  327.         return $this;
  328.     }
  329.     /**
  330.      * @return SysUsers
  331.      */
  332.     public function getUser()
  333.     {
  334.         return $this->user;
  335.     }
  336.     /**
  337.      * @param SysUsers $user
  338.      * @return Debourse
  339.      */
  340.     public function setUser(SysUsers $user)
  341.     {
  342.         $this->user $user;
  343.         return $this;
  344.     }
  345.     /**
  346.      * @return Company
  347.      */
  348.     public function getCompany()
  349.     {
  350.         return $this->company;
  351.     }
  352.     /**
  353.      * @param Company $company
  354.      * @return Debourse
  355.      */
  356.     public function setCompany(Company $company)
  357.     {
  358.         $this->company $company;
  359.         return $this;
  360.     }
  361.     
  362.     /**
  363.      * @return mixed
  364.      */
  365.     public function getCsId()
  366.     {
  367.         return $this->csId;
  368.     }
  369.     
  370.     /**
  371.      * @param mixed $csId
  372.      */
  373.     public function setCsId($csId)
  374.     {
  375.         $this->csId $csId;
  376.     }
  377.     /**
  378.      * @return float
  379.      */
  380.     public function getTotal()
  381.     {
  382.         return round($this->getMontant() + $this->getTps() + $this->getTvq(), 2);
  383.     }
  384.     public function __toString() {
  385.         return (string)$this->compte;
  386.     }
  387. }