<?php
namespace App\Entity;
use App\Repository\SortieStockRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SortieStockRepository::class)]
class SortieStock
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?int $quantite = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $dateSortie = null;
#[ORM\ManyToOne(inversedBy: 'sortieStocks')]
private ?Produit $produit = null;
#[ORM\ManyToOne(inversedBy: 'sortieStocks')]
private ?User $utilisateur = null;
#[ORM\Column(nullable: true)]
private ?float $prixVente = null;
#[ORM\ManyToOne(inversedBy: 'sortieStocks')]
private ?Boutique $boutique = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $numeroFacture = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $motif = null;
#[ORM\Column(length: 50, nullable: true)]
private ?string $typeSortie = null; // VENTE, CASSE, PERTE, DON, ECHANTILLON, RETOUR_FOURNISSEUR, CONSOMMATION_INTERNE, AUTRE
#[ORM\OneToOne(mappedBy: 'sortieStock')]
private ?TransfertStock $transfertStock = null;
public function getId(): ?int
{
return $this->id;
}
public function getQuantite(): ?int
{
return $this->quantite;
}
public function setQuantite(int $quantite): static
{
$this->quantite = $quantite;
return $this;
}
public function getDateSortie(): ?\DateTimeInterface
{
return $this->dateSortie;
}
public function setDateSortie(\DateTimeInterface $dateSortie): static
{
$this->dateSortie = $dateSortie;
return $this;
}
public function getProduit(): ?Produit
{
return $this->produit;
}
public function setProduit(?Produit $produit): static
{
$this->produit = $produit;
return $this;
}
public function getUtilisateur(): ?User
{
return $this->utilisateur;
}
public function setUtilisateur(?User $utilisateur): static
{
$this->utilisateur = $utilisateur;
return $this;
}
public function getPrixVente(): ?float
{
return $this->prixVente;
}
public function setPrixVente(?float $prixVente): static
{
$this->prixVente = $prixVente;
return $this;
}
public function getBoutique(): ?Boutique
{
return $this->boutique;
}
public function setBoutique(?Boutique $boutique): static
{
$this->boutique = $boutique;
return $this;
}
public function getNumeroFacture(): ?string
{
return $this->numeroFacture;
}
public function setNumeroFacture(?string $numeroFacture): static
{
$this->numeroFacture = $numeroFacture;
return $this;
}
public function getMotif(): ?string
{
return $this->motif;
}
public function setMotif(?string $motif): static
{
$this->motif = $motif;
return $this;
}
public function getTypeSortie(): ?string
{
return $this->typeSortie;
}
public function setTypeSortie(?string $typeSortie): static
{
$this->typeSortie = $typeSortie;
return $this;
}
public function getTransfertStock(): ?TransfertStock
{
return $this->transfertStock;
}
public function setTransfertStock(?TransfertStock $transfertStock): static
{
// set the owning side of the relation if necessary
if ($transfertStock !== null && $transfertStock->getSortieStock() !== $this) {
$transfertStock->setSortieStock($this);
}
$this->transfertStock = $transfertStock;
return $this;
}
}