src/Entity/SaleItems.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SaleItemsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=SaleItemsRepository::class)
  7.  */
  8. class SaleItems
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=Sales::class, inversedBy="saleItems")
  18.      * @ORM\JoinColumn(nullable=false)
  19.      */
  20.     private $sale;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="saleItems")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $product;
  26.     /**
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $count;
  30.     /**
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private $amount;
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      */
  37.     private $unitAmount;
  38.     /**
  39.      * @ORM\Column(type="integer")
  40.      */
  41.     private $promotionRate;
  42.     /**
  43.      * @ORM\Column(type="float", nullable=true)
  44.      */
  45.     private $pmp;
  46.     /**
  47.      * @ORM\Column(type="integer", nullable=true)
  48.      */
  49.     private $costs;
  50.     /**
  51.      * @ORM\Column(type="integer", nullable=true)
  52.      */
  53.     private $benef;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=true)
  56.      */
  57.     private $package;
  58.     /**
  59.      * @ORM\Column(type="integer", nullable=true)
  60.      */
  61.     private $packageCount;
  62.     /**
  63.      * @ORM\Column(type="integer", nullable=true)
  64.      */
  65.     private $packagePrice;
  66.     /**
  67.      * @ORM\Column(type="string", length=100, nullable=true)
  68.      */
  69.     private $packageBarcode;
  70.     /**
  71.      * @ORM\Column(type="string", length=100, nullable=true)
  72.      */
  73.     private $packageName;
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getSale(): ?Sales
  79.     {
  80.         return $this->sale;
  81.     }
  82.     public function setSale(?Sales $sale): self
  83.     {
  84.         $this->sale $sale;
  85.         return $this;
  86.     }
  87.     public function getProduct(): ?Product
  88.     {
  89.         return $this->product;
  90.     }
  91.     public function setProduct(?Product $product): self
  92.     {
  93.         $this->product $product;
  94.         return $this;
  95.     }
  96.     public function getCount(): ?int
  97.     {
  98.         return $this->count;
  99.     }
  100.     public function setCount(int $count): self
  101.     {
  102.         $this->count $count;
  103.         return $this;
  104.     }
  105.     public function getAmount(): ?int
  106.     {
  107.         return $this->amount;
  108.     }
  109.     public function setAmount(int $amount): self
  110.     {
  111.         $this->amount $amount;
  112.         return $this;
  113.     }
  114.     /**
  115.      * @return mixed
  116.      */
  117.     public function getUnitAmount()
  118.     {
  119.         return $this->unitAmount;
  120.     }
  121.     /**
  122.      * @param mixed $unitAmount
  123.      */
  124.     public function setUnitAmount($unitAmount): void
  125.     {
  126.         $this->unitAmount $unitAmount;
  127.     }
  128.     /**
  129.      * @return mixed
  130.      */
  131.     public function getPromotionRate()
  132.     {
  133.         return $this->promotionRate;
  134.     }
  135.     /**
  136.      * @param mixed $promotionRate
  137.      */
  138.     public function setPromotionRate($promotionRate): void
  139.     {
  140.         $this->promotionRate $promotionRate;
  141.     }
  142.     public function getPmp(): ?float
  143.     {
  144.         return $this->pmp;
  145.     }
  146.     public function setPmp(?float $pmp): self
  147.     {
  148.         $this->pmp $pmp;
  149.         return $this;
  150.     }
  151.     public function getCosts(): ?int
  152.     {
  153.         return $this->costs;
  154.     }
  155.     public function setCosts(Product $product$pmp,  $count): self
  156.     {
  157.         if($product->getUnit() == 'WEIGHT'){
  158.             $count $count/1000;
  159.         }
  160.         $this->costs round($pmp $count);
  161.         return $this;
  162.     }
  163.     public function getBenef(): ?int
  164.     {
  165.         return $this->benef;
  166.     }
  167.     public function setBenef(?int $benef): self
  168.     {
  169.         $this->benef $benef;
  170.         return $this;
  171.     }
  172.     public function isPackage(): ?bool
  173.     {
  174.         return $this->package;
  175.     }
  176.     public function setPackage(?bool $package): self
  177.     {
  178.         $this->package $package;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return mixed
  183.      */
  184.     public function getPackageCount()
  185.     {
  186.         return $this->packageCount;
  187.     }
  188.     /**
  189.      * @param mixed $packageCount
  190.      */
  191.     public function setPackageCount($packageCount): void
  192.     {
  193.         $this->packageCount $packageCount;
  194.     }
  195.     /**
  196.      * @return mixed
  197.      */
  198.     public function getPackagePrice()
  199.     {
  200.         return $this->packagePrice;
  201.     }
  202.     /**
  203.      * @param mixed $packagePrice
  204.      */
  205.     public function setPackagePrice($packagePrice): void
  206.     {
  207.         $this->packagePrice $packagePrice;
  208.     }
  209.     /**
  210.      * @return mixed
  211.      */
  212.     public function getPackageBarcode()
  213.     {
  214.         return $this->packageBarcode;
  215.     }
  216.     /**
  217.      * @param mixed $packageBarcode
  218.      */
  219.     public function setPackageBarcode($packageBarcode): void
  220.     {
  221.         $this->packageBarcode $packageBarcode;
  222.     }
  223.     /**
  224.      * @return mixed
  225.      */
  226.     public function getPackageName()
  227.     {
  228.         return $this->packageName;
  229.     }
  230.     /**
  231.      * @param mixed $packageName
  232.      */
  233.     public function setPackageName($packageName): void
  234.     {
  235.         $this->packageName $packageName;
  236.     }
  237. }