<?php
namespace App\Entity;
use App\Repository\DocumentLigneRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DocumentLigneRepository::class)
*/
class DocumentLigne
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Document::class, inversedBy="documentLignes")
* @ORM\JoinColumn(nullable=false)
*/
private $document;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $libelle;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="float")
*/
private $montant_ht;
/**
* @ORM\Column(type="float")
*/
private $taux_tva;
/**
* @ORM\Column(type="float")
*/
private $montant_tva;
/**
* @ORM\Column(type="datetime")
*/
private $date_crea;
/**
* @ORM\Column(type="integer")
*/
private $user_crea;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $date_modif;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $user_modif;
/**
* @ORM\Column(type="float")
*/
private $qte;
/**
* @ORM\Column(type="float")
*/
private $puht;
public function getId(): ?int
{
return $this->id;
}
public function getDocument(): ?Document
{
return $this->document;
}
public function setDocument(?Document $document): self
{
$this->document = $document;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(?string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getMontantHt(): ?float
{
return $this->montant_ht;
}
public function setMontantHt(float $montant_ht): self
{
$this->montant_ht = $montant_ht;
return $this;
}
public function getTauxTva(): ?float
{
return $this->taux_tva;
}
public function setTauxTva(float $taux_tva): self
{
$this->taux_tva = $taux_tva;
return $this;
}
public function getMontantTva(): ?float
{
return $this->montant_tva;
}
public function setMontantTva(float $montant_tva): self
{
$this->montant_tva = $montant_tva;
return $this;
}
public function getDateCrea(): ?\DateTimeInterface
{
return $this->date_crea;
}
public function setDateCrea(\DateTimeInterface $date_crea): self
{
$this->date_crea = $date_crea;
return $this;
}
public function getUserCrea(): ?int
{
return $this->user_crea;
}
public function setUserCrea(int $user_crea): self
{
$this->user_crea = $user_crea;
return $this;
}
public function getDateModif(): ?\DateTimeInterface
{
return $this->date_modif;
}
public function setDateModif(?\DateTimeInterface $date_modif): self
{
$this->date_modif = $date_modif;
return $this;
}
public function getUserModif(): ?int
{
return $this->user_modif;
}
public function setUserModif(?int $user_modif): self
{
$this->user_modif = $user_modif;
return $this;
}
public function getQte(): ?float
{
return $this->qte;
}
public function setQte(float $qte): self
{
$this->qte = $qte;
return $this;
}
public function getPuht(): ?float
{
return $this->puht;
}
public function setPuht(float $puht): self
{
$this->puht = $puht;
return $this;
}
public function performMontant(): self
{
if(null===$this->qte) $this->qte = 0;
if(null===$this->puht) $this->puht = 0;
if(null===$this->taux_tva) $this->taux_tva = 0;
$this->montant_ht = $this->qte * $this->puht;
$this->montant_tva = $this->montant_ht * $this->taux_tva;
return $this;
}
}