<?php
namespace App\Entity;
use App\Repository\FournisseurRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use App\Annotation\CustomAnnotation;
/**
* @ORM\Entity(repositoryClass=FournisseurRepository::class)
*/
class Fournisseur
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $siren;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $siret;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $adresse;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $city;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $codePostal;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $country;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $countryCode;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tel;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isEnabled;
/**
* @ORM\OneToMany(targetEntity="Rib",mappedBy="fournisseur", cascade={"persist"})
*/
private $rib;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $note;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isArchived;
/**
* @ORM\OneToMany(targetEntity="User", cascade={"persist"},mappedBy="fournisseur",)
*/
private $user;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isErpAccee;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $codeFournisseur;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tel2;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $telecopie;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $typeTiers;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $rcsRm;
/**
* @ORM\Column(type="text", nullable=true)
* @CustomAnnotation("Code blocage")
*/
private $codeBlocage;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tvaIntracommunautaire;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $complementSiret;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $codeNaf;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $complementIdenetification;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $formuleJuridique;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $rueVoie;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $complementAdresse;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $boitePostaleCommune;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $devise;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isFlux;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $codeModeReglt;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $reverseFactoring;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $tvaDebit;
/**
* @ORM\OneToMany(targetEntity="App\Entity\FournisseurProject",mappedBy="fournisseur", cascade={"persist"})
*/
private $fournisseurProject;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isNotaire;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $nameComplementaire;
public function __construct()
{
$this->rib = new ArrayCollection();
$this->fournisseurProject = new ArrayCollection();
$this->user = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getSiren(): ?string
{
return $this->siren;
}
public function setSiren(?string $siren): self
{
$this->siren = $siren;
return $this;
}
public function getSiret(): ?string
{
return $this->siret;
}
public function setSiret(?string $siret): self
{
$this->siret = $siret;
return $this;
}
public function getAdresse(): ?string
{
return $this->adresse;
}
public function setAdresse(?string $adresse): self
{
$this->adresse = $adresse;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(?string $email): self
{
$this->email = $email;
return $this;
}
public function getTel(): ?string
{
return $this->tel;
}
public function setTel(?string $tel): self
{
$this->tel = $tel;
return $this;
}
public function getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(?bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
public function getNote(): ?string
{
return $this->note;
}
public function setNote(?string $note): self
{
$this->note = $note;
return $this;
}
/**
* @return Collection|Rib[]
*/
public function getRib(): Collection
{
return $this->rib;
}
public function addRib(Rib $rib): self
{
if (!$this->rib->contains($rib)) {
$this->rib[] = $rib;
$rib->setFournisseur($this);
}
return $this;
}
public function removeRib(Rib $rib): self
{
if ($this->rib->removeElement($rib)) {
// set the owning side to null (unless already changed)
if ($rib->getFournisseur() === $this) {
$rib->setFournisseur(null);
}
}
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): self
{
$this->city = $city;
return $this;
}
public function getCodePostal(): ?string
{
return $this->codePostal;
}
public function setCodePostal(?string $codePostal): self
{
$this->codePostal = $codePostal;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getCountryCode(): ?string
{
return $this->countryCode;
}
public function setCountryCode(?string $countryCode): self
{
$this->countryCode = $countryCode;
return $this;
}
public function getIsArchived(): ?bool
{
return $this->isArchived;
}
public function setIsArchived(?bool $isArchived): self
{
$this->isArchived = $isArchived;
return $this;
}
public function getIsErpAccee(): ?bool
{
return $this->isErpAccee;
}
public function setIsErpAccee(?bool $isErpAccee): self
{
$this->isErpAccee = $isErpAccee;
return $this;
}
public function getCodeFournisseur(): ?string
{
return $this->codeFournisseur;
}
public function setCodeFournisseur(?string $codeFournisseur): self
{
$this->codeFournisseur = $codeFournisseur;
return $this;
}
public function getTel2(): ?string
{
return $this->tel2;
}
public function setTel2(?string $tel2): self
{
$this->tel2 = $tel2;
return $this;
}
public function getTelecopie(): ?string
{
return $this->telecopie;
}
public function setTelecopie(?string $telecopie): self
{
$this->telecopie = $telecopie;
return $this;
}
public function getTypeTiers(): ?string
{
return $this->typeTiers;
}
public function setTypeTiers(?string $typeTiers): self
{
$this->typeTiers = $typeTiers;
return $this;
}
public function getRcsRm(): ?string
{
return $this->rcsRm;
}
public function setRcsRm(?string $rcsRm): self
{
$this->rcsRm = $rcsRm;
return $this;
}
public function getCodeBlocage(): ?string
{
return $this->codeBlocage;
}
public function getCodeBlocageStr()
{
if($this->codeBlocage == 'N' ){
return 'Non';
}else{
return 'Oui';
}
}
public function setCodeBlocage(?string $codeBlocage): self
{
$this->codeBlocage = $codeBlocage;
return $this;
}
public function getTvaIntracommunautaire(): ?string
{
return $this->tvaIntracommunautaire;
}
public function setTvaIntracommunautaire(?string $tvaIntracommunautaire): self
{
$this->tvaIntracommunautaire = $tvaIntracommunautaire;
return $this;
}
public function getComplementSiret(): ?string
{
return $this->complementSiret;
}
public function setComplementSiret(?string $complementSiret): self
{
$this->complementSiret = $complementSiret;
return $this;
}
public function getCodeNaf(): ?string
{
return $this->codeNaf;
}
public function setCodeNaf(?string $codeNaf): self
{
$this->codeNaf = $codeNaf;
return $this;
}
public function getComplementIdenetification(): ?string
{
return $this->complementIdenetification;
}
public function setComplementIdenetification(?string $complementIdenetification): self
{
$this->complementIdenetification = $complementIdenetification;
return $this;
}
public function getFormuleJuridique(): ?string
{
return $this->formuleJuridique;
}
public function setFormuleJuridique(?string $formuleJuridique): self
{
$this->formuleJuridique = $formuleJuridique;
return $this;
}
public function getRueVoie(): ?string
{
return $this->rueVoie;
}
public function setRueVoie(?string $rueVoie): self
{
$this->rueVoie = $rueVoie;
return $this;
}
public function getComplementAdresse(): ?string
{
return $this->complementAdresse;
}
public function setComplementAdresse(?string $complementAdresse): self
{
$this->complementAdresse = $complementAdresse;
return $this;
}
public function getBoitePostaleCommune(): ?string
{
return $this->boitePostaleCommune;
}
public function setBoitePostaleCommune(?string $boitePostaleCommune): self
{
$this->boitePostaleCommune = $boitePostaleCommune;
return $this;
}
public function getDevise(): ?string
{
return $this->devise;
}
public function setDevise(?string $devise): self
{
$this->devise = $devise;
return $this;
}
public function getIsFlux(): ?bool
{
return $this->isFlux;
}
public function setIsFlux(?bool $isFlux): self
{
$this->isFlux = $isFlux;
return $this;
}
/**
* @return Collection|FournisseurProject[]
*/
public function getFournisseurProject(): Collection
{
return $this->fournisseurProject;
}
public function addFournisseurProject(FournisseurProject $fournisseurProject): self
{
if (!$this->fournisseurProject->contains($fournisseurProject)) {
$this->fournisseurProject[] = $fournisseurProject;
$fournisseurProject->setFournisseur($this);
}
return $this;
}
public function getCodeModeReglt(): ?string
{
return $this->codeModeReglt;
}
public function setCodeModeReglt(?string $codeModeReglt): self
{
$this->codeModeReglt = $codeModeReglt;
return $this;
}
public function getReverseFactoring(): ?string
{
return $this->reverseFactoring;
}
public function setReverseFactoring(?string $reverseFactoring): self
{
$this->reverseFactoring = $reverseFactoring;
return $this;
}
public function getTvaDebit(): ?string
{
return $this->tvaDebit;
}
public function setTvaDebit(?string $tvaDebit): self
{
$this->tvaDebit = $tvaDebit;
return $this;
}
public function removeFournisseurProject(FournisseurProject $fournisseurProject): self
{
if ($this->fournisseurProject->removeElement($fournisseurProject)) {
// set the owning side to null (unless already changed)
if ($fournisseurProject->getFournisseur() === $this) {
$fournisseurProject->setFournisseur(null);
}
}
return $this;
}
public function getIsNotaire(): ?bool
{
return $this->isNotaire;
}
public function setIsNotaire(?bool $isNotaire): self
{
$this->isNotaire = $isNotaire;
return $this;
}
public function getNameComplementaire(): ?string
{
return $this->nameComplementaire;
}
public function setNameComplementaire(?string $nameComplementaire): self
{
$this->nameComplementaire = $nameComplementaire;
return $this;
}
public function __toString()
{
return $this->name;
}
public function addUser(User $user): self
{
if (!$this->user->contains($user)) {
$this->user[] = $user;
$user->setFournisseur($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->user->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getFournisseur() === $this) {
$user->setFournisseur(null);
}
}
return $this;
}
/**
* @return Collection|User[]
*/
public function getUser(): Collection
{
return $this->user;
}
}