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