<?php
namespace App\Entity;
use App\Repository\ComptaRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ComptaRepository::class)
*/
class Compta
{
const STATUT_OPEN = "open";
const STATUT_PART = "part";
const STATUT_COMPLETE = "complete";
const STATUT_PROMESSE = "promesse";
const STATUT_CANCELLED = "annulé";
const TYPE_RESA = "resas";
const TYPE_COST = "Coût (libellé)";
const TYPE_TRANSPORT_ALLER = "transport aller";
const TYPE_TRANSPORT_RETOUR = "transport retour";
const TYPE_PAIEMENT = "paiement";
const TYPE_PAIEMENT_CB = "paiement CB";
const TYPE_REDUCTION = "Réduction";
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Inscription::class, inversedBy="comptas",cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $inscription;
/**
* @ORM\Column(type="string", length=255)
*/
private $type;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
private $complement;
/**
* @ORM\Column(type="float")
*/
private $valeur;
/**
* @ORM\Column(type="string", length=255, nullable = true)
*/
private $reference;
/**
* @ORM\Column(type="datetime", nullable= true)
*/
private $bookingDate;
/**
* @ORM\ManyToOne(targetEntity=Commande::class, inversedBy="compta")
*/
private $commande;
/**
* @ORM\Column(type="string", length=40, nullable=true)
*/
private $statut;
/**
* @ORM\Column(type="datetime")
*/
private $creationDate;
/**
* @ORM\ManyToOne(targetEntity=Contact::class, inversedBy="comptas")
* @ORM\JoinColumn(nullable=false)
*/
private $contact;
/**
* @ORM\Column(type="string", length=30, nullable=true)
*/
private $legacyId;
/**
* @ORM\ManyToOne(targetEntity=ComptaType::class, inversedBy="comptas")
*/
private $comptaType;
public function getId(): ?int
{
return $this->id;
}
public function getInscription(): ?Inscription
{
return $this->inscription;
}
public function setInscription(?Inscription $inscription): self
{
$this->inscription = $inscription;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getComplement(): ?string
{
return $this->complement;
}
public function setComplement(?string $complement): self
{
$this->complement = $complement;
return $this;
}
public function getValeur(): ?float
{
return $this->valeur;
}
public function setValeur(float $valeur): self
{
$this->valeur = $valeur;
return $this;
}
public function getReference(): ?string
{
return $this->reference;
}
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
public function getBookingDate(): ?\DateTimeInterface
{
return $this->bookingDate;
}
public function setBookingDate(\DateTimeInterface $paiementDate): self
{
$this->bookingDate = $paiementDate;
return $this;
}
public function getCommande(): ?Commande
{
return $this->commande;
}
public function setCommande(?Commande $commande): self
{
$this->commande = $commande;
return $this;
}
public function getStatut(): ?string
{
return $this->statut;
}
public function setStatut(?string $statut): self
{
$this->statut = $statut;
return $this;
}
public function getCreationDate(): ?\DateTimeInterface
{
return $this->creationDate;
}
public function setCreationDate(\DateTimeInterface $creationDate): self
{
$this->creationDate = $creationDate;
return $this;
}
public function __construct(){
$this->creationDate = new \Datetime();
$this->bookingDate = new \DateTime();
}
public function getContact(): ?Contact
{
return $this->contact;
}
public function setContact(?Contact $contact): self
{
$this->contact = $contact;
return $this;
}
public function getLegacyId(): ?string
{
return $this->legacyId;
}
public function setLegacyId(?string $legacyId): self
{
$this->legacyId = $legacyId;
return $this;
}
public function getComptaType(): ?ComptaType
{
return $this->comptaType;
}
public function setComptaType(?ComptaType $comptaType): self
{
$this->comptaType = $comptaType;
return $this;
}
}