<?php
namespace App\Entity;
use App\Repository\DevisRepository;
use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DevisRepository::class)]
class Devis
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $vendeur = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresse = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telphvendeur1 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telphvendeur2 = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $rc = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mf = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $nomclient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adresseclient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telphclient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $faxclient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $mfclient = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $num = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?DateTimeInterface $date = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $reference = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $code = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $base = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $taux = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $montant = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $total = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $totalht = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $qttotal = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $totalttc = null;
#[ORM\Column(type: Types::DECIMAL, precision: 15, scale: 3, nullable: true)]
private ?string $montantNet = null;
#[ORM\OneToMany(mappedBy: 'devis', targetEntity: Produit::class, cascade: ["remove", "persist"])]
private Collection $produit;
#[ORM\Column(length: 255, nullable: true)]
private ?string $statut = null;
#[ORM\ManyToOne(inversedBy: 'devis')]
private ?Vendeur $vendeurs = null;
#[ORM\ManyToOne(inversedBy: 'devis')]
private ?Client $client = null;
#[ORM\OneToMany(mappedBy: 'devis', targetEntity: Paymentdevi::class, cascade: ["remove", "persist"])]
private Collection $paymentdevis;
#[ORM\Column(length: 255, nullable: true)]
private ?string $timbre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $idfacture = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $oldtype = null;
#[ORM\Column(type: Types::ARRAY, nullable: true)]
private ?array $retour = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $frtour = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $fav = null;
#[ORM\OneToMany(mappedBy: 'devis', targetEntity: Intervention::class, cascade: ['persist'])]
private Collection $intervention;
#[ORM\ManyToOne(inversedBy: 'devis')]
private ?User $user = null;
#[ORM\Column(nullable: true)]
private ?bool $lu = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?DateTimeInterface $datecreation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $demandedevisold = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $iddevisold = null;
#[ORM\OneToMany(mappedBy: 'devis', targetEntity: Historiqueintervention::class, cascade: ["remove", "persist"])]
private Collection $historiqueinterventions;
#[ORM\Column(length: 255, nullable: true)]
private ?string $iduerold = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $idintervold = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $username = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $adressp = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $telpp = null;
#[ORM\ManyToOne(inversedBy: 'devis')]
private ?Fournisseur $fournisseur = null;
#[ORM\OneToMany(mappedBy: 'fichevente', targetEntity: Archivearticle::class)]
private Collection $archivearticles;
#[ORM\Column(length: 255, nullable: true)]
private ?string $idsfacts = null;
public function __toString()
{
// Retourne l'ID du Devis comme chaîne de caractères
// Vous pouvez remplacer cela par n'importe quel autre champ significatif
return strval($this->id);
}
public function __construct()
{
$this->produit = new ArrayCollection();
$this->paymentdevis = new ArrayCollection();
$this->intervention = new ArrayCollection();
$this->historiqueinterventions = new ArrayCollection();
$this->archivearticles = new ArrayCollection();
}
/**
* @return string|null
*/
public function getIdfacture(): ?string
{
return $this->idfacture;
}
/**
* @param string|null $idfacture
*/
public function setIdfacture(?string $idfacture): void
{
$this->idfacture = $idfacture;
}
public function getId(): ?int
{
return $this->id;
}
public function getVendeur(): ?string
{
return $this->vendeur;
}
public function setVendeur(?string $vendeur): self
{
$this->vendeur = $vendeur;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getTelphvendeur1(): ?string
{
return $this->telphvendeur1;
}
public function setTelphvendeur1(?string $telphvendeur1): self
{
$this->telphvendeur1 = $telphvendeur1;
return $this;
}
public function getTelphvendeur2(): ?string
{
return $this->telphvendeur2;
}
public function setTelphvendeur2(?string $telphvendeur2): self
{
$this->telphvendeur2 = $telphvendeur2;
return $this;
}
public function getRc(): ?string
{
return $this->rc;
}
public function setRc(?string $rc): self
{
$this->rc = $rc;
return $this;
}
public function getMf(): ?string
{
return $this->mf;
}
public function setMf(?string $mf): self
{
$this->mf = $mf;
return $this;
}
public function getNomclient(): ?string
{
return $this->nomclient;
}
public function setNomclient(?string $nomclient): self
{
$this->nomclient = $nomclient;
return $this;
}
public function getAdresseclient(): ?string
{
return $this->adresseclient;
}
public function setAdresseclient(?string $adresseclient): self
{
$this->adresseclient = $adresseclient;
return $this;
}
public function getTelphclient(): ?string
{
return $this->telphclient;
}
public function setTelphclient(?string $telphclient): self
{
$this->telphclient = $telphclient;
return $this;
}
public function getFaxclient(): ?string
{
return $this->faxclient;
}
public function setFaxclient(?string $faxclient): self
{
$this->faxclient = $faxclient;
return $this;
}
public function getMfclient(): ?string
{
return $this->mfclient;
}
public function setMfclient(?string $mfclient): self
{
$this->mfclient = $mfclient;
return $this;
}
public function getNum(): ?string
{
return $this->num;
}
public function setNum(?string $num): self
{
$this->num = $num;
return $this;
}
public function getDate(): ?DateTimeInterface
{
return $this->date;
}
public function setDate(?DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(?string $code): self
{
$this->code = $code;
return $this;
}
public function getBase(): ?string
{
return $this->base;
}
public function setBase(?string $base): self
{
$this->base = $base;
return $this;
}
public function getTaux(): ?string
{
return $this->taux;
}
public function setTaux(?string $taux): self
{
$this->taux = $taux;
return $this;
}
public function getMontant(): ?string
{
return $this->montant;
}
public function setMontant(?string $montant): self
{
$this->montant = $montant;
return $this;
}
public function getTotal(): ?string
{
return $this->total;
}
public function setTotal(?string $total): self
{
$this->total = $total;
return $this;
}
public function getTotalht(): ?string
{
return $this->totalht;
}
public function setTotalht(?string $totalht): self
{
$this->totalht = $totalht;
return $this;
}
public function getQttotal(): ?string
{
return $this->qttotal;
}
public function setQttotal(?string $qttotal): self
{
$this->qttotal = $qttotal;
return $this;
}
public function getTotalttc(): ?string
{
return $this->totalttc;
}
public function setTotalttc(?string $totalttc): self
{
$this->totalttc = $totalttc;
return $this;
}
public function getMontantNet(): ?string
{
return $this->montantNet;
}
public function setMontantNet(?string $montantNet): self
{
$this->montantNet = $montantNet;
return $this;
}
/**
* @return Collection<int, Produit>
*/
public function getProduit(): Collection
{
return $this->produit;
}
public function addProduit(Produit $produit): self
{
if (!$this->produit->contains($produit)) {
$this->produit->add($produit);
$produit->setDevis($this);
}
return $this;
}
public function removeProduit(Produit $produit): self
{
if ($this->produit->removeElement($produit)) {
// set the owning side to null (unless already changed)
if ($produit->getDevis() === $this) {
$produit->setDevis(null);
}
}
return $this;
}
public function getStatut(): ?string
{
return $this->statut;
}
public function setStatut(?string $statut): self
{
$this->statut = $statut;
return $this;
}
public function getVendeurs(): ?Vendeur
{
return $this->vendeurs;
}
public function setVendeurs(?Vendeur $vendeurs): self
{
$this->vendeurs = $vendeurs;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): self
{
$this->client = $client;
return $this;
}
/**
* @return Collection<int, Paymentdevi>
*/
public function getPaymentdevis(): Collection
{
return $this->paymentdevis;
}
public function addPaymentdevi(Paymentdevi $paymentdevi): static
{
if (!$this->paymentdevis->contains($paymentdevi)) {
$this->paymentdevis->add($paymentdevi);
$paymentdevi->setDevis($this);
}
return $this;
}
public function removePaymentdevi(Paymentdevi $paymentdevi): static
{
if ($this->paymentdevis->removeElement($paymentdevi)) {
// set the owning side to null (unless already changed)
if ($paymentdevi->getDevis() === $this) {
$paymentdevi->setDevis(null);
}
}
return $this;
}
public function getTimbre(): ?string
{
return $this->timbre;
}
public function setTimbre(?string $timbre): static
{
$this->timbre = $timbre;
return $this;
}
public function getOldtype(): ?string
{
return $this->oldtype;
}
public function setOldtype(?string $oldtype): static
{
$this->oldtype = $oldtype;
return $this;
}
public function getRetour(): ?array
{
return $this->retour;
}
public function setRetour(?array $retour): static
{
$this->retour = $retour;
return $this;
}
public function getFrtour(): ?string
{
return $this->frtour;
}
public function setFrtour(?string $frtour): static
{
$this->frtour = $frtour;
return $this;
}
public function getFav(): ?string
{
return $this->fav;
}
public function setFav(?string $fav): static
{
$this->fav = $fav;
return $this;
}
/**
* @return Collection<int, Intervention>
*/
public function getIntervention(): Collection
{
return $this->intervention;
}
public function addIntervention(Intervention $intervention): static
{
if (!$this->intervention->contains($intervention)) {
$this->intervention->add($intervention);
$intervention->setDevis($this);
}
return $this;
}
public function removeIntervention(Intervention $intervention): static
{
if ($this->intervention->removeElement($intervention)) {
// set the owning side to null (unless already changed)
if ($intervention->getDevis() === $this) {
$intervention->setDevis(null);
}
}
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): static
{
$this->user = $user;
return $this;
}
public function isLu(): ?bool
{
return $this->lu;
}
public function setLu(?bool $lu): static
{
$this->lu = $lu;
return $this;
}
public function getDatecreation(): ?DateTimeInterface
{
return $this->datecreation;
}
public function setDatecreation(?DateTimeInterface $datecreation): static
{
$this->datecreation = $datecreation;
return $this;
}
public function getDemandedevisold(): ?string
{
return $this->demandedevisold;
}
public function setDemandedevisold(?string $demandedevisold): static
{
$this->demandedevisold = $demandedevisold;
return $this;
}
public function getIddevisold(): ?string
{
return $this->iddevisold;
}
public function setIddevisold(?string $iddevisold): static
{
$this->iddevisold = $iddevisold;
return $this;
}
/**
* @return Collection<int, Historiqueintervention>
*/
public function getHistoriqueinterventions(): Collection
{
return $this->historiqueinterventions;
}
public function addHistoriqueintervention(Historiqueintervention $historiqueintervention): static
{
if (!$this->historiqueinterventions->contains($historiqueintervention)) {
$this->historiqueinterventions->add($historiqueintervention);
$historiqueintervention->setDevis($this);
}
return $this;
}
public function removeHistoriqueintervention(Historiqueintervention $historiqueintervention): static
{
if ($this->historiqueinterventions->removeElement($historiqueintervention)) {
// set the owning side to null (unless already changed)
if ($historiqueintervention->getDevis() === $this) {
$historiqueintervention->setDevis(null);
}
}
return $this;
}
public function getIduerold(): ?string
{
return $this->iduerold;
}
public function setIduerold(?string $iduerold): static
{
$this->iduerold = $iduerold;
return $this;
}
public function getIdintervold(): ?string
{
return $this->idintervold;
}
public function setIdintervold(?string $idintervold): static
{
$this->idintervold = $idintervold;
return $this;
}
public function getUsername(): ?string
{
return $this->username;
}
public function setUsername(?string $username): static
{
$this->username = $username;
return $this;
}
public function getAdressp(): ?string
{
return $this->adressp;
}
public function setAdressp(?string $adressp): static
{
$this->adressp = $adressp;
return $this;
}
public function getTelpp(): ?string
{
return $this->telpp;
}
public function setTelpp(?string $telpp): static
{
$this->telpp = $telpp;
return $this;
}
public function getFournisseur(): ?Fournisseur
{
return $this->fournisseur;
}
public function setFournisseur(?Fournisseur $fournisseur): static
{
$this->fournisseur = $fournisseur;
return $this;
}
/**
* @return Collection<int, Archivearticle>
*/
public function getArchivearticles(): Collection
{
return $this->archivearticles;
}
public function addArchivearticle(Archivearticle $archivearticle): self
{
if (!$this->archivearticles->contains($archivearticle)) {
$this->archivearticles->add($archivearticle);
$archivearticle->setFichevente($this);
}
return $this;
}
public function removeArchivearticle(Archivearticle $archivearticle): self
{
if ($this->archivearticles->removeElement($archivearticle)) {
// set the owning side to null (unless already changed)
if ($archivearticle->getFichevente() === $this) {
$archivearticle->setFichevente(null);
}
}
return $this;
}
public function getIdsfacts(): ?string
{
return $this->idsfacts;
}
public function setIdsfacts(?string $idsfacts): self
{
$this->idsfacts = $idsfacts;
return $this;
}
}