src/Entity/CarSale.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CarSaleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=CarSaleRepository::class)
  10.  * @ORM\HasLifecycleCallbacks()
  11.  */
  12. class CarSale
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $price;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $origin;
  28.     /**
  29.      * @ORM\Column(type="datetime")
  30.      */
  31.     private $createdAt;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true)
  34.      */
  35.     private $updatedAt;
  36.     /**
  37.      * @ORM\Column(type="integer", nullable=true)
  38.      */
  39.     private $moneyAdvance;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=true)
  42.      */
  43.     private $cash;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      */
  47.     private $credit;
  48.     /**
  49.      * @ORM\Column(type="integer", nullable=true)
  50.      */
  51.     private $bankCheck;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $bankCheckDetail;
  56.     /**
  57.      * @ORM\Column(type="boolean")
  58.      */
  59.     private $isDone;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity=Car::class, inversedBy="carSaleId")
  62.      */
  63.     private $carSale;
  64.     /**
  65.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="CarSaleId")
  66.      */
  67.     private $user;
  68.     /**
  69.      * @ORM\ManyToOne(targetEntity=Car::class, inversedBy="carSalePaymentId")
  70.      */
  71.     private $carSalePayment;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="carSaleClientId")
  74.      */
  75.     private $client;
  76.     /**
  77.      * @ORM\Column(type="string", length=5)
  78.      */
  79.     private $currency;
  80.     /**
  81.      * @ORM\Column(type="datetime", nullable=true)
  82.      */
  83.     private $isDoneDate;
  84.     /**
  85.      * @ORM\Column(type="datetime", nullable=true)
  86.      */
  87.     private $signaledDate;
  88.     /**
  89.      * @ORM\Column(type="integer", nullable=true)
  90.      */
  91.     private $costsTransfer;
  92.     /**
  93.      * @ORM\Column(type="integer", nullable=true)
  94.      */
  95.     private $costsDelivery;
  96.     /**
  97.      * @ORM\Column(type="integer", nullable=true)
  98.      */
  99.     private $costsPledge;
  100.     /**
  101.      * @ORM\Column(type="integer", nullable=true)
  102.      */
  103.     private $costsBankSealing;
  104.     /**
  105.      * @ORM\Column(type="integer", nullable=true)
  106.      */
  107.     private $costsRents;
  108.     /**
  109.      * @ORM\Column(type="decimal", precision=10, scale=1, nullable=true)
  110.      */
  111.     private $exchangeRateUSD;
  112.     /**
  113.      * @ORM\Column(type="decimal", precision=10, scale=1, nullable=true)
  114.      */
  115.     private $exchangeRateEUR;
  116.     /**
  117.      * @ORM\Column(type="text", nullable=true)
  118.      */
  119.     private $description;
  120.     /**
  121.      * @ORM\Column(type="boolean", nullable=true)
  122.      */
  123.     private $isGroupSale;
  124.     /**
  125.      * @ORM\Column(type="simple_array", nullable=true)
  126.      */
  127.     private $groupSale = [];
  128.     /**
  129.      * @ORM\Column(type="string", length=5, nullable=true)
  130.      */
  131.     private $moneyAdvanceCurrency;
  132.     /**
  133.      * @ORM\Column(type="string", length=5, nullable=true)
  134.      */
  135.     private $cashCurrency;
  136.     /**
  137.      * @ORM\Column(type="boolean", nullable=true)
  138.      */
  139.     private $receiptGenerated;
  140.     /**
  141.      * @ORM\Column(type="string", length=255, nullable=true)
  142.      */
  143.     private $procedureLocation;
  144.     /**
  145.      * @ORM\Column(type="date", nullable=true)
  146.      */
  147.     private $procedureDate;
  148.     /**
  149.      * @ORM\Column(type="time", nullable=true)
  150.      */
  151.     private $procedureTime;
  152.     /**
  153.      * @ORM\Column(type="string", length=3)
  154.      */
  155.     private $procedureDays;
  156.     /**
  157.      * @ORM\OneToMany(targetEntity=CarSaleBankCheck::class, mappedBy="carSale", cascade={"persist"})
  158.      */
  159.     private $bankCheckId;
  160.     /**
  161.      * @ORM\OneToMany(targetEntity=CarSaleCarPayment::class, mappedBy="carSalePay", cascade={"persist", "remove"})
  162.      */
  163.     private $carPayment;
  164.     /**
  165.      * @ORM\Column(type="text", nullable=true)
  166.      */
  167.     private $balance;
  168.     /**
  169.      * @ORM\Column(type="text", nullable=true)
  170.      */
  171.     private $cashMultiple;
  172.     /**
  173.      * @ORM\Column(type="text", nullable=true)
  174.      */
  175.     private $moneyAdvanceMultiple;
  176.   
  177.       /**
  178.      * @ORM\Column(type="datetime", nullable=true)
  179.      */
  180.     private $fechaFacturacion;
  181.     public function __construct()
  182.     {
  183.         $this->bankCheckId = new ArrayCollection();
  184.         $this->carPayment = new ArrayCollection();
  185.     }
  186.     public function getId(): ?int
  187.     {
  188.         return $this->id;
  189.     }
  190.     public function getPrice(): ?int
  191.     {
  192.         return $this->price;
  193.     }
  194.     public function setPrice($price): self
  195.     {
  196.         $this->price str_replace('.'''$price);
  197.         return $this;
  198.     }
  199.     public function getOrigin(): ?string
  200.     {
  201.         return $this->origin;
  202.     }
  203.     public function setOrigin(string $origin): self
  204.     {
  205.         $this->origin $origin;
  206.         return $this;
  207.     }
  208.     public function getCreatedAt(): ?\DateTimeInterface
  209.     {
  210.         return $this->createdAt;
  211.     }
  212.     /**
  213.      * @ORM\PrePersist
  214.      */
  215.     public function setCreatedAt(): self
  216.     {
  217.         $this->createdAt = new \DateTime();
  218.         return $this;
  219.     }
  220.     public function getUpdatedAt(): ?\DateTimeInterface
  221.     {
  222.         return $this->updatedAt;
  223.     }
  224.     /**
  225.      * @ORM\PreUpdate
  226.      */
  227.     public function setUpdatedAt(): self
  228.     {
  229.         $this->updatedAt = new \DateTime();
  230.         return $this;
  231.     }
  232.     public function getMoneyAdvance(): ?int
  233.     {
  234.         return $this->moneyAdvance;
  235.     }
  236.     public function setMoneyAdvance($moneyAdvance): self
  237.     {
  238.         $this->moneyAdvance str_replace('.'''$moneyAdvance);
  239.         return $this;
  240.     }
  241.     public function getCash(): ?int
  242.     {
  243.         return $this->cash;
  244.     }
  245.     public function setCash($cash): self
  246.     {
  247.         $this->cash str_replace('.'''$cash);
  248.         return $this;
  249.     }
  250.     public function getCredit(): ?int
  251.     {
  252.         return $this->credit;
  253.     }
  254.     public function setCredit($credit): self
  255.     {
  256.         $this->credit str_replace('.'''$credit);
  257.         return $this;
  258.     }
  259.     public function getIsDone(): ?bool
  260.     {
  261.         return $this->isDone;
  262.     }
  263.     public function setIsDone(bool $isDone): self
  264.     {
  265.         $this->isDone $isDone;
  266.         return $this;
  267.     }
  268.     public function getCarSale(): ?Car
  269.     {
  270.         return $this->carSale;
  271.     }
  272.     public function setCarSale(?Car $carSale): self
  273.     {
  274.         $this->carSale $carSale;
  275.         return $this;
  276.     }
  277.     public function getUser(): ?User
  278.     {
  279.         return $this->user;
  280.     }
  281.     public function setUser(?User $user): self
  282.     {
  283.         $this->user $user;
  284.         return $this;
  285.     }
  286.     public function getCarSalePayment(): ?Car
  287.     {
  288.         return $this->carSalePayment;
  289.     }
  290.     public function setCarSalePayment(?Car $carSalePayment): self
  291.     {
  292.         $this->carSalePayment $carSalePayment;
  293.         return $this;
  294.     }
  295.     public function getClient(): ?Client
  296.     {
  297.         return $this->client;
  298.     }
  299.     public function setClient(?Client $client): self
  300.     {
  301.         $this->client $client;
  302.         return $this;
  303.     }
  304.     public function getCurrency(): ?string
  305.     {
  306.         return $this->currency;
  307.     }
  308.     public function setCurrency(string $currency): self
  309.     {
  310.         $this->currency $currency;
  311.         return $this;
  312.     }
  313.     public function getIsDoneDate(): ?\DateTimeInterface
  314.     {
  315.         return $this->isDoneDate;
  316.     }
  317.     public function setIsDoneDate(?\DateTimeInterface $isDoneDate): self
  318.     {
  319.         $this->isDoneDate $isDoneDate;
  320.         return $this;
  321.     }
  322.     public function getCostsTransfer(): ?int
  323.     {
  324.         return $this->costsTransfer;
  325.     }
  326.     public function setCostsTransfer($costsTransfer): self
  327.     {
  328.         $this->costsTransfer str_replace('.'''$costsTransfer);
  329.         return $this;
  330.     }
  331.     public function getCostsDelivery(): ?int
  332.     {
  333.         return $this->costsDelivery;
  334.     }
  335.     public function setCostsDelivery($costsDelivery): self
  336.     {
  337.         $this->costsDelivery str_replace('.'''$costsDelivery);
  338.         return $this;
  339.     }
  340.     public function getCostsPledge(): ?int
  341.     {
  342.         return $this->costsPledge;
  343.     }
  344.     public function setCostsPledge($costsPledge): self
  345.     {
  346.         $this->costsPledge str_replace('.'''$costsPledge);
  347.         return $this;
  348.     }
  349.     public function getCostsBankSealing(): ?int
  350.     {
  351.         return $this->costsBankSealing;
  352.     }
  353.     public function setCostsBankSealing($costsBankSealing): self
  354.     {
  355.         $this->costsBankSealing str_replace('.'''$costsBankSealing);
  356.         return $this;
  357.     }
  358.     public function getCostsRents(): ?int
  359.     {
  360.         return $this->costsRents;
  361.     }
  362.     public function setCostsRents($costsRents): self
  363.     {
  364.         $this->costsRents str_replace('.'''$costsRents);
  365.         return $this;
  366.     }
  367.     public function getExchangeRateUSD(): ?string
  368.     {
  369.         return $this->exchangeRateUSD;
  370.     }
  371.     public function setExchangeRateUSD($exchangeRateUSD): self
  372.     {
  373.         $tmp str_replace('.'''$exchangeRateUSD);
  374.         $tmp str_replace(',''.'$tmp);
  375.         $this->exchangeRateUSD $tmp;
  376.         return $this;
  377.     }
  378.     public function getExchangeRateEUR(): ?string
  379.     {
  380.         return $this->exchangeRateEUR;
  381.     }
  382.     public function setExchangeRateEUR($exchangeRateEUR): self
  383.     {
  384.         $tmp str_replace('.'''$exchangeRateEUR);
  385.         $tmp str_replace(',''.'$tmp);
  386.         $this->exchangeRateEUR $tmp;
  387.         return $this;
  388.     }
  389.     public function getDescription(): ?string
  390.     {
  391.         return $this->description;
  392.     }
  393.     public function setDescription(?string $description): self
  394.     {
  395.         $this->description $description;
  396.         return $this;
  397.     }
  398.     public function getSignaledDate(): ?\DateTimeInterface
  399.     {
  400.         return $this->signaledDate;
  401.     }
  402.     public function setSignaledDate(?\DateTimeInterface $signaledDate): self
  403.     {
  404.         $this->signaledDate $signaledDate;
  405.         return $this;
  406.     }
  407.     public function getIsGroupSale(): ?bool
  408.     {
  409.         return $this->isGroupSale;
  410.     }
  411.     public function setIsGroupSale(?bool $isGroupSale): self
  412.     {
  413.         $this->isGroupSale $isGroupSale;
  414.         return $this;
  415.     }
  416.     public function getBankCheck(): ?int
  417.     {
  418.         return $this->bankCheck;
  419.     }
  420.     public function setBankCheck($bankCheck): self
  421.     {
  422.         $this->bankCheck str_replace('.'''$bankCheck);
  423.         return $this;
  424.     }
  425.     public function getBankCheckDetail(): ?string
  426.     {
  427.         return $this->bankCheckDetail;
  428.     }
  429.     public function setBankCheckDetail(?string $bankCheckDetail): self
  430.     {
  431.         $this->bankCheckDetail $bankCheckDetail;
  432.         return $this;
  433.     }
  434.     public function getGroupSale(): ?array
  435.     {
  436.         return $this->groupSale;
  437.     }
  438.     public function setGroupSale(?array $groupSale): self
  439.     {
  440.         $this->groupSale $groupSale;
  441.         return $this;
  442.     }
  443.     public function getMoneyAdvanceCurrency(): ?string
  444.     {
  445.         return $this->moneyAdvanceCurrency;
  446.     }
  447.     public function setMoneyAdvanceCurrency(?string $moneyAdvanceCurrency): self
  448.     {
  449.         $this->moneyAdvanceCurrency $moneyAdvanceCurrency;
  450.         return $this;
  451.     }
  452.     public function getCashCurrency(): ?string
  453.     {
  454.         return $this->cashCurrency;
  455.     }
  456.     public function setCashCurrency(?string $cashCurrency): self
  457.     {
  458.         $this->cashCurrency $cashCurrency;
  459.         return $this;
  460.     }
  461.     public function getReceiptGenerated(): ?bool
  462.     {
  463.         return $this->receiptGenerated;
  464.     }
  465.     public function setReceiptGenerated(bool $receiptGenerated): self
  466.     {
  467.         $this->receiptGenerated $receiptGenerated;
  468.         return $this;
  469.     }
  470.     public function getProcedureLocation(): ?string
  471.     {
  472.         return $this->procedureLocation;
  473.     }
  474.     public function setProcedureLocation(string $procedureLocation): self
  475.     {
  476.         $this->procedureLocation $procedureLocation;
  477.         return $this;
  478.     }
  479.     public function getProcedureDate(): ?\DateTimeInterface
  480.     {
  481.         return $this->procedureDate;
  482.     }
  483.     public function setProcedureDate(\DateTimeInterface $procedureDate): self
  484.     {
  485.         $this->procedureDate $procedureDate;
  486.         return $this;
  487.     }
  488.     public function getProcedureTime(): ?\DateTimeInterface
  489.     {
  490.         return $this->procedureTime;
  491.     }
  492.     public function setProcedureTime(\DateTimeInterface $procedureTime): self
  493.     {
  494.         $this->procedureTime $procedureTime;
  495.         return $this;
  496.     }
  497.     public function getProcedureDays(): ?string
  498.     {
  499.         return $this->procedureDays;
  500.     }
  501.     public function setProcedureDays(string $procedureDays): self
  502.     {
  503.         $this->procedureDays $procedureDays;
  504.         return $this;
  505.     }
  506.     /**
  507.      * @return Collection<int, CarSaleBankCheck>
  508.      */
  509.     public function getBankCheckId(): Collection
  510.     {
  511.         return $this->bankCheckId;
  512.     }
  513.     public function addBankCheckId(CarSaleBankCheck $bankCheckId): self
  514.     {
  515.         if (!$this->bankCheckId->contains($bankCheckId)) {
  516.             $this->bankCheckId[] = $bankCheckId;
  517.             $bankCheckId->setCarSale($this);
  518.         }
  519.         return $this;
  520.     }
  521.     public function removeBankCheckId(CarSaleBankCheck $bankCheckId): self
  522.     {
  523.         if ($this->bankCheckId->removeElement($bankCheckId)) {
  524.             // set the owning side to null (unless already changed)
  525.             if ($bankCheckId->getCarSale() === $this) {
  526.                 $bankCheckId->setCarSale(null);
  527.             }
  528.         }
  529.         return $this;
  530.     }
  531.     /**
  532.      * @return Collection<int, CarSaleCarPayment>
  533.      */
  534.     public function getCarPayment(): Collection
  535.     {
  536.         return $this->carPayment;
  537.     }
  538.     public function addCarPayment(CarSaleCarPayment $carPayment): self
  539.     {
  540.         if (!$this->carPayment->contains($carPayment)) {
  541.             $this->carPayment[] = $carPayment;
  542.             $carPayment->setCarSalePay($this);
  543.         }
  544.         return $this;
  545.     }
  546.     public function removeCarPayment(CarSaleCarPayment $carPayment): self
  547.     {
  548.         if ($this->carPayment->removeElement($carPayment)) {
  549.             // set the owning side to null (unless already changed)
  550.             if ($carPayment->getCarSalePay() === $this) {
  551.                 $carPayment->setCarSalePay(null);
  552.             }
  553.         }
  554.         return $this;
  555.     }
  556.     public function getBalance(): ?string
  557.     {
  558.         return $this->balance;
  559.     }
  560.     public function setBalance(?string $balance): self
  561.     {
  562.         $this->balance $balance;
  563.         return $this;
  564.     }
  565.     public function getCashMultiple(): ?string
  566.     {
  567.         return $this->cashMultiple;
  568.     }
  569.     public function setCashMultiple(?string $cashMultiple): self
  570.     {
  571.         $this->cashMultiple $cashMultiple;
  572.         return $this;
  573.     }
  574.     public function getMoneyAdvanceMultiple(): ?string
  575.     {
  576.         return $this->moneyAdvanceMultiple;
  577.     }
  578.     public function setMoneyAdvanceMultiple(?string $moneyAdvanceMultiple): self
  579.     {
  580.         $this->moneyAdvanceMultiple $moneyAdvanceMultiple;
  581.         return $this;
  582.     }
  583.   
  584.       public function getFechaFacturacion(): ?\DateTimeInterface
  585.     {
  586.         return $this->fechaFacturacion;
  587.     }
  588.     public function setfechaFacturacion(?\DateTimeInterface $fechaFacturacion): self
  589.     {
  590.         $this->fechaFacturacion $fechaFacturacion;
  591.         return $this;
  592.     }
  593. }