src/Entity/StockTransfer.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\StockTransferRepository;
  4. use App\Utils\CurrencyHelper;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassStockTransferRepository::class)]
  9. class StockTransfer extends BaseEntity
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column(type'integer')]
  14.     private $id;
  15.     #[ORM\ManyToOne(targetEntityWarehouse::class, inversedBy'outgoingTransfers')]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private $outWarehouse;
  18.     #[ORM\ManyToOne(targetEntityWarehouse::class, inversedBy'incomingTransfers')]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private $arrivalWarehouse;
  21.     #[ORM\Column(type'text'nullabletrue)]
  22.     private $description;
  23.     #[ORM\Column(name'out_date'type'date_immutable'nullabletrue)]
  24.     private $warehouseOutDate;
  25.     #[ORM\Column(name'warehouse_arrival_date'type'date_immutable'nullabletrue)]
  26.     private $warehouseArrivalDate;
  27.     #[ORM\Column(name'total_amount'type'decimal'precision19scale4nullabletrue)]
  28.     private $totalAmount;
  29.     #[ORM\Column(name'invoice_number'type'string'nullabletrue)]
  30.     private $invoiceNumber;
  31.     #[ORM\Column(name'container_number'type'string'nullabletrue)]
  32.     private $containerNumber;
  33.     #[ORM\Column(name'konsimento'type'string'nullabletrue)]
  34.     private $konsimento;
  35.     #[ORM\ManyToOne(targetEntityStockTransaction::class, inversedBy'stockTransfers')]
  36.     #[ORM\JoinColumn(nullabletrue)]
  37.     private $transaction;
  38.     #[ORM\OneToMany(mappedBy'stockTransfer'targetEntityStock::class)]
  39.     private $stock;
  40.     #[ORM\OneToMany(mappedBy'stockTransfer'targetEntityStockTransferProducts::class)]
  41.     private $products;
  42.     #[ORM\OneToMany(mappedBy'stockTransfer'targetEntityStockTransferContainer::class)]
  43.     private $stockTransferContainers;
  44.     #[ORM\Column(name'transferCost'type'decimal'precision19scale4nullabletrue)]
  45.     private $transferCosts;
  46.     #[ORM\Column(name'transferType'type'string'nullabletrue)]
  47.     private $transferType;
  48.     private $quantity;
  49.     private $priceFob;
  50.     private $priceNavlun;
  51.     private $totalUnitPrice;
  52.     private $purchaseTotalAmount;
  53.     private $buyingCompany;
  54.     private $buyingDate;
  55.     public function __construct()
  56.     {
  57.         $this->stock = new ArrayCollection();
  58.         $this->products = new ArrayCollection();
  59.         $this->stockTransferContainers = new ArrayCollection();
  60.     }
  61.     public function __toString(): string
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getId(): ?int
  66.     {
  67.         return $this->id;
  68.     }
  69.     public function getOutWarehouse(): ?Warehouse
  70.     {
  71.         return $this->outWarehouse;
  72.     }
  73.     public function setOutWarehouse(?Warehouse $outWarehouse): self
  74.     {
  75.         $this->outWarehouse $outWarehouse;
  76.         return $this;
  77.     }
  78.     public function getArrivalWarehouse(): ?Warehouse
  79.     {
  80.         return $this->arrivalWarehouse;
  81.     }
  82.     public function setArrivalWarehouse(?Warehouse $arrivalWarehouse): self
  83.     {
  84.         $this->arrivalWarehouse $arrivalWarehouse;
  85.         return $this;
  86.     }
  87.     public function getQuantity()
  88.     {
  89.         return $this->quantity;
  90.     }
  91.     public function setQuantity($quantity): self
  92.     {
  93.         $this->quantity $quantity;
  94.         return $this;
  95.     }
  96.     public function getDescription()
  97.     {
  98.         return $this->description;
  99.     }
  100.     public function setDescription($description): self
  101.     {
  102.         $this->description $description;
  103.         return $this;
  104.     }
  105.     public function getTransaction(): ?StockTransaction
  106.     {
  107.         return $this->transaction;
  108.     }
  109.     public function setTransaction(?StockTransaction $transaction): self
  110.     {
  111.         $this->transaction $transaction;
  112.         return $this;
  113.     }
  114.     public function getInvoiceNumber(): ?string
  115.     {
  116.         return $this->invoiceNumber;
  117.     }
  118.     public function setInvoiceNumber(?string $invoiceNumber): self
  119.     {
  120.         $this->invoiceNumber $invoiceNumber;
  121.         return $this;
  122.     }
  123.     public function getContainerNumber(): ?string
  124.     {
  125.         return $this->containerNumber;
  126.     }
  127.     public function setContainerNumber(?string $containerNumber): self
  128.     {
  129.         $this->containerNumber $containerNumber;
  130.         return $this;
  131.     }
  132.     public function getKonsimento(): ?string
  133.     {
  134.         return $this->konsimento;
  135.     }
  136.     public function setKonsimento(?string $konsimento): self
  137.     {
  138.         $this->konsimento $konsimento;
  139.         return $this;
  140.     }
  141.     public function getPriceFob()
  142.     {
  143.         return $this->priceFob;
  144.     }
  145.     public function setPriceFob($priceFob): self
  146.     {
  147.         $this->priceFob $priceFob;
  148.         return $this;
  149.     }
  150.     public function getPriceNavlun()
  151.     {
  152.         return $this->priceNavlun;
  153.     }
  154.     public function setPriceNavlun($priceNavlun): self
  155.     {
  156.         $this->priceNavlun $priceNavlun;
  157.         return $this;
  158.     }
  159.     public function getTotalUnitPrice()
  160.     {
  161.         return $this->totalUnitPrice;
  162.     }
  163.     public function setTotalUnitPrice($totalUnitPrice): self
  164.     {
  165.         $this->totalUnitPrice $totalUnitPrice;
  166.         return $this;
  167.     }
  168.     public function getPurchaseTotalAmount()
  169.     {
  170.         return $this->purchaseTotalAmount;
  171.     }
  172.     public function setPurchaseTotalAmount($purchaseTotalAmount): self
  173.     {
  174.         $this->purchaseTotalAmount $purchaseTotalAmount;
  175.         return $this;
  176.     }
  177.     public function getBuyingCompany(): ?string
  178.     {
  179.         return $this->buyingCompany;
  180.     }
  181.     public function setBuyingCompany(string $buyingCompany): self
  182.     {
  183.         $this->buyingCompany $buyingCompany;
  184.         return $this;
  185.     }
  186.     public function getBuyingDate(): ?\DateTimeImmutable
  187.     {
  188.         return $this->buyingDate;
  189.     }
  190.     public function setBuyingDate(\DateTimeImmutable $buyingDate): self
  191.     {
  192.         $this->buyingDate $buyingDate;
  193.         return $this;
  194.     }
  195.     public function getWarehouseArrivalDate(): ?\DateTimeImmutable
  196.     {
  197.         return $this->warehouseArrivalDate;
  198.     }
  199.     public function setWarehouseArrivalDate(?\DateTimeImmutable $warehouseArrivalDate): self
  200.     {
  201.         $this->warehouseArrivalDate $warehouseArrivalDate;
  202.         return $this;
  203.     }
  204.     public function getStock()
  205.     {
  206.         return $this->stock;
  207.     }
  208.     public function addStock(Stock $stock): self
  209.     {
  210.         $this->stock[] = $stock;
  211.         $stock->setStockTransfer($this);
  212.         return $this;
  213.     }
  214.     public function removeStock(Stock $stock): self
  215.     {
  216.         if ($this->stock->removeElement($stock)) {
  217.             // set the owning side to null (unless already changed)
  218.             if ($stock->getStockTransfer() === $this) {
  219.                 $stock->setStockTransfer(null);
  220.             }
  221.         }
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection<int, StockTransferProducts>
  226.      */
  227.     public function getProducts(): Collection
  228.     {
  229.         return $this->products;
  230.     }
  231.     public function addProduct(StockTransferProducts $product): self
  232.     {
  233.         if (!$this->products->contains($product)) {
  234.             $this->products[] = $product;
  235.             $product->setStockTransfer($this);
  236.         }
  237.         return $this;
  238.     }
  239.     public function removeProduct(StockTransferProducts $product): self
  240.     {
  241.         if ($this->products->removeElement($product)) {
  242.             // set the owning side to null (unless already changed)
  243.             if ($product->getStockTransfer() === $this) {
  244.                 $product->setStockTransfer(null);
  245.             }
  246.         }
  247.         return $this;
  248.     }
  249.     public function getWarehouseOutDate(): ?\DateTimeImmutable
  250.     {
  251.         return $this->warehouseOutDate;
  252.     }
  253.     public function setWarehouseOutDate(\DateTimeImmutable $warehouseOutDate): self
  254.     {
  255.         $this->warehouseOutDate $warehouseOutDate;
  256.         return $this;
  257.     }
  258.     public function getTotalAmount()
  259.     {
  260.         return $this->totalAmount;
  261.     }
  262.     public function setTotalAmount($totalAmount): self
  263.     {
  264.         $this->totalAmount CurrencyHelper::convertToFloat($totalAmount);
  265.         return $this;
  266.     }
  267.     public function setStock(Collection $stock): self
  268.     {
  269.         $this->stock $stock;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return Collection<int, StockTransferContainer>
  274.      */
  275.     public function getStockTransferContainers(): Collection
  276.     {
  277.         return $this->stockTransferContainers;
  278.     }
  279.     public function addStockTransferContainer(StockTransferContainer $stockTransferContainer): self
  280.     {
  281.         if (!$this->stockTransferContainers->contains($stockTransferContainer)) {
  282.             $this->stockTransferContainers[] = $stockTransferContainer;
  283.             $stockTransferContainer->setStockTransfer($this);
  284.         }
  285.         return $this;
  286.     }
  287.     public function removeStockTransferContainer(StockTransferContainer $stockTransferContainer): self
  288.     {
  289.         if ($this->stockTransferContainers->removeElement($stockTransferContainer)) {
  290.             // set the owning side to null (unless already changed)
  291.             if ($stockTransferContainer->getStockTransfer() === $this) {
  292.                 $stockTransferContainer->setStockTransfer(null);
  293.             }
  294.         }
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return mixed
  299.      */
  300.     public function getTransferCosts()
  301.     {
  302.         return $this->transferCosts;
  303.     }
  304.     /**
  305.      * @param mixed $transferCosts
  306.      */
  307.     public function setTransferCosts($transferCosts): void
  308.     {
  309.         $this->transferCosts $transferCosts;
  310.     }
  311.     /**
  312.      * @return mixed
  313.      */
  314.     public function getTransferType()
  315.     {
  316.         return $this->transferType;
  317.     }
  318.     /**
  319.      * @param mixed $transferType
  320.      */
  321.     public function setTransferType($transferType): void
  322.     {
  323.         $this->transferType $transferType;
  324.     }
  325. }