src/Entity/GestionComerciale/Acompte.php line 29

Open in your IDE?
  1. <?php
  2. namespace App\Entity\GestionComerciale;
  3. use DateInterval;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use App\Entity\Articles\Devise;
  9. use App\Entity\Clients\Client;
  10. use App\Entity\FO\CompteBancaire;
  11. use App\Entity\Utilisateur\Utilisateur;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. use Symfony\Component\Validator\Constraints as Assert;
  14. use Symfony\Component\Validator\ExecutionContextInterface;
  15. use App\Annotations\SecuredEntity;
  16. /**
  17.  * Acompte
  18.  *
  19.  * @ORM\Table("commerciale__acompte")
  20.  * @ORM\Entity(repositoryClass="App\Repository\GestionComerciale\AcompteRepository")
  21.  * @Gedmo\SoftDeleteable(fieldName="dateSuppression",timeAware=false)
  22.  * @ORM\HasLifecycleCallbacks()
  23.  * @SecuredEntity(name="Acompte", group="VENTES")
  24.  */
  25. class Acompte
  26. {
  27.     /**
  28.      * @ORM\Column(name="id", type="integer")
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue(strategy="AUTO")
  31.      */
  32.     private $id;
  33.     /**
  34.      * @ORM\Column(name="commentaire", type="text", nullable=true)
  35.      */
  36.     private $commentaire;
  37.     /**
  38.      * @ORM\Column(name="id_import", type="string", length=255, nullable=true)
  39.      */
  40.     private $idImport;
  41.     /**
  42.      * @ORM\Column(name="id_transaction", type="string", length=255, nullable=true)
  43.      */
  44.     private $idTransaction;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur\Utilisateur", inversedBy="acomptes")
  47.      * @ORM\JoinColumn(nullable=true)
  48.      */
  49.     private $utilisateur;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\ModeReglement", cascade={"persist"})
  52.      * @Assert\NotBlank(message="Le mode de réglement est obligatoire")
  53.      */
  54.     private $modeReglement;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\TypeReglement", cascade={"persist"})
  57.      * @Assert\NotBlank(message="Le type de réglement est obligatoire")
  58.      */
  59.     private $typeReglement;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Acompte")
  62.      * @ORM\JoinColumn(nullable=true)
  63.      */
  64.     private $acompteParent;
  65.     /**
  66.      * @ORM\Column(name="est_parent", type="boolean", nullable=true)
  67.      */
  68.     private $estParent;
  69.     /**
  70.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Acompte")
  71.      * @ORM\JoinColumn(nullable=true)
  72.      */
  73.     private $remboursement;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande", inversedBy="acomptes")
  76.      * @ORM\JoinColumn(nullable=true)
  77.      */
  78.     private $commande;
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande")
  81.      * @ORM\JoinColumn(nullable=true)
  82.      */
  83.     private $avoir;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Commande", inversedBy="reglements")
  86.      * @ORM\JoinColumn(nullable=true)
  87.      */
  88.     private $parent;
  89.     /**
  90.      * @ORM\Column(name="montant", type="float", nullable=true)
  91.      * @Assert\NotBlank(message="Le montant est obligatoire")
  92.      */
  93.     private $montant;
  94.     /**
  95.      * @ORM\Column(name="dateReglement", type="datetime", nullable=true)
  96.      */
  97.     private $dateReglement;
  98.     /**
  99.      * @ORM\Column(name="date", type="datetime", nullable=true)
  100.      */
  101.     private $date;
  102.     /**
  103.      * @ORM\Column(name="dateSuppression", type="datetime", nullable=true)
  104.      */
  105.     private $dateSuppression;
  106.     /**
  107.      * @ORM\Column(name="dateMaj", type="datetime", nullable=true)
  108.      * @Gedmo\Timestampable(on="update")
  109.      */
  110.     private $dateMaj;
  111.     /**
  112.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\DelaiPaiement", cascade={"persist"})
  113.      * @ORM\JoinColumn(nullable=true)
  114.      */
  115.     private $delaiPaiement;
  116.     /**
  117.      * @ORM\Column(name="dateEcheance", type="datetime", nullable=true)
  118.      */
  119.     private $dateEcheance;
  120.     /**
  121.      * @ORM\Column(name="nomClient", type="string", length=255, nullable=true)
  122.      */
  123.     private $nomClient;
  124.     /**
  125.      * @ORM\Column(name="numPiece", type="string", length=255, nullable=true)
  126.      */
  127.     private $numPiece;
  128.     /**
  129.      * @ORM\Column(name="numTraite", type="string", length=255, nullable=true)
  130.      */
  131.     private $numTraite;
  132.     /**
  133.      * @ORM\Column(name="codeAgence", type="string", length=255, nullable=true)
  134.      */
  135.     private $codeAgence;
  136.     /**
  137.      * @ORM\Column(name="nomAgence", type="string", length=255, nullable=true)
  138.      */
  139.     private $nomAgence;
  140.     /**
  141.      * @ORM\Column(name="domiciliation", type="string", length=255, nullable=true)
  142.      */
  143.     private $domiciliation;
  144.     /**
  145.      * @ORM\Column(name="domiciliation2", type="string", length=255, nullable=true)
  146.      */
  147.     private $domiciliation2;
  148.     /**
  149.      * @ORM\Column(name="bor", type="boolean", nullable=true)
  150.      */
  151.     private $bor;
  152.     /**
  153.      * @ORM\Column(name="codeEtablissement", type="string", length=255, nullable=true)
  154.      */
  155.     private $codeEtablissement;
  156.     /**
  157.      * @ORM\Column(name="codeGuichet", type="string", length=255, nullable=true)
  158.      */
  159.     private $codeGuichet;
  160.     /**
  161.      * @ORM\Column(name="numCompte", type="string", length=255, nullable=true)
  162.      */
  163.     private $numCompte;
  164.     /**
  165.      * @ORM\Column(name="cleCompte", type="string", length=255, nullable=true)
  166.      */
  167.     private $cleCompte;
  168.     /**
  169.      * @ORM\Column(name="IBAN", type="string", length=255, nullable=true)
  170.      */
  171.     private $iBAN;
  172.     /**
  173.      * @ORM\Column(name="BIC", type="string", length=255, nullable=true)
  174.      */
  175.     private $bIC;
  176.     /**
  177.      * @ORM\Column(name="numRUM", type="string", length=255, nullable=true)
  178.      */
  179.     private $numRUM;
  180.     /**
  181.      * @ORM\Column(name="dateContrat", type="datetime", nullable=true)
  182.      */
  183.     private $dateContrat;
  184.     /**
  185.      * @ORM\Column(name="lieuContrat", type="string", length=255, nullable=true)
  186.      */
  187.     private $lieuContrat;
  188.     /**
  189.      * @ORM\Column(name="refTire", type="string", length=255, nullable=true)
  190.      */
  191.     private $refTire;
  192.     /**
  193.      * @ORM\Column(name="refTireur", type="string", length=255, nullable=true)
  194.      */
  195.     private $refTireur;
  196.     /**
  197.      * @ORM\Column(name="codeBanque", type="string", length=255, nullable=true)
  198.      */
  199.     private $codeBanque;
  200.     /**
  201.      * @ORM\Column(name="codeTransfert", type="string", length=255, nullable=true)
  202.      */
  203.     private $codeTransfert;
  204.     /**
  205.      * @ORM\Column(name="codeAcceptation", type="string", length=255, nullable=true)
  206.      */
  207.     private $codeAcceptation;
  208.     /**
  209.      * @ORM\ManyToOne(targetEntity="App\Entity\Clients\Client", inversedBy="reglements")
  210.      * @ORM\JoinColumn(nullable=true)
  211.      */
  212.     private $client;
  213.     /**
  214.      * @ORM\ManyToOne(targetEntity="App\Entity\Articles\Devise", inversedBy="reglements")
  215.      * @ORM\JoinColumn(nullable=true)
  216.      */
  217.     private $devise;
  218.     /**
  219.      * @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\Commande", cascade={"persist"}, mappedBy="lcr")
  220.      */
  221.     private $factures;
  222.     /**
  223.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Bordereau", inversedBy="reglements")
  224.      * @ORM\JoinColumn(nullable=true)
  225.      */
  226.     private $bordereau;
  227.     /**
  228.      * @ORM\ManyToOne(targetEntity="App\Entity\FO\CompteBancaire", inversedBy="reglements")
  229.      * @ORM\JoinColumn(nullable=true)
  230.      */
  231.     private $compteBancaireSociete;
  232.     /**
  233.      * @ORM\Column(name="transfert_compta", type="boolean")
  234.      */
  235.     private $transfertCompta;
  236.     /**
  237.      * @ORM\Column(name="operation_diverse", type="float", nullable=true)
  238.      */
  239.     private $operationDiverse;
  240.     /**
  241.      * @ORM\ManyToOne(targetEntity="App\Entity\GestionComerciale\Acompte", inversedBy="reglementsEnfant")
  242.      * @ORM\JoinColumn(nullable=true)
  243.      */
  244.     private $reglementParent;
  245.     /**
  246.      * @ORM\OneToMany(targetEntity="App\Entity\GestionComerciale\Acompte", mappedBy="reglementParent")
  247.      */
  248.     private $reglementsEnfant;
  249.     /**
  250.      *
  251.      * @ORM\OneToOne(targetEntity="App\Entity\GestionComerciale\MouvementCaisse", mappedBy="reglement")
  252.      *
  253.      */
  254.     private $mouvementCaisse;
  255.     /**
  256.      * @ORM\Column(name="mouvement_equilibrage", type="boolean", nullable=true)
  257.      */
  258.     private $mouvementEquilibrage;
  259.     /**
  260.      * @ORM\Column(name="hors_erp", type="boolean", nullable=true)
  261.      */
  262.     private $horsErp;
  263.     /**
  264.      * @ORM\Column(name="solde", type="float", nullable=true)
  265.      *
  266.      */
  267.     private $solde;
  268.     /**
  269.      * @ORM\Column(name="numero_lettrage", type="float", nullable=true)
  270.      *
  271.      */
  272.     private $numeroLettrage;
  273.     /**
  274.      * @ORM\Column(name="lettrage", type="string", length=255, nullable=true)
  275.      */
  276.     private $lettrage;
  277.     public function __construct()
  278.     {
  279.         $date                       = new Datetime ;
  280.         $this->date                 $date;
  281.         //$this->dateEcheance = $date;
  282.         $this->dateReglement        = new Datetime();
  283.         $this->bor                  false;
  284.         $this->transfertCompta      false;
  285.         $this->estParent            false;
  286.         $this->mouvementEquilibrage false;
  287.         $this->horsErp              false;
  288.         $this->operationDiverse     0;
  289.         $this->reglementsEnfant     = new ArrayCollection();
  290.         $this->factures             = new ArrayCollection();
  291.     }
  292.     /*
  293.     public function isMontantValid()
  294.     {
  295.         $montantCommande = $this->commande->getTotalTtc();
  296.         $montantAcompte = $this->getMontant();
  297.         if($montantAcompte > $montantCommande) return false;
  298.         return true;
  299.     }
  300.      *
  301.      */
  302.     public function getId(): int
  303.     {
  304.         return $this->id;
  305.     }
  306.     public function setMontant(?float $montant): Acompte
  307.     {
  308.         $this->montant $montant;
  309.         return $this;
  310.     }
  311.     public function getMontant(): ?float
  312.     {
  313.         return $this->montant;
  314.     }
  315.     public function setDate(?DateTime $date): Acompte
  316.     {
  317.         $this->date $date;
  318.         return $this;
  319.     }
  320.     public function getDate(): ?DateTime
  321.     {
  322.         return $this->date;
  323.     }
  324.     public function setDateSuppression(?DateTime $dateSuppression): Acompte
  325.     {
  326.         $this->dateSuppression $dateSuppression;
  327.         return $this;
  328.     }
  329.     public function getDateSuppression(): ?DateTime
  330.     {
  331.         return $this->dateSuppression;
  332.     }
  333.     public function setDateMaj(?DateTime $dateMaj): Acompte
  334.     {
  335.         $this->dateMaj $dateMaj;
  336.         return $this;
  337.     }
  338.     public function getDateMaj(): ?DateTime
  339.     {
  340.         return $this->dateMaj;
  341.     }
  342.     public function setDelaiPaiement(?DelaiPaiement $delaiPaiement): Acompte
  343.     {
  344.         $this->delaiPaiement $delaiPaiement;
  345.         return $this;
  346.     }
  347.     public function getDelaiPaiement(): ?DelaiPaiement
  348.     {
  349.         return $this->delaiPaiement;
  350.     }
  351.     public function setUtilisateur(?Utilisateur $utilisateur): Acompte
  352.     {
  353.         $this->utilisateur $utilisateur;
  354.         return $this;
  355.     }
  356.     public function getUtilisateur(): ?Utilisateur
  357.     {
  358.         return $this->utilisateur;
  359.     }
  360.     public function setCommande(?Commande $commande): Acompte
  361.     {
  362.         $this->commande $commande;
  363.         return $this;
  364.     }
  365.     public function getCommande(): ?Commande
  366.     {
  367.         return $this->commande;
  368.     }
  369.     public function setDateReglement(?DateTime $dateReglement): Acompte
  370.     {
  371.         $date = new Datetime();
  372.         $dateReglement->modify("+".$date->format("H")."hours");
  373.         $dateReglement->modify("+".$date->format("i")."minutes");
  374.         $this->dateReglement $dateReglement ;
  375.         return $this;
  376.     }
  377.     public function getDateReglement(): ?DateTime
  378.     {
  379.         return $this->dateReglement;
  380.     }
  381.     public function setModeReglement(?ModeReglement $modeReglement): Acompte
  382.     {
  383.         $this->modeReglement $modeReglement;
  384.         return $this;
  385.     }
  386.     public function getModeReglement(): ?ModeReglement
  387.     {
  388.         return $this->modeReglement;
  389.     }
  390.     public function setTypeReglement(?TypeReglement $typeReglement): Acompte
  391.     {
  392.         $this->typeReglement $typeReglement;
  393.         return $this;
  394.     }
  395.     public function getTypeReglement(): ?TypeReglement
  396.     {
  397.         return $this->typeReglement;
  398.     }
  399.     public function setNomClient(?string $nomClient): Acompte
  400.     {
  401.         $this->nomClient $nomClient;
  402.         return $this;
  403.     }
  404.     public function getNomClient(): ?string
  405.     {
  406.         return $this->nomClient;
  407.     }
  408.     public function setNumPiece(?string $numPiece): Acompte
  409.     {
  410.         $this->numPiece $numPiece;
  411.         return $this;
  412.     }
  413.     public function getNumPiece(): ?string
  414.     {
  415.         return $this->numPiece;
  416.     }
  417.     public function setNumTraite(?string $numTraite): Acompte
  418.     {
  419.         $this->numTraite $numTraite;
  420.         return $this;
  421.     }
  422.     public function getNumTraite(): ?string
  423.     {
  424.         return $this->numTraite;
  425.     }
  426.     public function setCodeAgence(?string $codeAgence): Acompte
  427.     {
  428.         $this->codeAgence $codeAgence;
  429.         return $this;
  430.     }
  431.     public function getCodeAgence(): ?string
  432.     {
  433.         return $this->codeAgence;
  434.     }
  435.     public function setNomAgence(?string $nomAgence): Acompte
  436.     {
  437.         $this->nomAgence $nomAgence;
  438.         return $this;
  439.     }
  440.     public function getNomAgence(): ?string
  441.     {
  442.         return $this->nomAgence;
  443.     }
  444.     public function setDomiciliation(?string $domiciliation): Acompte
  445.     {
  446.         $this->domiciliation $domiciliation;
  447.         return $this;
  448.     }
  449.     public function getDomiciliation(): ?string
  450.     {
  451.         return $this->domiciliation;
  452.     }
  453.     public function setDomiciliation2(?string $domiciliation2): Acompte
  454.     {
  455.         $this->domiciliation2 $domiciliation2;
  456.         return $this;
  457.     }
  458.     public function getDomiciliation2(): ?string
  459.     {
  460.         return $this->domiciliation2;
  461.     }
  462.     public function setBor(?bool $bor): Acompte
  463.     {
  464.         $this->bor $bor;
  465.         return $this;
  466.     }
  467.     public function getBor(): ?bool
  468.     {
  469.         return $this->bor;
  470.     }
  471.     public function setCodeEtablissement(?string $codeEtablissement): Acompte
  472.     {
  473.         $this->codeEtablissement $codeEtablissement;
  474.         return $this;
  475.     }
  476.     public function getCodeEtablissement(): ?string
  477.     {
  478.         return $this->codeEtablissement;
  479.     }
  480.     public function setCodeGuichet(?string $codeGuichet): Acompte
  481.     {
  482.         $this->codeGuichet $codeGuichet;
  483.         return $this;
  484.     }
  485.     public function getCodeGuichet(): ?string
  486.     {
  487.         return $this->codeGuichet;
  488.     }
  489.     public function setNumCompte(?string $numCompte): Acompte
  490.     {
  491.         $this->numCompte $numCompte;
  492.         return $this;
  493.     }
  494.     public function getNumCompte(): ?string
  495.     {
  496.         return $this->numCompte;
  497.     }
  498.     public function setCleCompte(?string $cleCompte): Acompte
  499.     {
  500.         $this->cleCompte $cleCompte;
  501.         return $this;
  502.     }
  503.     public function getCleCompte(): ?string
  504.     {
  505.         return $this->cleCompte;
  506.     }
  507.     public function setIBAN(?string $iBAN): Acompte
  508.     {
  509.         $this->iBAN $iBAN;
  510.         return $this;
  511.     }
  512.     public function getIBAN(): ?string
  513.     {
  514.         return $this->iBAN;
  515.     }
  516.     public function setBIC(?string $bIC): Acompte
  517.     {
  518.         $this->bIC $bIC;
  519.         return $this;
  520.     }
  521.     public function getBIC(): ?string
  522.     {
  523.         return $this->bIC;
  524.     }
  525.     public function setNumRUM(?string $numRUM): Acompte
  526.     {
  527.         $this->numRUM $numRUM;
  528.         return $this;
  529.     }
  530.     public function getNumRUM(): ?string
  531.     {
  532.         return $this->numRUM;
  533.     }
  534.     public function setDateContrat(?DateTime $dateContrat): Acompte
  535.     {
  536.         $this->dateContrat $dateContrat;
  537.         return $this;
  538.     }
  539.     public function getDateContrat(): ?DateTime
  540.     {
  541.         return $this->dateContrat;
  542.     }
  543.     public function setLieuContrat(?string $lieuContrat): Acompte
  544.     {
  545.         $this->lieuContrat $lieuContrat;
  546.         return $this;
  547.     }
  548.     public function getLieuContrat(): ?string
  549.     {
  550.         return $this->lieuContrat;
  551.     }
  552.     public function setRefTire(?string $refTire): Acompte
  553.     {
  554.         $this->refTire $refTire;
  555.         return $this;
  556.     }
  557.     public function getRefTire(): ?string
  558.     {
  559.         return $this->refTire;
  560.     }
  561.     public function setRefTireur(?string $refTireur): Acompte
  562.     {
  563.         $this->refTireur $refTireur;
  564.         return $this;
  565.     }
  566.     public function getRefTireur(): ?string
  567.     {
  568.         return $this->refTireur;
  569.     }
  570.     public function setCodeBanque(?string $codeBanque): Acompte
  571.     {
  572.         $this->codeBanque $codeBanque;
  573.         return $this;
  574.     }
  575.     public function getCodeBanque(): ?string
  576.     {
  577.         return $this->codeBanque;
  578.     }
  579.     public function setCodeTransfert(?string $codeTransfert): Acompte
  580.     {
  581.         $this->codeTransfert $codeTransfert;
  582.         return $this;
  583.     }
  584.     public function getCodeTransfert(): ?string
  585.     {
  586.         return $this->codeTransfert;
  587.     }
  588.     public function setCodeAcceptation(?string $codeAcceptation): Acompte
  589.     {
  590.         $this->codeAcceptation $codeAcceptation;
  591.         return $this;
  592.     }
  593.     public function getCodeAcceptation(): ?string
  594.     {
  595.         return $this->codeAcceptation;
  596.     }
  597.     public function setTransfertCompta(bool $transfertCompta): Acompte
  598.     {
  599.         $this->transfertCompta $transfertCompta;
  600.         return $this;
  601.     }
  602.     public function getTransfertCompta(): bool
  603.     {
  604.         return $this->transfertCompta;
  605.     }
  606.     public function setClient(?Client $client): Acompte
  607.     {
  608.         $this->client $client;
  609.         if($client->getBanque() != "" and $client->getBanque() != null)$this->setCodeBanque($client->getBanque());
  610.         if($client->getGuichet() != "" and $client->getGuichet() != null)$this->setCodeGuichet($client->getGuichet());
  611.         if($client->getNCpteBanque() != "" and $client->getNCpteBanque() != null)$this->setNumCompte ($client->getNCpteBanque());
  612.         if($client->getCleBanque() != "" and $client->getCleBanque() != null)$this->setCleCompte($client->getCleBanque());
  613.         if($client->getDomiciliation1() != "" and $client->getDomiciliation1() != null)$this->setDomiciliation($client->getDomiciliation1());
  614.         if($client->getDomiciliation2() != "" and $client->getDomiciliation2() != null)$this->setDomiciliation2($client->getDomiciliation2());
  615.         if($client->getIban() != "" and $client->getIban() != null)$this->setIBAN($client->getIban());
  616.         if($client->getBic() != "" and $client->getBic() != null)$this->setBIC($client->getBic());
  617.         return $this;
  618.     }
  619.     public function getClient(): ?Client
  620.     {
  621.         return $this->client;
  622.     }
  623.     public function setDevise(?Devise $devise): Acompte
  624.     {
  625.         $this->devise $devise;
  626.         return $this;
  627.     }
  628.     public function getDevise(): ?Devise
  629.     {
  630.         return $this->devise;
  631.     }
  632.     public function addFacture(Commande $facture): Acompte
  633.     {
  634.         $this->factures[] = $facture;
  635.         return $this;
  636.     }
  637.     public function removeFacture(Commande $facture)
  638.     {
  639.         $this->factures->removeElement($facture);
  640.     }
  641.     public function getFactures(): Collection
  642.     {
  643.         return $this->factures;
  644.     }
  645.     public function setBordereauLCR(?BordereauLCR $bordereauLCR): Acompte
  646.     {
  647.         $this->bordereauLCR $bordereauLCR;
  648.         return $this;
  649.     }
  650.     public function getBordereauLCR(): BordereauLCR
  651.     {
  652.         return $this->bordereauLCR;
  653.     }
  654.     public function setCompteBancaireSociete(?CompteBancaire $compteBancaireSociete): Acompte
  655.     {
  656.         $this->compteBancaireSociete $compteBancaireSociete;
  657.         return $this;
  658.     }
  659.     public function getCompteBancaireSociete(): ?CompteBancaire
  660.     {
  661.         return $this->compteBancaireSociete;
  662.     }
  663.     public function setDateEcheance(?DateTime $dateEcheance): Acompte
  664.     {
  665.         $this->dateEcheance $dateEcheance;
  666.         return $this;
  667.     }
  668.     /**
  669.      * @ORM\PrePersist
  670.      */
  671.     public function setDateEcheanceAuto(){
  672.         if(is_object($this->client) and !is_object($this->dateEcheance)) {
  673.             $client $this->client;
  674.             //Calcul de l'échéance
  675.             if(is_object($client->getDelaiPaiement()))
  676.                 $delai $client->getDelaiPaiement()->getId();
  677.             else
  678.                 $delai 0;
  679.             if(is_object($this->commande)){
  680.                 $date $this->commande->getDate();
  681.             } else {
  682.                 $date = new DateTime();
  683.             }
  684.             switch ($delai) {
  685.                 case 1://30 jours fin de mois
  686.                     $interval = new DateInterval"P30D" );
  687.                     $date->add($interval);
  688.                     $echeance = new DateTime('last day of '.$date->format('F Y'));
  689.                     break;
  690.                 case 2://A reception facture
  691.                     $echeance $date;
  692.                     break;
  693.                 case 3://30 jours
  694.                     $echeance $date;
  695.                     $interval = new DateInterval"P30D" );
  696.                     $echeance->add($interval);
  697.                     break;
  698.                 case 4://45 jours fin de mois
  699.                     $interval = new DateInterval"P45D" );
  700.                     $date->add($interval);
  701.                     $echeance = new DateTime('last day of '.$date->format('F Y'));
  702.                     break;
  703.                 case 5://60 jours
  704.                     $echeance $date;
  705.                     $interval = new DateInterval"P60D" );
  706.                     $echeance->add($interval);
  707.                     break;
  708.                 default:
  709.                     $echeance $date;
  710.             }
  711.             $this->setDateEcheance($echeance);
  712.         } elseif(!is_object($this->dateEcheance)) {
  713.             $echeance $this->date;
  714.             $this->setDateEcheance($echeance);
  715.         }
  716.     }
  717.     public function getDateEcheance(): ?DateTime
  718.     {
  719.         return $this->dateEcheance;
  720.     }
  721.     public function setBordereau(?Bordereau $bordereau): Acompte
  722.     {
  723.         $this->bordereau $bordereau;
  724.         return $this;
  725.     }
  726.     public function getBordereau(): ?Bordereau
  727.     {
  728.         return $this->bordereau;
  729.     }
  730.     public function setOperationDiverse(?float $operationDiverse): Acompte
  731.     {
  732.         $this->operationDiverse $operationDiverse;
  733.         return $this;
  734.     }
  735.     public function getOperationDiverse(): ?float
  736.     {
  737.         return $this->operationDiverse;
  738.     }
  739.     public function setParent(?Commande $parent): Acompte
  740.     {
  741.         $this->parent $parent;
  742.         return $this;
  743.     }
  744.     public function getParent(): ?Commande
  745.     {
  746.         return $this->parent;
  747.     }
  748.     public function setRemboursement(?Acompte $remboursement): Acompte
  749.     {
  750.         $this->remboursement $remboursement;
  751.         return $this;
  752.     }
  753.     public function getRemboursement(): ?Acompte
  754.     {
  755.         return $this->remboursement;
  756.     }
  757.     public function setCommentaire(?string $commentaire): Acompte
  758.     {
  759.         $this->commentaire $commentaire;
  760.         return $this;
  761.     }
  762.     public function getCommentaire(): ?string
  763.     {
  764.         return $this->commentaire;
  765.     }
  766.     public function setAcompteParent(?Acompte $acompteParent): Acompte
  767.     {
  768.         $this->acompteParent $acompteParent;
  769.         return $this;
  770.     }
  771.     public function getAcompteParent(): ?Acompte
  772.     {
  773.         return $this->acompteParent;
  774.     }
  775.     public function setEstParent(?bool $estParent): Acompte
  776.     {
  777.         $this->estParent $estParent;
  778.         return $this;
  779.     }
  780.     public function getEstParent(): ?bool
  781.     {
  782.         return $this->estParent;
  783.     }
  784.     public function setReglementParent(?Acompte $reglementParent): Acompte
  785.     {
  786.         $this->reglementParent $reglementParent;
  787.         return $this;
  788.     }
  789.     public function getReglementParent(): ?Acompte
  790.     {
  791.         return $this->reglementParent;
  792.     }
  793.     public function addReglementsEnfant(Acompte $reglementsEnfant): Acompte
  794.     {
  795.         $this->reglementsEnfant[] = $reglementsEnfant;
  796.         return $this;
  797.     }
  798.     public function removeReglementsEnfant(Acompte $reglementsEnfant)
  799.     {
  800.         $this->reglementsEnfant->removeElement($reglementsEnfant);
  801.     }
  802.     public function getReglementsEnfant(): Collection
  803.     {
  804.         return $this->reglementsEnfant;
  805.     }
  806.     public function setAvoir(?Commande $avoir): Acompte
  807.     {
  808.         $this->avoir $avoir;
  809.         return $this;
  810.     }
  811.     public function getAvoir(): ?Commande
  812.     {
  813.         return $this->avoir;
  814.     }
  815.     public function setMouvementCaisse(?MouvementCaisse $mouvementCaisse): Acompte
  816.     {
  817.         $this->mouvementCaisse $mouvementCaisse;
  818.         return $this;
  819.     }
  820.     public function getMouvementCaisse(): ?MouvementCaisse
  821.     {
  822.         return $this->mouvementCaisse;
  823.     }
  824.     public function setMouvementEquilibrage(?bool $mouvementEquilibrage): Acompte
  825.     {
  826.         $this->mouvementEquilibrage $mouvementEquilibrage;
  827.         return $this;
  828.     }
  829.     public function getMouvementEquilibrage(): ?bool
  830.     {
  831.         return $this->mouvementEquilibrage;
  832.     }
  833.     public function setHorsErp(?bool $horsErp): Acompte
  834.     {
  835.         $this->horsErp $horsErp;
  836.         return $this;
  837.     }
  838.     public function getHorsErp(): ?bool
  839.     {
  840.         return $this->horsErp;
  841.     }
  842.     public function setSolde(?float $solde): Acompte
  843.     {
  844.         $this->solde $solde;
  845.         return $this;
  846.     }
  847.     public function getSolde(): ?float
  848.     {
  849.         return $this->solde;
  850.     }
  851.     public function setLettrage(?string $lettrage): Acompte
  852.     {
  853.         $this->lettrage $lettrage;
  854.         return $this;
  855.     }
  856.     public function getLettrage(): ?string
  857.     {
  858.         return $this->lettrage;
  859.     }
  860.     public function setNumeroLettrage(?float $numeroLettrage): Acompte
  861.     {
  862.         $this->numeroLettrage $numeroLettrage;
  863.         if($numeroLettrage == null) {
  864.             $this->setLettrage(null);
  865.         } else {
  866.             $lettres = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
  867.             $lettrage '';
  868.             $reste floatval($numeroLettrage);
  869.             $lettrage .= $reste ' ';
  870.             $premiereLettreKey $reste 26;
  871.             $lettrage .= $premiereLettreKey ' ';
  872.             $reste -= $premiereLettreKey;
  873.             $lettrage .= $reste ' ';
  874.             $deuxiemeLettreKey $reste % (26*26);
  875.             $lettrage .= $deuxiemeLettreKey ' ';
  876.             $reste -= $deuxiemeLettreKey;
  877.             $lettrage .= $reste ' ';
  878.             $deuxiemeLettreKey $deuxiemeLettreKey 26;
  879.             $lettrage .= $deuxiemeLettreKey ' ';
  880.             $troisiemeLettreKey $reste % (26*26*26);
  881.             $troisiemeLettreKey $troisiemeLettreKey / (26*26);
  882.             $premiereLettre $lettres[$premiereLettreKey];
  883.             $deuxiemeLettre $lettres[$deuxiemeLettreKey];
  884.             $troisiemeLettre $lettres[$troisiemeLettreKey];
  885.             $lettrage $troisiemeLettre.$deuxiemeLettre.$premiereLettre;
  886.             $this->setLettrage($lettrage);
  887.         }
  888.         return $this;
  889.     }
  890.     public function getNumeroLettrage(): ?float
  891.     {
  892.         return $this->numeroLettrage;
  893.     }
  894.     public function setIdImport(?string $idImport): Acompte
  895.     {
  896.         $this->idImport $idImport;
  897.         return $this;
  898.     }
  899.     public function getIdImport(): ?string
  900.     {
  901.         return $this->idImport;
  902.     }
  903.     public function setIdTransaction(?string $idTransaction): Acompte
  904.     {
  905.         $this->idTransaction $idTransaction;
  906.         return $this;
  907.     }
  908.     public function getIdTransaction(): ?string
  909.     {
  910.         return $this->idTransaction;
  911.     }
  912. }