src/Entity/PaiementFournisseur.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PaiementFournisseurRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassPaiementFournisseurRepository::class)]
  7. class PaiementFournisseur
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'paiements')]
  14.     #[ORM\JoinColumn(nullabletrue)]
  15.     private ?Fournisseur $fournisseur null;
  16.     #[ORM\ManyToOne(inversedBy'paiements')]
  17.     #[ORM\JoinColumn(nullabletrue)]
  18.     private ?AchatFournisseur $achat null;
  19.     #[ORM\ManyToOne]
  20.     #[ORM\JoinColumn(nullabletrue)]
  21.     private ?DetteFournisseur $dette null;
  22.     #[ORM\Column]
  23.     private ?float $montant null;
  24.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  25.     private ?\DateTimeInterface $datePaiement null;
  26.     #[ORM\Column(length100)]
  27.     private ?string $modePaiement null// ESPECES, CHEQUE, VIREMENT, MOBILE_MONEY
  28.     #[ORM\Column(length255nullabletrue)]
  29.     private ?string $reference null// Numéro de chèque, référence virement, etc.
  30.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  31.     private ?string $notes null;
  32.     #[ORM\ManyToOne]
  33.     #[ORM\JoinColumn(nullabletrue)]
  34.     private ?User $utilisateur null;
  35.     #[ORM\ManyToOne]
  36.     #[ORM\JoinColumn(nullabletrue)]
  37.     private ?Boutique $boutique null;
  38.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  39.     private ?\DateTimeInterface $createdAt null;
  40.     public function __construct()
  41.     {
  42.         $this->datePaiement = new \DateTime();
  43.         $this->createdAt = new \DateTime();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getFournisseur(): ?Fournisseur
  50.     {
  51.         return $this->fournisseur;
  52.     }
  53.     public function setFournisseur(?Fournisseur $fournisseur): static
  54.     {
  55.         $this->fournisseur $fournisseur;
  56.         return $this;
  57.     }
  58.     public function getAchat(): ?AchatFournisseur
  59.     {
  60.         return $this->achat;
  61.     }
  62.     public function setAchat(?AchatFournisseur $achat): static
  63.     {
  64.         $this->achat $achat;
  65.         return $this;
  66.     }
  67.     public function getDette(): ?DetteFournisseur
  68.     {
  69.         return $this->dette;
  70.     }
  71.     public function setDette(?DetteFournisseur $dette): static
  72.     {
  73.         $this->dette $dette;
  74.         return $this;
  75.     }
  76.     public function getMontant(): ?float
  77.     {
  78.         return $this->montant;
  79.     }
  80.     public function setMontant(float $montant): static
  81.     {
  82.         $this->montant $montant;
  83.         return $this;
  84.     }
  85.     public function getDatePaiement(): ?\DateTimeInterface
  86.     {
  87.         return $this->datePaiement;
  88.     }
  89.     public function setDatePaiement(\DateTimeInterface $datePaiement): static
  90.     {
  91.         $this->datePaiement $datePaiement;
  92.         return $this;
  93.     }
  94.     public function getModePaiement(): ?string
  95.     {
  96.         return $this->modePaiement;
  97.     }
  98.     public function setModePaiement(string $modePaiement): static
  99.     {
  100.         $this->modePaiement $modePaiement;
  101.         return $this;
  102.     }
  103.     public function getReference(): ?string
  104.     {
  105.         return $this->reference;
  106.     }
  107.     public function setReference(?string $reference): static
  108.     {
  109.         $this->reference $reference;
  110.         return $this;
  111.     }
  112.     public function getNotes(): ?string
  113.     {
  114.         return $this->notes;
  115.     }
  116.     public function setNotes(?string $notes): static
  117.     {
  118.         $this->notes $notes;
  119.         return $this;
  120.     }
  121.     public function getUtilisateur(): ?User
  122.     {
  123.         return $this->utilisateur;
  124.     }
  125.     public function setUtilisateur(?User $utilisateur): static
  126.     {
  127.         $this->utilisateur $utilisateur;
  128.         return $this;
  129.     }
  130.     public function getBoutique(): ?Boutique
  131.     {
  132.         return $this->boutique;
  133.     }
  134.     public function setBoutique(?Boutique $boutique): static
  135.     {
  136.         $this->boutique $boutique;
  137.         return $this;
  138.     }
  139.     public function getCreatedAt(): ?\DateTimeInterface
  140.     {
  141.         return $this->createdAt;
  142.     }
  143.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  144.     {
  145.         $this->createdAt $createdAt;
  146.         return $this;
  147.     }
  148.     public function __toString(): string
  149.     {
  150.         return sprintf(
  151.             'Paiement #%d - %s FCFA le %s',
  152.             $this->id ?? 0,
  153.             number_format($this->montant0','' '),
  154.             $this->datePaiement $this->datePaiement->format('d/m/Y') : ''
  155.         );
  156.     }
  157. }