src/Entity/TransfertEnvoie.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  5. use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\TransfertEnvoieRepository")
  8.  */
  9. class TransfertEnvoie
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\Agent", inversedBy="transfertEnvoies")
  19.      */
  20.     private $agent;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Agent")
  23.      * @ORM\JoinColumn(nullable=true)
  24.      */
  25.     private $clientExpediteur;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\Agent")
  28.      * @ORM\JoinColumn(nullable=true)
  29.      */
  30.     private $clientDestinateur;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $expediteur;
  35.     /**
  36.      * @ORM\Column(type="string", length=255)
  37.      */
  38.     private $destinateur;
  39.     /**
  40.      * @ORM\Column(type="string", length=5)
  41.      */
  42.     private $ville;
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      */
  46.     private $code;
  47.     /**
  48.      * @ORM\Column(type="string", length=255, nullable=true)
  49.      */
  50.     private $phraseSecret;
  51.     /**
  52.      * @ORM\Column(type="float")
  53.      */
  54.     private $pourcentage;
  55.     /**
  56.      * @ORM\Column(type="float", nullable=true)
  57.      */
  58.     private $pourcentageLocal;
  59.     /**
  60.      * @ORM\Column(type="decimal", scale=3, precision=11)
  61.      */
  62.     private $Montant;
  63.     /**
  64.      * @ORM\Column(type="decimal", scale=4, precision=12, nullable=true)
  65.      */
  66.     private $tauxDuJour;
  67.     /**
  68.      * @ORM\Column(type="decimal", scale=2, precision=15, nullable=true)
  69.      */
  70.     private $monnaieLocale;
  71.     /**
  72.      * @ORM\Column(type="integer")
  73.      */
  74.     private $devise;
  75.     /**
  76.      * @ORM\Column(type="date")
  77.      */
  78.     private $dateOperation;
  79.     /**
  80.      * @ORM\Column(type="boolean")
  81.      */
  82.     private $etat;
  83.     private $montantPourcentage;
  84.     private $montantPourcentageLocal;
  85.     private $montantPourcentageBanque;
  86.     private $montantPourcentageNous;
  87.     /**
  88.      * @ORM\Column(type="string", length=255, nullable=true)
  89.      */
  90.     private $numeroTel;
  91.     /**
  92.      * @ORM\Column(type="boolean")
  93.      */
  94.     private $isDelivered;
  95.     /**
  96.      * @ORM\Column(type="datetime", nullable=true)
  97.      */
  98.     private $deliveredAt;
  99.     /**
  100.      * @ORM\Column(type="integer")
  101.      */
  102.     private $periodDelivered;
  103.     /**
  104.      * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="transfertEnvoies")
  105.      */
  106.     private $userValidated;
  107.     private $alert;
  108.     /**
  109.      * @ORM\Column(type="string", length=17, nullable=true)
  110.      */
  111.     private $contactExpediteur;
  112.     /**
  113.      * @ORM\Column(type="string", length=255, nullable=true)
  114.      */
  115.     private $modeTransfert;
  116.     public function __construct()
  117.     {
  118.         $this->dateOperation = new \DateTime();
  119.         $this->deliveredAt = null;
  120.         $this->etat = false;
  121.         $this->isDelivered = false;
  122.         $this->userValidated = null;
  123.     }
  124.     public function getId(): ?int
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function getAgent(): ?Agent
  129.     {
  130.         return $this->agent;
  131.     }
  132.     public function setAgent(?Agent $agent): self
  133.     {
  134.         $this->agent = $agent;
  135.         return $this;
  136.     }
  137.     public function getClientExpediteur(): ?Agent
  138.     {
  139.         return $this->clientExpediteur;
  140.     }
  141.     public function setClientExpediteur(?Agent $clientExpediteur): self
  142.     {
  143.         $this->clientExpediteur = $clientExpediteur;
  144.         return $this;
  145.     }
  146.     public function getClientDestinateur(): ?Agent
  147.     {
  148.         return $this->clientDestinateur;
  149.     }
  150.     public function setClientDestinateur(?Agent $clientDestinateur): self
  151.     {
  152.         $this->clientDestinateur = $clientDestinateur;
  153.         return $this;
  154.     }
  155.     public function getExpediteur(): ?string
  156.     {
  157.         return $this->expediteur;
  158.     }
  159.     public function setExpediteur(string $expediteur): self
  160.     {
  161.         $this->expediteur = $expediteur;
  162.         return $this;
  163.     }
  164.     public function getDestinateur(): ?string
  165.     {
  166.         return $this->destinateur;
  167.     }
  168.     public function setDestinateur(string $destinateur): self
  169.     {
  170.         $this->destinateur = $destinateur;
  171.         return $this;
  172.     }
  173.     public function getVille(): ?string
  174.     {
  175.         return $this->ville;
  176.     }
  177.     public function setVille(string $ville): self
  178.     {
  179.         $this->ville = $ville;
  180.         return $this;
  181.     }
  182.     public function getCode(): ?string
  183.     {
  184.         return $this->code;
  185.     }
  186.     public function setCode(string $code): self
  187.     {
  188.         $this->code = $code;
  189.         return $this;
  190.     }
  191.     public function getPhraseSecret(): ?string
  192.     {
  193.         return $this->phraseSecret;
  194.     }
  195.     public function setPhraseSecret(?string $phraseSecret): self
  196.     {
  197.         $this->phraseSecret = $phraseSecret;
  198.         return $this;
  199.     }
  200.     public function getPourcentage(): ?float
  201.     {
  202.         return $this->pourcentage;
  203.     }
  204.     public function setPourcentage(float $pourcentage): self
  205.     {
  206.         $this->pourcentage = $pourcentage;
  207.         return $this;
  208.     }
  209.     public function getPourcentageLocal(): ?float
  210.     {
  211.         return $this->pourcentageLocal;
  212.     }
  213.     public function setPourcentageLocal(?float $pourcentageLocal): self
  214.     {
  215.         $this->pourcentageLocal = $pourcentageLocal;
  216.         return $this;
  217.     }
  218.     public function getMontant(): ?float
  219.     {
  220.         return $this->Montant;
  221.     }
  222.     public function setMontant(float $Montant): self
  223.     {
  224.         $this->Montant = $Montant;
  225.         return $this;
  226.     }
  227.     public function getTauxDuJour(): ?string
  228.     {
  229.         return $this->tauxDuJour;
  230.     }
  231.     public function setTauxDuJour(?string $tauxDuJour): self
  232.     {
  233.         $this->tauxDuJour = $tauxDuJour;
  234.         return $this;
  235.     }
  236.     public function getMonnaieLocale(): ?string
  237.     {
  238.         return $this->monnaieLocale;
  239.     }
  240.     public function setMonnaieLocale(?string $monnaieLocale): self
  241.     {
  242.         $this->monnaieLocale = $monnaieLocale;
  243.         return $this;
  244.     }
  245.     public function getDevise(): ?int
  246.     {
  247.         return $this->devise;
  248.     }
  249.     public function setDevise(int $devise): self
  250.     {
  251.         $this->devise = $devise;
  252.         return $this;
  253.     }
  254.     public function getDateOperation(): ?\DateTimeInterface
  255.     {
  256.         return $this->dateOperation;
  257.     }
  258.     public function setDateOperation(\DateTimeInterface $dateOperation): self
  259.     {
  260.         $this->dateOperation = $dateOperation;
  261.         return $this;
  262.     }
  263.     public function getEtat(): ?bool
  264.     {
  265.         return $this->etat;
  266.     }
  267.     public function setEtat(bool $etat): self
  268.     {
  269.         $this->etat = $etat;
  270.         return $this;
  271.     }
  272.     /**
  273.      * @return mixed
  274.      */
  275.     public function getMontantPourcentage()
  276.     {
  277.         $this->montantPourcentage = ($this->getMontant() / 100) * $this->getPourcentage();
  278.         return $this->montantPourcentage;
  279.     }
  280.     /**
  281.      * @return mixed
  282.      */
  283.     public function getMontantPourcentageLocal()
  284.     {
  285.         $this->montantPourcentageLocal = ($this->getMonnaieLocale() / 100) * $this->getPourcentage();
  286.         return $this->montantPourcentageLocal;
  287.     }
  288.     /**
  289.      * @return mixed
  290.      */
  291.     public function getMontantPourcentageBanque()
  292.     {
  293.         $this->montantPourcentageBanque = ($this->getMontant() / 100) * 1.5;
  294.         return $this->montantPourcentageBanque;
  295.     }
  296.     /**
  297.      * @return mixed
  298.      */
  299.     public function getMontantPourcentageNous()
  300.     {
  301.         $pourcBq = $this->getPourcentage() - 1.5;
  302.         $this->montantPourcentageNous = ($this->getMontant() / 100) * $pourcBq;
  303.         return $this->montantPourcentageNous;
  304.     }
  305.     public function getNumeroTel(): ?string
  306.     {
  307.         return $this->numeroTel;
  308.     }
  309.     public function setNumeroTel(?string $numeroTel): self
  310.     {
  311.         $this->numeroTel = $numeroTel;
  312.         return $this;
  313.     }
  314.     public function isIsDelivered(): ?bool
  315.     {
  316.         return $this->isDelivered;
  317.     }
  318.     public function setIsDelivered(bool $isDelivered): self
  319.     {
  320.         $this->isDelivered = $isDelivered;
  321.         return $this;
  322.     }
  323.     public function getDeliveredAt(): ?\DateTimeInterface
  324.     {
  325.         return $this->deliveredAt;
  326.     }
  327.     public function setDeliveredAt(?\DateTimeInterface $deliveredAt): self
  328.     {
  329.         $this->deliveredAt = $deliveredAt;
  330.         return $this;
  331.     }
  332.     public function getPeriodDelivered(): ?int
  333.     {
  334.         return $this->periodDelivered;
  335.     }
  336.     public function setPeriodDelivered(int $periodDelivered): self
  337.     {
  338.         $this->periodDelivered = $periodDelivered;
  339.         return $this;
  340.     }
  341.     public function getUserValidated(): ?Utilisateur
  342.     {
  343.         return $this->userValidated;
  344.     }
  345.     public function setUserValidated(?Utilisateur $userValidated): self
  346.     {
  347.         $this->userValidated = $userValidated;
  348.         return $this;
  349.     }
  350.     public function getAlert()
  351.     {
  352.         $create = $this->getDateOperation();
  353.         $later = new \DateTime(date('Y-m-d'));
  354.         $this->alert = $later->diff($create)->format("%a");
  355.         return $this->alert;
  356.     }
  357.     public function getContactExpediteur(): ?string
  358.     {
  359.         return $this->contactExpediteur;
  360.     }
  361.     public function setContactExpediteur(?string $contactExpediteur): self
  362.     {
  363.         $this->contactExpediteur = $contactExpediteur;
  364.         return $this;
  365.     }
  366.     public function getModeTransfert(): ?string
  367.     {
  368.         return $this->modeTransfert;
  369.     }
  370.     public function setModeTransfert(?string $mode_transfert): self
  371.     {
  372.         $this->modeTransfert = $mode_transfert;
  373.         return $this;
  374.     }
  375. }