src/Entity/Pedido.php line 17
- <?php
- namespace App\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Validator\Constraints as Assert;
- use App\Entity\Cupon;
- use JMS\Serializer\Annotation as JMS;
- /**
- * Pedido
- *
- * @ORM\Table(name="pedido")
- * @ORM\Entity
- */
- class Pedido
- {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer", nullable=false)
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="IDENTITY")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="divisaOrigen", type="string", length=255, nullable=false)
- */
- private $divisaOrigen;
- /**
- * @var string
- *
- * @ORM\Column(name="codigoPromo", type="string", length=255, nullable=false)
- */
- private $codigoPromo;
- /**
- * @ORM\ManyToOne(targetEntity="App\Entity\Cupon")
- * @ORM\JoinColumn(name="cupon", referencedColumnName="id", nullable=true)
- */
- private $cupon;
- /**
- * @Assert\Valid()
- * @ORM\OneToMany(targetEntity="Pedido", mappedBy="pedidos",cascade={"persist"})
- */
- private $pedidos;
- /**
- * @var string
- *
- * @ORM\Column(name="divisaFinal", type="string", length=255, nullable=false)
- */
- private $divisaFinal;
- /**
- * @var float
- *
- * @ORM\Column(name="cantidadOrigen", type="float", precision=10, scale=0, nullable=false)
- */
- private $cantidadOrigen;
- /**
- * @var float
- *
- * @ORM\Column(name="cantidadFinal", type="float", precision=10, scale=0, nullable=false)
- */
- private $cantidadFinal;
- /**
- * @var integer
- *
- * @ORM\Column(name="cliente", type="integer", nullable=false)
- */
- private $cliente;
- /**
- * @var string
- *
- * @ORM\Column(name="estado", type="string", length=255, nullable=false)
- */
- private $estado;
- /**
- * @var string
- *
- * @ORM\Column(name="tienda", type="string", length=255, nullable=false)
- */
- private $oficina;
- /**
- * @var string
- *
- * @ORM\Column(name="direccion", type="string", length=255, nullable=false)
- */
- private $direccion;
- /**
- * @var integer
- *
- * @ORM\Column(name="codigoPostal", type="integer", nullable=false)
- */
- private $codigoPostal;
- /**
- * @var string
- *
- * @ORM\Column(name="ciudad", type="string", length=255, nullable=false)
- */
- private $ciudad;
- /**
- * @ORM\ManyToOne(targetEntity="App\Entity\Provincia")
- * @ORM\JoinColumn(name="provincia", referencedColumnName="id", nullable=true)
- */
- private $provincia;
- /**
- * @var string
- *
- * @ORM\Column(name="pais", type="string", length=255, nullable=false)
- */
- private $pais;
- /**
- * @var string
- *
- * @ORM\Column(name="companiaTransporte", type="string", length=255, nullable=false)
- */
- private $companiaTransporte;
- /**
- * @var string
- *
- * @ORM\Column(name="tipoPago", type="string", length=255, nullable=false)
- */
- private $tipoPago;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="fechaCompra", type="datetime", nullable=false)
- */
- private $fechaCompra;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="fechaEntrega", type="date", nullable=false)
- */
- private $fechaEntrega;
- /**
- * @var \DateTime
- *
- * @ORM\Column(name="horaEntrega", type="date", nullable=false)
- */
- private $horaEntrega;
- /**
- * @var string
- *
- * @ORM\Column(name="comentario", type="string", length=255, nullable=false)
- */
- private $comentario;
- /**
- * @var integer
- *
- * @ORM\Column(name="carro", type="integer", nullable=true)
- */
- private $carro;
- private $reserva=0;
- private $erpCode;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set divisaOrigen
- *
- * @param string $divisaOrigen
- * @return Pedido
- */
- public function setDivisaOrigen($divisaOrigen)
- {
- $this->divisaOrigen = $divisaOrigen;
- return $this;
- }
- /**
- * Get divisaOrigen
- *
- * @return string
- */
- public function getDivisaOrigen()
- {
- return $this->divisaOrigen;
- }
- /**
- * Set divisaFinal
- *
- * @param string $divisaFinal
- * @return Pedido
- */
- public function setDivisaFinal($divisaFinal)
- {
- $this->divisaFinal = $divisaFinal;
- return $this;
- }
- /**
- * Get divisaFinal
- *
- * @return Divisa
- */
- public function getDivisaFinal()
- {
- return $this->divisaFinal;
- }
- /**
- * Set cantidadOrigen
- *
- * @param float $cantidadOrigen
- * @return Pedido
- */
- public function setCantidadOrigen($cantidadOrigen)
- {
- $this->cantidadOrigen = $cantidadOrigen;
- return $this;
- }
- /**
- * Get cantidad
- *
- * @return float
- */
- public function getCantidadOrigen()
- {
- return $this->cantidadOrigen;
- }
- /**
- * Set cupon
- *
- * @param string $cupon
- * @return Pedido
- */
- public function setCupon($cupon)
- {
- $this->cupon = $cupon;
- return $this;
- }
- /**
- * Get cupon
- *
- * @return Cupon
- */
- public function getCupon()
- {
- return $this->cupon;
- }
- /**
- * Set cantidadFinal
- *
- * @param float $cantidadFinal
- * @return Pedido
- */
- public function setCantidadFinal($cantidadFinal)
- {
- $this->cantidadFinal = $cantidadFinal;
- return $this;
- }
- /**
- * Get cantidadFinal
- *
- * @return float
- */
- public function getCantidadFinal()
- {
- return $this->cantidadFinal;
- }
- /**
- * Set codigoProm
- *
- * @param float $codigoProm
- * @return Pedido
- */
- public function setCodigoPromo($codigoProm)
- {
- $this->codigoPromo = $codigoProm;
- return $this;
- }
- /**
- * Get codigoProm
- *
- * @return float
- */
- public function getCodigoPromo()
- {
- return $this->codigoPromo;
- }
- /**
- * Set cliente
- *
- * @param integer $cliente
- * @return Pedido
- */
- public function setCliente($cliente)
- {
- $this->cliente = $cliente;
- return $this;
- }
- /**
- * Get cliente
- *
- * @return integer
- */
- public function getCliente()
- {
- return $this->cliente;
- }
- /**
- * Set oficina
- *
- * @param string $oficina
- * @return Pedido
- */
- public function setOficina($oficina)
- {
- $this->oficina = $oficina;
- return $this;
- }
- /**
- * Get oficina
- *
- * @return string
- */
- public function getOficina()
- {
- return $this->oficina;
- }
- /**
- * Set direccion
- *
- * @param string $direccion
- * @return Pedido
- */
- public function setDireccion($direccion)
- {
- $this->direccion = $direccion;
- return $this;
- }
- /**
- * Get direccion
- *
- * @return string
- */
- public function getDireccion()
- {
- return $this->direccion;
- }
- /**
- * Set codigoPostal
- *
- * @param integer $codigoPostal
- * @return Pedido
- */
- public function setCodigoPostal($codigoPostal)
- {
- $this->codigoPostal = $codigoPostal;
- return $this;
- }
- /**
- * Get codigoPostal
- *
- * @return integer
- */
- public function getCodigoPostal()
- {
- return $this->codigoPostal;
- }
- /**
- * Set ciudad
- *
- * @param string $ciudad
- * @return Pedido
- */
- public function setCiudad($ciudad)
- {
- $this->ciudad = $ciudad;
- return $this;
- }
- /**
- * Get ciudad
- *
- * @return string
- */
- public function getCiudad()
- {
- return $this->ciudad;
- }
- /**
- * Set erpCode
- *
- * @param string $erpCode
- * @return Pedido
- */
- public function setErpCode($erpCode)
- {
- $this->erpCode = $erpCode;
- return $this;
- }
- /**
- * Get erpCode
- *
- * @return string
- */
- public function getErpCode()
- {
- return $this->erpCode;
- }
- /**
- * Set provincia
- *
- * @param string $provincia
- * @return Pedido
- */
- public function setProvincia($provincia)
- {
- $this->provincia = $provincia;
- return $this;
- }
- /**
- * Get provincia
- *
- * @return string
- */
- public function getProvincia()
- {
- return $this->provincia;
- }
- /**
- * Set pais
- *
- * @param string $pais
- * @return Pedido
- */
- public function setPais($pais)
- {
- $this->pais = $pais;
- return $this;
- }
- /**
- * Get pais
- *
- * @return string
- */
- public function getPais()
- {
- return $this->pais;
- }
- /**
- * Set companiaTransporte
- *
- * @param string $companiaTransporte
- * @return Pedido
- */
- public function setCompaniaTransporte($companiaTransporte)
- {
- $this->companiaTransporte = $companiaTransporte;
- return $this;
- }
- /**
- * Get companiaTransporte
- *
- * @return string
- */
- public function getCompaniaTransporte()
- {
- return $this->companiaTransporte;
- }
- /**
- * Set tipoPago
- *
- * @param string $tipoPago
- * @return Pedido
- */
- public function setTipoPago($tipoPago)
- {
- $this->tipoPago = $tipoPago;
- return $this;
- }
- /**
- * Get tipoPago
- *
- * @return string
- */
- public function getTipoPago()
- {
- return $this->tipoPago;
- }
- /**
- * Set fechaCompra
- *
- * @param \DateTime $fechaCompra
- * @return Pedido
- */
- public function setFechaCompra($fechaCompra)
- {
- $this->fechaCompra = $fechaCompra;
- return $this;
- }
- /**
- * Get fechaCompra
- *
- * @return \DateTime
- */
- public function getFechaCompra()
- {
- return $this->fechaCompra;
- }
- /**
- * Set fechaEntrega
- *
- * @param \DateTime $fechaEntrega
- * @return Pedido
- */
- public function setFechaEntrega($fechaEntrega)
- {
- $this->fechaEntrega = $fechaEntrega;
- return $this;
- }
- /**
- * Get fechaEntrega
- *
- * @return \DateTime
- */
- public function getFechaEntrega()
- {
- return $this->fechaEntrega;
- }
- /**
- * Set horaEntrega
- *
- * @param \DateTime $horaEntrega
- * @return Pedido
- */
- public function setHoraEntrega($horaEntrega)
- {
- $this->horaEntrega = $horaEntrega;
- return $this;
- }
- /**
- * Get comentario
- *
- * @return \DateTime
- */
- public function getComentario()
- {
- return $this->comentario;
- }
- /**
- * Set comentario
- *
- * @param \DateTime $comentario
- * @return Pedido
- */
- public function setComentario($comentario)
- {
- $this->comentario = $comentario;
- return $this;
- }
- /**
- * Get horaEntrega
- *
- * @return \DateTime
- */
- public function getHoraEntrega()
- {
- return $this->horaEntrega;
- }
- public function getShortName(){
- return "walapop";
- }
- public function getNombreIngles(){
- return "trololo";
- }
- public function getReserva(){
- return $this->reserva;
- }
- public function setReserva($reserva){
- $this->reserva=$reserva;
- return $this;
- }
- /**
- * @Assert\IsTrue(message = "cart.sameCurrency")
- */
- public function isDivisaOrigenLegal(){
- if($this->divisaOrigen==$this->divisaFinal){
- return false;
- }
- else return true;
- }
- /**
- * @Assert\IsTrue(message = "cart.notEuro")
- */
- public function isDivisaOrigen2Legal(){
- if($this->divisaOrigen==null) return true;
- if(!$this->divisaOrigen->getMaestro() && !$this->divisaFinal->getMaestro()){
- return false;
- }
- else return true;
- }
- }