<?php
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="ps_stock_available")
*
* @ORM\Entity(repositoryClass="App\Repository\System\StockAvailableRepository")
*/
class StockAvailable
{
public const AVAILABLE_STOCK = 'AVAILABLE';
public const COMING_STOCK = 'FUTURE';
public const JIT_STOCK = 'SUPPLIER';
public const JIT_3_5_STOCK = 'SUP_3_5';
public const DO_NOT_DEPENDS_ON_STOCK = 0;
public const DEPENDS_ON_STOCK = 2;
public const OUT_OF_STOCK = 2;
public const JIT_MIN_DAYS = 1;
public const JIT_MAX_DAYS = 2;
public const JIT_3_5_MIN_DAYS = 3;
public const JIT_3_5_MAX_DAYS = 5;
public const IMMEDIATE_STOCK_MIN_DAYS = 0;
public const IMMEDIATE_STOCK_MAX_DAYS = 0;
/**
* @var int
*
* @ORM\Column(name="id_stock_available", type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var Product
*
* @ORM\ManyToOne(targetEntity="Product", inversedBy="stocks")
*
* @ORM\JoinColumn(name="id_product", referencedColumnName="id_product")
*
* @ORM\OrderBy({"id_product_attribute" = "ASC", "reference" = "DESC"})
*/
private $product;
/**
* @var Warehouse
*
* @ORM\ManyToOne(targetEntity="Warehouse")
*
* @ORM\JoinColumn(name="id_warehouse", referencedColumnName="id")
*/
private $warehouse;
/**
* @var ProductAttribute
*
* @ORM\OneToOne(targetEntity="ProductAttribute", inversedBy="stock")
*
* @ORM\JoinColumn(name="id_product_attribute", referencedColumnName="id_product_attribute")
*/
private $productAttribute;
/**
* @var int
* stock desde el ERP
*
* @ORM\Column(name="quantity", type="integer")
*/
private $quantity;
/**
* @var int|null
* stock que viene de synchros
*
* @ORM\Column(name="quantity_stock_supplier", type="integer", nullable=true)
*/
private $quantityStockSupplier;
/**
* @var int|null
* stock que viene de synchros
*
* @ORM\Column(name="quantity_stock_supplier_3_5", type="integer", nullable=true)
*/
private $quantityStockSupplier3To5;
/**
* @var int|null
*
* @ORM\Column(name="quantity_future_stock", type="integer", nullable=true)
*/
private $quantityFutureStock;
/**
* @var int|null
*
* @ORM\Column(name="stock_extern", type="integer", nullable=true)
*/
private $stockExtern;
/**
* @var int|null
*
* @ORM\Column(name="stock_extern_3_5", type="integer", nullable=true)
*/
private $stockExtern3To5;
/**
* @var int
*
* @ORM\Column(type="integer", columnDefinition="tinyint(1)", options={"unsigned":true, "default":2})
*/
private $dependsOnStock;
/**
* @ORM\Column(type="integer", columnDefinition="tinyint(1)", options={"unsigned":true, "default":2})
*/
private int $outOfStock;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", options={"default" : "CURRENT_TIMESTAMP"})
*/
private $dateUpd;
public function __construct()
{
$this->productAttribute = new ArrayCollection();
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return Product
*/
public function getProduct(): Product
{
return $this->product;
}
/**
* @param Product $product
*
* @return StockAvailable
*/
public function setProduct(Product $product): StockAvailable
{
$this->product = $product;
return $this;
}
/**
* @return ProductAttribute
*/
public function getProductAttribute(): ProductAttribute
{
return $this->productAttribute;
}
/**
* @param ProductAttribute $productAttribute
*
* @return StockAvailable
*/
public function setProductAttribute(ProductAttribute $productAttribute): StockAvailable
{
$this->productAttribute = $productAttribute;
return $this;
}
/**
* @return int
*/
public function getQuantity(): int
{
return $this->quantity;
}
/**
* @param int $quantity
*
* @return StockAvailable
*/
public function setQuantity(int $quantity): StockAvailable
{
$this->quantity = $quantity;
return $this;
}
/**
* @return int|null
*/
public function getQuantityStockSupplier(): ?int
{
return $this->quantityStockSupplier;
}
/**
* @param int|null $quantityStockSupplier
*
* @return StockAvailable
*/
public function setQuantityStockSupplier(?int $quantityStockSupplier): StockAvailable
{
$this->quantityStockSupplier = $quantityStockSupplier;
return $this;
}
/**
* @return int|null
*/
public function getQuantityFutureStock(): ?int
{
return $this->quantityFutureStock;
}
/**
* @param int|null $quantityFutureStock
*
* @return StockAvailable
*/
public function setQuantityFutureStock(?int $quantityFutureStock): StockAvailable
{
$this->quantityFutureStock = $quantityFutureStock;
return $this;
}
/**
* @return int|null
*/
public function getStockExtern(): ?int
{
return $this->stockExtern;
}
/**
* @param int|null $stockExtern
*
* @return StockAvailable
*/
public function setStockExtern(?int $stockExtern): StockAvailable
{
$this->stockExtern = $stockExtern;
return $this;
}
/**
* @return int
*/
public function isDependsOnStock(): int
{
return $this->dependsOnStock;
}
/**
* @param int $dependsOnStock
*
* @return StockAvailable
*/
public function setDependsOnStock(int $dependsOnStock): StockAvailable
{
$this->dependsOnStock = $dependsOnStock;
return $this;
}
public function isOutOfStock(): int
{
return $this->outOfStock;
}
public function setOutOfStock(int $outOfStock): StockAvailable
{
$this->outOfStock = $outOfStock;
return $this;
}
/**
* @return \DateTime
*/
public function getDateUpd(): \DateTime
{
return $this->dateUpd;
}
/**
* @param \DateTime $dateUpd
*
* @return StockAvailable
*/
public function setDateUpd(\DateTime $dateUpd): StockAvailable
{
$this->dateUpd = $dateUpd;
return $this;
}
/**
* @return int|null
*/
public function getQuantityStockSupplier3To5(): ?int
{
return $this->quantityStockSupplier3To5;
}
public function setQuantityStockSupplier3To5(?int $quantityStockSupplier3To5): void
{
$this->quantityStockSupplier3To5 = $quantityStockSupplier3To5;
}
/**
* @return int|null
*/
public function getStockExtern3To5(): ?int
{
return $this->stockExtern3To5;
}
/**
* @param int|null $stockExtern3To5
*/
public function setStockExtern3To5(?int $stockExtern3To5): void
{
$this->stockExtern3To5 = $stockExtern3To5;
}
public function getWarehouse(): Warehouse
{
return $this->warehouse;
}
public function setWarehouse(Warehouse $warehouse): void
{
$this->warehouse = $warehouse;
}
}