src/Entity/EntreeStock.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EntreeStockRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassEntreeStockRepository::class)]
  7. class EntreeStock
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\Column]
  14.     private ?int $Quantite null;
  15.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  16.     private ?\DateTimeInterface $dateArrive null;
  17.     #[ORM\ManyToOne(inversedBy'entreeStocks')]
  18.     private ?Produit $produit null;
  19.     #[ORM\ManyToOne(inversedBy'entreeStocks')]
  20.     private ?User $utilisateur null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  22.     private ?\DateTimeInterface $dateEntree null;
  23.     #[ORM\ManyToOne(inversedBy'entreeStocks')]
  24.     private ?Boutique $boutique null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $chauffeur null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $provenance null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $numeroFacture null;
  31.     #[ORM\ManyToOne(inversedBy'entreesStock')]
  32.     private ?Fournisseur $fournisseur null;
  33.     // COMMENTÉ: La table facture_fournisseur n'existe pas, utiliser achatFournisseur à la place
  34.     // #[ORM\ManyToOne(inversedBy: 'entreesStock')]
  35.     // private ?FactureFournisseur $factureFournisseur = null;
  36.     #[ORM\Column(nullabletrue)]
  37.     private ?float $prixAchatUnitaire null;
  38.     #[ORM\Column(nullabletrue)]
  39.     private ?float $montantTotal null;
  40.     #[ORM\Column(length50nullabletrue)]
  41.     private ?string $typeEntree null// ACHAT, TRANSFERT, AJUSTEMENT, RETOUR
  42.     #[ORM\ManyToOne(inversedBy'entreesStock')]
  43.     private ?AchatFournisseur $achatFournisseur null;
  44.     #[ORM\OneToOne(mappedBy'entreeStock')]
  45.     private ?TransfertStock $transfertStock null;
  46.     public function getId(): ?int
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getQuantite(): ?int
  51.     {
  52.         return $this->Quantite;
  53.     }
  54.     public function setQuantite(int $Quantite): static
  55.     {
  56.         $this->Quantite $Quantite;
  57.         return $this;
  58.     }
  59.     public function getDateArrive(): ?\DateTimeInterface
  60.     {
  61.         return $this->dateArrive;
  62.     }
  63.     public function setDateArrive(\DateTimeInterface $dateArrive): static
  64.     {
  65.         $this->dateArrive $dateArrive;
  66.         return $this;
  67.     }
  68.     public function getProduit(): ?Produit
  69.     {
  70.         return $this->produit;
  71.     }
  72.     public function setProduit(?Produit $produit): static
  73.     {
  74.         $this->produit $produit;
  75.         return $this;
  76.     }
  77.     public function getUtilisateur(): ?User
  78.     {
  79.         return $this->utilisateur;
  80.     }
  81.     public function setUtilisateur(?User $utilisateur): static
  82.     {
  83.         $this->utilisateur $utilisateur;
  84.         return $this;
  85.     }
  86.     public function getDateEntree(): ?\DateTimeInterface
  87.     {
  88.         return $this->dateEntree;
  89.     }
  90.     public function setDateEntree(\DateTimeInterface $dateEntree): static
  91.     {
  92.         $this->dateEntree $dateEntree;
  93.         return $this;
  94.     }
  95.     public function getBoutique(): ?Boutique
  96.     {
  97.         return $this->boutique;
  98.     }
  99.     public function setBoutique(?Boutique $boutique): static
  100.     {
  101.         $this->boutique $boutique;
  102.         return $this;
  103.     }
  104.     public function getChauffeur(): ?string
  105.     {
  106.         return $this->chauffeur;
  107.     }
  108.     public function setChauffeur(?string $chauffeur): static
  109.     {
  110.         $this->chauffeur $chauffeur;
  111.         return $this;
  112.     }
  113.     public function getProvenance(): ?string
  114.     {
  115.         return $this->provenance;
  116.     }
  117.     public function setProvenance(?string $provenance): static
  118.     {
  119.         $this->provenance $provenance;
  120.         return $this;
  121.     }
  122.     public function getNumeroFacture(): ?string
  123.     {
  124.         return $this->numeroFacture;
  125.     }
  126.     public function setNumeroFacture(?string $numeroFacture): static
  127.     {
  128.         $this->numeroFacture $numeroFacture;
  129.         return $this;
  130.     }
  131.     public function getFournisseur(): ?Fournisseur
  132.     {
  133.         return $this->fournisseur;
  134.     }
  135.     public function setFournisseur(?Fournisseur $fournisseur): static
  136.     {
  137.         $this->fournisseur $fournisseur;
  138.         return $this;
  139.     }
  140.     // COMMENTÉ: La table facture_fournisseur n'existe pas, utiliser achatFournisseur
  141.     // public function getFactureFournisseur(): ?FactureFournisseur
  142.     // {
  143.     //     return $this->factureFournisseur;
  144.     // }
  145.     // public function setFactureFournisseur(?FactureFournisseur $factureFournisseur): static
  146.     // {
  147.     //     $this->factureFournisseur = $factureFournisseur;
  148.     //     return $this;
  149.     // }
  150.     public function getPrixAchatUnitaire(): ?float
  151.     {
  152.         return $this->prixAchatUnitaire;
  153.     }
  154.     public function setPrixAchatUnitaire(?float $prixAchatUnitaire): static
  155.     {
  156.         $this->prixAchatUnitaire $prixAchatUnitaire;
  157.         return $this;
  158.     }
  159.     public function getMontantTotal(): ?float
  160.     {
  161.         return $this->montantTotal;
  162.     }
  163.     public function setMontantTotal(?float $montantTotal): static
  164.     {
  165.         $this->montantTotal $montantTotal;
  166.         return $this;
  167.     }
  168.     /**
  169.      * Calcule automatiquement le montant total
  170.      */
  171.     public function calculerMontantTotal(): float
  172.     {
  173.         if ($this->prixAchatUnitaire && $this->Quantite) {
  174.             return $this->prixAchatUnitaire $this->Quantite;
  175.         }
  176.         return 0;
  177.     }
  178.     public function getTypeEntree(): ?string
  179.     {
  180.         return $this->typeEntree;
  181.     }
  182.     public function setTypeEntree(?string $typeEntree): static
  183.     {
  184.         $this->typeEntree $typeEntree;
  185.         return $this;
  186.     }
  187.     public function getAchatFournisseur(): ?AchatFournisseur
  188.     {
  189.         return $this->achatFournisseur;
  190.     }
  191.     public function setAchatFournisseur(?AchatFournisseur $achatFournisseur): static
  192.     {
  193.         $this->achatFournisseur $achatFournisseur;
  194.         return $this;
  195.     }
  196.     public function getTransfertStock(): ?TransfertStock
  197.     {
  198.         return $this->transfertStock;
  199.     }
  200.     public function setTransfertStock(?TransfertStock $transfertStock): static
  201.     {
  202.         // set the owning side of the relation if necessary
  203.         if ($transfertStock !== null && $transfertStock->getEntreeStock() !== $this) {
  204.             $transfertStock->setEntreeStock($this);
  205.         }
  206.         $this->transfertStock $transfertStock;
  207.         return $this;
  208.     }
  209. }