src/Entity/DocumentDeclinationProduit.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DocumentDeclinationProduitRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=DocumentDeclinationProduitRepository::class)
  7.  */
  8. class DocumentDeclinationProduit
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=255, nullable=true)
  18.      */
  19.     private $reference;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, nullable=true)
  22.      */
  23.     private $name;
  24.     /**
  25.      * @ORM\Column(type="text", nullable=true)
  26.      */
  27.     private $description;
  28.     /**
  29.      * @ORM\Column(type="float", nullable=true)
  30.      */
  31.     private $priceHt;
  32.     /**
  33.      * @ORM\Column(type="float", nullable=true)
  34.      */
  35.     private $priceTtc;
  36.     /**
  37.      * @ORM\Column(type="string", length=255)
  38.      */
  39.     private $type;
  40.     /**
  41.      * @ORM\Column(type="float", nullable=true)
  42.      */
  43.     private $discount;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $discountType;
  48.     /**
  49.      * @ORM\Column(type="integer", nullable=true)
  50.      */
  51.     private $quantity;
  52.     /**
  53.      * @ORM\Column(type="integer", options={"default": 0})
  54.      */
  55.     private int $returnedQuantity 0;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $unite;
  60.     /**
  61.      * @ORM\Column(type="datetime")
  62.      */
  63.     private $createdAt;
  64.     /**
  65.      * @ORM\Column(type="text", nullable=true)
  66.      */
  67.     private $comment;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=Tva::class)
  70.      */
  71.     private $tva;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=ProduitDeclinationValue::class, inversedBy="documentDeclinationProduits")
  74.      */
  75.     private $produitDeclinationValue;
  76.     /**
  77.      * @ORM\ManyToOne(targetEntity=Document::class, inversedBy="documentDeclinationProduits")
  78.      */
  79.     private $document;
  80.     /**
  81.      * @ORM\ManyToOne(targetEntity=Pack::class)
  82.      */
  83.     private $pack;
  84.     /**
  85.      * @ORM\Column(type="string", length=120, nullable=true)
  86.      */
  87.     private $packGroup;
  88.     /**
  89.      * @ORM\Column(type="integer", nullable=true)
  90.      */
  91.     private $packQty;
  92.     /**
  93.     * @ORM\Column(type="float", options={"default":0,"comment": "Total HT brut (avant remise article)"})
  94.     */
  95.     private $totalAmountHt;
  96.     /**
  97.     * @ORM\Column(type="float", options={"default":0, "comment":"Total TTC net (après remise article)"})
  98.     */
  99.     private $totalAmountTtc;
  100.     /**
  101.      * @ORM\Column(type="float", nullable=true, options={"comment":"Prix revendeur TTC memorise au moment de l ajout"})
  102.      */
  103.     private ?float $resellerPurchasePriceTtc null;
  104.     public function getId(): ?int
  105.     {
  106.         return $this->id;
  107.     }
  108.     public function getReference(): ?string
  109.     {
  110.         return $this->reference;
  111.     }
  112.     public function setReference(?string $reference): self
  113.     {
  114.         $this->reference $reference;
  115.         return $this;
  116.     }
  117.     public function getName(): ?string
  118.     {
  119.         return $this->name;
  120.     }
  121.     public function setName(?string $name): self
  122.     {
  123.         $this->name $name;
  124.         return $this;
  125.     }
  126.     public function getDescription(): ?string
  127.     {
  128.         return $this->description;
  129.     }
  130.     public function setDescription(?string $description): self
  131.     {
  132.         $this->description $description;
  133.         return $this;
  134.     }
  135.     public function getPriceHt(): ?float
  136.     {
  137.         return $this->priceHt;
  138.     }
  139.     public function setPriceHt(?float $priceHt): self
  140.     {
  141.         $this->priceHt $priceHt;
  142.         return $this;
  143.     }
  144.     public function getPriceTtc(): ?float
  145.     {
  146.         return $this->priceTtc;
  147.     }
  148.     public function setPriceTtc(?float $priceTtc): self
  149.     {
  150.         $this->priceTtc $priceTtc;
  151.         return $this;
  152.     }
  153.     public function getType(): ?string
  154.     {
  155.         return $this->type;
  156.     }
  157.     public function setType(string $type): self
  158.     {
  159.         $this->type $type;
  160.         return $this;
  161.     }
  162.     public function getDiscount(): ?float
  163.     {
  164.         return $this->discount;
  165.     }
  166.     public function setDiscount(?float $discount): self
  167.     {
  168.         $this->discount $discount;
  169.         return $this;
  170.     }
  171.     public function getDiscountType(): ?string
  172.     {
  173.         return $this->discountType;
  174.     }
  175.     public function setDiscountType(?string $discountType): self
  176.     {
  177.         $this->discountType $discountType;
  178.         return $this;
  179.     }
  180.     public function getQuantity(): ?int
  181.     {
  182.         return $this->quantity;
  183.     }
  184.     public function setQuantity(?int $quantity): self
  185.     {
  186.         $this->quantity $quantity;
  187.         return $this;
  188.     }
  189.     public function getReturnedQuantity(): int
  190.     {
  191.         return (int) $this->returnedQuantity;
  192.     }
  193.     public function setReturnedQuantity(?int $returnedQuantity): self
  194.     {
  195.         $max = (int) ($this->quantity ?? 0);
  196.         $value max(0, (int) ($returnedQuantity ?? 0));
  197.         $this->returnedQuantity $max min($max$value) : $value;
  198.         return $this;
  199.     }
  200.     public function getRemainingQuantity(): int
  201.     {
  202.         return max(0, (int) ($this->quantity ?? 0) - (int) $this->returnedQuantity);
  203.     }
  204.     public function getUnite(): ?string
  205.     {
  206.         return $this->unite;
  207.     }
  208.     public function setUnite(?string $unite): self
  209.     {
  210.         $this->unite $unite;
  211.         return $this;
  212.     }
  213.     public function getCreatedAt(): ?\DateTimeInterface
  214.     {
  215.         return $this->createdAt;
  216.     }
  217.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  218.     {
  219.         $this->createdAt $createdAt;
  220.         return $this;
  221.     }
  222.     public function getComment(): ?string
  223.     {
  224.         return $this->comment;
  225.     }
  226.     public function setComment(?string $comment): self
  227.     {
  228.         $this->comment $comment;
  229.         return $this;
  230.     }
  231.     public function getTva(): ?Tva
  232.     {
  233.         return $this->tva;
  234.     }
  235.     public function setTva(?Tva $tva): self
  236.     {
  237.         $this->tva $tva;
  238.         return $this;
  239.     }
  240.     public function getProduitDeclinationValue(): ?ProduitDeclinationValue
  241.     {
  242.         return $this->produitDeclinationValue;
  243.     }
  244.     public function setProduitDeclinationValue(?ProduitDeclinationValue $produitDeclinationValue): self
  245.     {
  246.         $this->produitDeclinationValue $produitDeclinationValue;
  247.         return $this;
  248.     }
  249.     public function getDocument(): ?Document
  250.     {
  251.         return $this->document;
  252.     }
  253.     public function setDocument(?Document $document): self
  254.     {
  255.         $this->document $document;
  256.         return $this;
  257.     }
  258.     public function getPack(): ?Pack
  259.     {
  260.         return $this->pack;
  261.     }
  262.     public function setPack(?Pack $pack): self
  263.     {
  264.         $this->pack $pack;
  265.         return $this;
  266.     }
  267.     public function getPackGroup(): ?string
  268.     {
  269.         return $this->packGroup;
  270.     }
  271.     public function setPackGroup(?string $packGroup): self
  272.     {
  273.         $this->packGroup $packGroup;
  274.         return $this;
  275.     }
  276.     public function getPackQty(): ?int
  277.     {
  278.         return $this->packQty;
  279.     }
  280.     public function setPackQty(?int $packQty): self
  281.     {
  282.         $this->packQty $packQty;
  283.         return $this;
  284.     }
  285.      public function getTotalAmountHt(): ?float
  286.     {
  287.         return $this->totalAmountHt;
  288.     }
  289.     public function setTotalAmountHt(float $totalAmountHt): self
  290.     {
  291.         $this->totalAmountHt $totalAmountHt;
  292.         return $this;
  293.     }
  294.     public function getTotalAmountTtc(): ?float
  295.     {
  296.         return $this->totalAmountTtc;
  297.     }
  298.     public function setTotalAmountTtc(float $totalAmountTtc): self
  299.     {
  300.         $this->totalAmountTtc $totalAmountTtc;
  301.         return $this;
  302.     }
  303.     public function getResellerPurchasePriceTtc(): ?float
  304.     {
  305.         return $this->resellerPurchasePriceTtc;
  306.     }
  307.     public function setResellerPurchasePriceTtc(?float $resellerPurchasePriceTtc): self
  308.     {
  309.         $this->resellerPurchasePriceTtc $resellerPurchasePriceTtc;
  310.         return $this;
  311.     }
  312. }