Files
schedule/src/Entity/Offer.php

215 lines
3.7 KiB
PHP
Raw Normal View History

2020-05-11 15:53:07 +02:00
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Offer
*
* @ORM\Table(name="offer")
* @ORM\Entity(repositoryClass="App\Repository\OfferRepository")
*/
class Offer
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(name="name", type="string")
*
*/
private $name;
/**
* @ORM\Column(name="ref", type="string", nullable=true)
*
*/
private $ref;
/**
* @ORM\Column(name="quantity", type="decimal", scale=2)
*
*/
private $quantity;
/**
* @ORM\Column(name="pu", type="decimal", scale=2)
*
*/
private $pu;
private $total;
/**
* @ORM\Column(name="validate", type="decimal", scale=2, nullable=true)
*
*/
private $validate;
/**
* @ORM\Column(name="cost", type="decimal", scale=2, nullable=true)
*
*/
private $cost;
2020-05-11 15:53:07 +02:00
/**
* @ORM\Column(name="active", type="boolean")
*
*/
private $active;
2020-10-12 14:49:58 +02:00
/**
2024-12-19 11:04:51 +01:00
* @ORM\Column(name="iddolibarr", type="string", nullable=true)
2020-10-12 14:49:58 +02:00
*
*/
private $iddolibarr;
2020-05-11 15:53:07 +02:00
/**
* @ORM\ManyToOne(targetEntity="Project", inversedBy="offers")
*/
private $project;
2024-12-19 11:04:51 +01:00
/**
* @ORM\ManyToOne(targetEntity="Service", inversedBy="offers")
*/
private $service;
2020-05-11 15:53:07 +02:00
public function getTotal()
{
return $this->quantity*$this->pu;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getRef(): ?string
{
return $this->ref;
}
public function setRef(string $ref): self
{
$this->ref = $ref;
return $this;
}
public function getQuantity(): ?string
{
return $this->quantity;
}
public function setQuantity(string $quantity): self
{
$this->quantity = $quantity;
return $this;
}
public function getPu(): ?string
{
return $this->pu;
}
public function setPu(string $pu): self
{
$this->pu = $pu;
return $this;
}
public function getValidate(): ?string
{
return $this->validate;
}
public function setValidate(string $validate): self
{
$this->validate = $validate;
return $this;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
2020-10-13 10:42:48 +02:00
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): self
{
$this->project = $project;
return $this;
}
public function getIddolibarr(): ?string
2020-10-12 14:49:58 +02:00
{
return $this->iddolibarr;
}
2020-10-13 10:42:48 +02:00
public function setIddolibarr(?string $iddolibarr): self
2020-10-12 14:49:58 +02:00
{
$this->iddolibarr = $iddolibarr;
2020-05-11 15:53:07 +02:00
2020-10-12 14:49:58 +02:00
return $this;
}
2020-10-13 10:42:48 +02:00
2024-12-19 11:04:51 +01:00
public function getCost(): ?string
2020-05-11 15:53:07 +02:00
{
2024-12-19 11:04:51 +01:00
return $this->cost;
2020-05-11 15:53:07 +02:00
}
2024-12-19 11:04:51 +01:00
public function setCost(?string $cost): self
2020-05-11 15:53:07 +02:00
{
2024-12-19 11:04:51 +01:00
$this->cost = $cost;
2020-05-11 15:53:07 +02:00
return $this;
}
2024-12-19 11:04:51 +01:00
public function getService(): ?Service
{
2024-12-19 11:04:51 +01:00
return $this->service;
}
2024-12-19 11:04:51 +01:00
public function setService(?Service $service): self
{
2024-12-19 11:04:51 +01:00
$this->service = $service;
return $this;
}
2020-05-11 15:53:07 +02:00
}