src/Entity/System/StockAvailable.php line 20

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