src/Entity/StockMovement.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockMovementRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Historique des mouvements de stock.
  7.  *
  8.  * @ORM\Entity(repositoryClass=StockMovementRepository::class)
  9.  * @ORM\Table(name="stock_movement")
  10.  */
  11. class StockMovement
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private int $id;
  19.     /**
  20.      * @ORM\Column(type="integer", nullable=true)
  21.      */
  22.     private ?int $produit_id null;
  23.     /**
  24.      * @ORM\Column(type="integer", nullable=true)
  25.      */
  26.     private ?int $declination_produit_id null;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Warehouse::class, inversedBy="stockMovements")
  29.      * @ORM\JoinColumn(name="warehouse_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  30.      */
  31.     private ?Warehouse $warehouse null;
  32.     /**
  33.      * @ORM\Column(type="datetime")
  34.      */
  35.     private \DateTimeInterface $created_at;
  36.     /**
  37.      * @ORM\Column(type="string", length=50, nullable=true)
  38.      */
  39.     private ?string $source_type null;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=true)
  42.      */
  43.     private ?int $source_id null;
  44.     /**
  45.      * @ORM\Column(type="decimal", precision=18, scale=3)
  46.      */
  47.     private string $delta_available;
  48.     /**
  49.      * @ORM\Column(type="decimal", precision=18, scale=3, options={"default":"0.000"})
  50.      */
  51.     private string $delta_reserved '0.000';
  52.     /**
  53.      * @ORM\Column(type="decimal", precision=18, scale=3)
  54.      */
  55.     private string $qty_before_available;
  56.     /**
  57.      * @ORM\Column(type="decimal", precision=18, scale=3)
  58.      */
  59.     private string $qty_after_available;
  60.     /**
  61.      * @ORM\Column(type="decimal", precision=18, scale=3)
  62.      */
  63.     private string $qty_before_reserved;
  64.     /**
  65.      * @ORM\Column(type="decimal", precision=18, scale=3)
  66.      */
  67.     private string $qty_after_reserved;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      */
  71.     private ?string $reason null;
  72.     /**
  73.      * @ORM\Column(type="integer", nullable=true)
  74.      */
  75.     private ?int $actor_id null;
  76.     /**
  77.      * @ORM\Column(type="text", nullable=true)
  78.      */
  79.     private ?string $note null;
  80.     /**
  81.      * @ORM\Column(name="unit_cost_ttc", type="decimal", precision=12, scale=3, nullable=true)
  82.      */
  83.     private ?string $unit_cost_ttc null;
  84.     public function getId(): ?int
  85.     {
  86.         return $this->id;
  87.     }
  88.     public function getProduitId(): ?int
  89.     {
  90.         return $this->produit_id;
  91.     }
  92.     public function setProduitId(?int $produit_id): self
  93.     {
  94.         $this->produit_id $produit_id;
  95.         return $this;
  96.     }
  97.     public function getDeclinationProduitId(): ?int
  98.     {
  99.         return $this->declination_produit_id;
  100.     }
  101.     public function setDeclinationProduitId(?int $declination_produit_id): self
  102.     {
  103.         $this->declination_produit_id $declination_produit_id;
  104.         return $this;
  105.     }
  106.     public function getWarehouse(): ?Warehouse
  107.     {
  108.         return $this->warehouse;
  109.     }
  110.     public function setWarehouse(?Warehouse $warehouse): self
  111.     {
  112.         $this->warehouse $warehouse;
  113.         return $this;
  114.     }
  115.     public function getResolvedStorehouseName(): ?string
  116.     {
  117.         return $this->warehouse?->getName();
  118.     }
  119.     public function getCreatedAt(): \DateTimeInterface
  120.     {
  121.         return $this->created_at;
  122.     }
  123.     public function setCreatedAt(\DateTimeInterface $created_at): self
  124.     {
  125.         $this->created_at $created_at;
  126.         return $this;
  127.     }
  128.     public function getSourceType(): ?string
  129.     {
  130.         return $this->source_type;
  131.     }
  132.     public function setSourceType(?string $source_type): self
  133.     {
  134.         $this->source_type $source_type;
  135.         return $this;
  136.     }
  137.     public function getSourceId(): ?int
  138.     {
  139.         return $this->source_id;
  140.     }
  141.     public function setSourceId(?int $source_id): self
  142.     {
  143.         $this->source_id $source_id;
  144.         return $this;
  145.     }
  146.     public function getDeltaAvailable(): string
  147.     {
  148.         return $this->delta_available;
  149.     }
  150.     public function setDeltaAvailable(string $delta_available): self
  151.     {
  152.         $this->delta_available $delta_available;
  153.         return $this;
  154.     }
  155.     public function getDeltaReserved(): string
  156.     {
  157.         return $this->delta_reserved;
  158.     }
  159.     public function setDeltaReserved(string $delta_reserved): self
  160.     {
  161.         $this->delta_reserved $delta_reserved;
  162.         return $this;
  163.     }
  164.     public function getQtyBeforeAvailable(): string
  165.     {
  166.         return $this->qty_before_available;
  167.     }
  168.     public function setQtyBeforeAvailable(string $qty_before_available): self
  169.     {
  170.         $this->qty_before_available $qty_before_available;
  171.         return $this;
  172.     }
  173.     public function getQtyAfterAvailable(): string
  174.     {
  175.         return $this->qty_after_available;
  176.     }
  177.     public function setQtyAfterAvailable(string $qty_after_available): self
  178.     {
  179.         $this->qty_after_available $qty_after_available;
  180.         return $this;
  181.     }
  182.     public function getQtyBeforeReserved(): string
  183.     {
  184.         return $this->qty_before_reserved;
  185.     }
  186.     public function setQtyBeforeReserved(string $qty_before_reserved): self
  187.     {
  188.         $this->qty_before_reserved $qty_before_reserved;
  189.         return $this;
  190.     }
  191.     public function getQtyAfterReserved(): string
  192.     {
  193.         return $this->qty_after_reserved;
  194.     }
  195.     public function setQtyAfterReserved(string $qty_after_reserved): self
  196.     {
  197.         $this->qty_after_reserved $qty_after_reserved;
  198.         return $this;
  199.     }
  200.     public function getReason(): ?string
  201.     {
  202.         return $this->reason;
  203.     }
  204.     public function setReason(?string $reason): self
  205.     {
  206.         $this->reason $reason;
  207.         return $this;
  208.     }
  209.     public function getActorId(): ?int
  210.     {
  211.         return $this->actor_id;
  212.     }
  213.     public function setActorId(?int $actor_id): self
  214.     {
  215.         $this->actor_id $actor_id;
  216.         return $this;
  217.     }
  218.     public function getNote(): ?string
  219.     {
  220.         return $this->note;
  221.     }
  222.     public function setNote(?string $note): self
  223.     {
  224.         $this->note $note;
  225.         return $this;
  226.     }
  227.     public function getUnitCostTtc(): ?float
  228.     {
  229.         return $this->unit_cost_ttc !== null ? (float) $this->unit_cost_ttc null;
  230.     }
  231.     public function setUnitCostTtc(?float $unitCostTtc): self
  232.     {
  233.         $this->unit_cost_ttc $unitCostTtc !== null
  234.             number_format((float) $unitCostTtc3'.''')
  235.             : null;
  236.         return $this;
  237.     }
  238. }