src/Entity/System/StockAvailable.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="ps_stock_available")
  7.  *
  8.  * @ORM\Entity(repositoryClass="App\Repository\System\StockAvailableRepository")
  9.  */
  10. class StockAvailable
  11. {
  12.     public const AVAILABLE_STOCK 'AVAILABLE';
  13.     public const COMING_STOCK 'FUTURE';
  14.     public const JIT_STOCK 'SUPPLIER';
  15.     public const JIT_3_5_STOCK 'SUP_3_5';
  16.     public const DO_NOT_DEPENDS_ON_STOCK 0;
  17.     public const DEPENDS_ON_STOCK 2;
  18.     public const OUT_OF_STOCK 2;
  19.     public const JIT_MIN_DAYS 1;
  20.     public const JIT_MAX_DAYS 2;
  21.     public const JIT_3_5_MIN_DAYS 3;
  22.     public const JIT_3_5_MAX_DAYS 5;
  23.     public const IMMEDIATE_STOCK_MIN_DAYS 0;
  24.     public const IMMEDIATE_STOCK_MAX_DAYS 0;
  25.     /**
  26.      * @var int
  27.      *
  28.      * @ORM\Column(name="id_stock_available", type="integer")
  29.      *
  30.      * @ORM\Id
  31.      *
  32.      * @ORM\GeneratedValue(strategy="AUTO")
  33.      */
  34.     private $id;
  35.     /**
  36.      * @var Product
  37.      *
  38.      * @ORM\ManyToOne(targetEntity="Product", inversedBy="stocks")
  39.      *
  40.      * @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
  41.      *
  42.      * @ORM\OrderBy({"id_product_attribute" = "ASC", "reference" = "DESC"})
  43.      */
  44.     private $product;
  45.     /**
  46.      * @var Warehouse
  47.      *
  48.      * @ORM\ManyToOne(targetEntity="Warehouse")
  49.      *
  50.      * @ORM\JoinColumn(name="id_warehouse", referencedColumnName="id")
  51.      */
  52.     private $warehouse;
  53.     /**
  54.      * @var ProductAttribute
  55.      *
  56.      * @ORM\OneToOne(targetEntity="ProductAttribute", inversedBy="stock")
  57.      *
  58.      * @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
  59.      */
  60.     private $productAttribute;
  61.     /**
  62.      * @var int
  63.      *          stock desde el ERP
  64.      *
  65.      * @ORM\Column(name="quantity", type="integer")
  66.      */
  67.     private $quantity;
  68.     /**
  69.      * @var int|null
  70.      *               stock que viene de synchros
  71.      *
  72.      * @ORM\Column(name="quantity_stock_supplier", type="integer", nullable=true)
  73.      */
  74.     private $quantityStockSupplier;
  75.     /**
  76.      * @var int|null
  77.      *               stock que viene de synchros
  78.      *
  79.      * @ORM\Column(name="quantity_stock_supplier_3_5", type="integer", nullable=true)
  80.      */
  81.     private $quantityStockSupplier3To5;
  82.     /**
  83.      * @var int|null
  84.      *
  85.      * @ORM\Column(name="quantity_future_stock", type="integer", nullable=true)
  86.      */
  87.     private $quantityFutureStock;
  88.     /**
  89.      * @var int|null
  90.      *
  91.      * @ORM\Column(name="stock_extern", type="integer", nullable=true)
  92.      */
  93.     private $stockExtern;
  94.     /**
  95.      * @var int|null
  96.      *
  97.      * @ORM\Column(name="stock_extern_3_5", type="integer", nullable=true)
  98.      */
  99.     private $stockExtern3To5;
  100.     /**
  101.      * @var int
  102.      *
  103.      * @ORM\Column(type="integer", columnDefinition="tinyint(1)", options={"unsigned":true, "default":2})
  104.      */
  105.     private $dependsOnStock;
  106.     /**
  107.      * @ORM\Column(type="integer", columnDefinition="tinyint(1)", options={"unsigned":true, "default":2})
  108.      */
  109.     private int $outOfStock;
  110.     /**
  111.      * @var \DateTime
  112.      *
  113.      * @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
  114.      */
  115.     private $dateUpd;
  116.     public function __construct()
  117.     {
  118.         $this->productAttribute = new ArrayCollection();
  119.     }
  120.     /**
  121.      * @return int
  122.      */
  123.     public function getId(): int
  124.     {
  125.         return $this->id;
  126.     }
  127.     /**
  128.      * @return Product
  129.      */
  130.     public function getProduct(): Product
  131.     {
  132.         return $this->product;
  133.     }
  134.     /**
  135.      * @param Product $product
  136.      *
  137.      * @return StockAvailable
  138.      */
  139.     public function setProduct(Product $product): StockAvailable
  140.     {
  141.         $this->product $product;
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return ProductAttribute
  146.      */
  147.     public function getProductAttribute(): ProductAttribute
  148.     {
  149.         return $this->productAttribute;
  150.     }
  151.     /**
  152.      * @param ProductAttribute $productAttribute
  153.      *
  154.      * @return StockAvailable
  155.      */
  156.     public function setProductAttribute(ProductAttribute $productAttribute): StockAvailable
  157.     {
  158.         $this->productAttribute $productAttribute;
  159.         return $this;
  160.     }
  161.     /**
  162.      * @return int
  163.      */
  164.     public function getQuantity(): int
  165.     {
  166.         return $this->quantity;
  167.     }
  168.     /**
  169.      * @param int $quantity
  170.      *
  171.      * @return StockAvailable
  172.      */
  173.     public function setQuantity(int $quantity): StockAvailable
  174.     {
  175.         $this->quantity $quantity;
  176.         return $this;
  177.     }
  178.     /**
  179.      * @return int|null
  180.      */
  181.     public function getQuantityStockSupplier(): ?int
  182.     {
  183.         return $this->quantityStockSupplier;
  184.     }
  185.     /**
  186.      * @param int|null $quantityStockSupplier
  187.      *
  188.      * @return StockAvailable
  189.      */
  190.     public function setQuantityStockSupplier(?int $quantityStockSupplier): StockAvailable
  191.     {
  192.         $this->quantityStockSupplier $quantityStockSupplier;
  193.         return $this;
  194.     }
  195.     /**
  196.      * @return int|null
  197.      */
  198.     public function getQuantityFutureStock(): ?int
  199.     {
  200.         return $this->quantityFutureStock;
  201.     }
  202.     /**
  203.      * @param int|null $quantityFutureStock
  204.      *
  205.      * @return StockAvailable
  206.      */
  207.     public function setQuantityFutureStock(?int $quantityFutureStock): StockAvailable
  208.     {
  209.         $this->quantityFutureStock $quantityFutureStock;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return int|null
  214.      */
  215.     public function getStockExtern(): ?int
  216.     {
  217.         return $this->stockExtern;
  218.     }
  219.     /**
  220.      * @param int|null $stockExtern
  221.      *
  222.      * @return StockAvailable
  223.      */
  224.     public function setStockExtern(?int $stockExtern): StockAvailable
  225.     {
  226.         $this->stockExtern $stockExtern;
  227.         return $this;
  228.     }
  229.     /**
  230.      * @return int
  231.      */
  232.     public function isDependsOnStock(): int
  233.     {
  234.         return $this->dependsOnStock;
  235.     }
  236.     /**
  237.      * @param int $dependsOnStock
  238.      *
  239.      * @return StockAvailable
  240.      */
  241.     public function setDependsOnStock(int $dependsOnStock): StockAvailable
  242.     {
  243.         $this->dependsOnStock $dependsOnStock;
  244.         return $this;
  245.     }
  246.     public function isOutOfStock(): int
  247.     {
  248.         return $this->outOfStock;
  249.     }
  250.     public function setOutOfStock(int $outOfStock): StockAvailable
  251.     {
  252.         $this->outOfStock $outOfStock;
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return \DateTime
  257.      */
  258.     public function getDateUpd(): \DateTime
  259.     {
  260.         return $this->dateUpd;
  261.     }
  262.     /**
  263.      * @param \DateTime $dateUpd
  264.      *
  265.      * @return StockAvailable
  266.      */
  267.     public function setDateUpd(\DateTime $dateUpd): StockAvailable
  268.     {
  269.         $this->dateUpd $dateUpd;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return int|null
  274.      */
  275.     public function getQuantityStockSupplier3To5(): ?int
  276.     {
  277.         return $this->quantityStockSupplier3To5;
  278.     }
  279.     public function setQuantityStockSupplier3To5(?int $quantityStockSupplier3To5): void
  280.     {
  281.         $this->quantityStockSupplier3To5 $quantityStockSupplier3To5;
  282.     }
  283.     /**
  284.      * @return int|null
  285.      */
  286.     public function getStockExtern3To5(): ?int
  287.     {
  288.         return $this->stockExtern3To5;
  289.     }
  290.     /**
  291.      * @param int|null $stockExtern3To5
  292.      */
  293.     public function setStockExtern3To5(?int $stockExtern3To5): void
  294.     {
  295.         $this->stockExtern3To5 $stockExtern3To5;
  296.     }
  297.     public function getWarehouse(): Warehouse
  298.     {
  299.         return $this->warehouse;
  300.     }
  301.     public function setWarehouse(Warehouse $warehouse): void
  302.     {
  303.         $this->warehouse $warehouse;
  304.     }
  305. }