<?php
/**
* Debourse.php
* Created by Stéphane Brun
* Date: 14/08/2018 at 20:08
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Comptes;
use Doctrine\ORM\Mapping\JoinColumn;
/**
* @ORM\Entity(repositoryClass="App\Repository\DebourseRepository")
* @ORM\Table(name="debourse")
*/
class Debourse
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="date", type="datetime")
*/
protected $date;
/**
* @ORM\Column(name="montant", type="float")
*/
protected $montant = 0;
/**
* @ORM\Column(name="tps", type="float")
*/
protected $tps = 0;
/**
* @ORM\Column(name="tvq", type="float")
*/
protected $tvq = 0;
/**
* Many Features have One Product.
* @ORM\ManyToOne(targetEntity="Comptes", inversedBy="debourse")
* @ORM\JoinColumn(name="compte", referencedColumnName="id")
*/
protected $compte;
/**
* @ORM\Column(name="commentaire", type="string", length=50, nullable=true)
*/
protected $commentaire;
/**
* @ORM\Column(name="comptant", type="float")
*/
protected $comptant = 0;
/**
* @ORM\Column(name="interact", type="float")
*/
protected $interact = 0;
/**
* @ORM\Column(name="mc", type="float")
*/
protected $mc = 0;
/**
* @ORM\Column(name="visa", type="float")
*/
protected $visa = 0;
/**
* @ORM\Column(name="certificat", type="float")
*/
protected $certificat = 0;
/**
* @ORM\Column(name="caisse", type="string", length=50, nullable=true)
*/
protected $caisse;
/**
* has one SysUser
*
* @ORM\ManyToOne(targetEntity="App\Entity\SysUsers")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
protected $user;
/**
* has one Company
*
* @ORM\ManyToOne(targetEntity="App\Entity\Company")
* @ORM\JoinColumn(name="company_id", referencedColumnName="id")
*/
protected $company;
/**
* has one CommandeSpecialeDetail
*
* @ORM\ManyToOne(targetEntity="App\Entity\CommandeSpecialeDetail")
* @ORM\JoinColumn(name="cs_detail_id", referencedColumnName="id")
*/
protected $recu;
/**
* has one CommandeSpeciale
*
* @ORM\ManyToOne(targetEntity="App\Entity\CommandeSpeciale")
* @ORM\JoinColumn(name="cs_id", referencedColumnName="id")
*/
protected $csId;
protected $total;
public function __construct()
{
$this->date = new \DateTime();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getDate()
{
return $this->date;
}
/**
* @param mixed $date
* @return Debourse
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* @return mixed
*/
public function getMontant()
{
return $this->montant;
}
/**
* @param mixed $montant
* @return Debourse
*/
public function setMontant($montant)
{
$this->montant = $montant;
return $this;
}
/**
* @return mixed
*/
public function getTps()
{
return $this->tps;
}
/**
* @param mixed $tps
* @return Debourse
*/
public function setTps($tps)
{
$this->tps = $tps;
return $this;
}
/**
* @return mixed
*/
public function getTvq()
{
return $this->tvq;
}
/**
* @param mixed $tvq
* @return Debourse
*/
public function setTvq($tvq)
{
$this->tvq = $tvq;
return $this;
}
/**
* @return mixed
*/
public function getCompte()
{
return $this->compte;
}
/**
* @param mixed $compte
* @return Debourse
*/
public function setCompte($compte)
{
$this->compte = $compte;
return $this;
}
/**
* @return mixed
*/
public function getCommentaire()
{
return $this->commentaire;
}
/**
* @param mixed $commentaire
* @return Debourse
*/
public function setCommentaire($commentaire)
{
$this->commentaire = $commentaire;
return $this;
}
/**
* @return mixed
*/
public function getRecu()
{
return $this->recu;
}
/**
* @param mixed $recu
* @return Debourse
*/
public function setRecu($recu)
{
$this->recu = $recu;
return $this;
}
/**
* @return mixed
*/
public function getComptant()
{
return $this->comptant;
}
/**
* @param mixed $comptant
* @return Debourse
*/
public function setComptant($comptant)
{
$this->comptant = $comptant;
return $this;
}
/**
* @return mixed
*/
public function getInteract()
{
return $this->interact;
}
/**
* @param mixed $interact
* @return Debourse
*/
public function setInteract($interact)
{
$this->interact = $interact;
return $this;
}
/**
* @return mixed
*/
public function getMc()
{
return $this->mc;
}
/**
* @param mixed $mc
* @return Debourse
*/
public function setMc($mc)
{
$this->mc = $mc;
return $this;
}
/**
* @return mixed
*/
public function getVisa()
{
return $this->visa;
}
/**
* @param mixed $visa
* @return Debourse
*/
public function setVisa($visa)
{
$this->visa = $visa;
return $this;
}
/**
* @return mixed
*/
public function getCertificat()
{
return $this->certificat;
}
/**
* @param mixed $certificat
* @return Debourse
*/
public function setCertificat($certificat)
{
$this->certificat = $certificat;
return $this;
}
/**
* @return mixed
*/
public function getCaisse()
{
return $this->caisse;
}
/**
* @param mixed $caisse
* @return Debourse
*/
public function setCaisse($caisse)
{
$this->caisse = $caisse;
return $this;
}
/**
* @return SysUsers
*/
public function getUser()
{
return $this->user;
}
/**
* @param SysUsers $user
* @return Debourse
*/
public function setUser(SysUsers $user)
{
$this->user = $user;
return $this;
}
/**
* @return Company
*/
public function getCompany()
{
return $this->company;
}
/**
* @param Company $company
* @return Debourse
*/
public function setCompany(Company $company)
{
$this->company = $company;
return $this;
}
/**
* @return mixed
*/
public function getCsId()
{
return $this->csId;
}
/**
* @param mixed $csId
*/
public function setCsId($csId)
{
$this->csId = $csId;
}
/**
* @return float
*/
public function getTotal()
{
return round($this->getMontant() + $this->getTps() + $this->getTvq(), 2);
}
public function __toString() {
return (string)$this->compte;
}
}