src/Entity/Cabecera.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CabeceraRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. use App\Validator as BcAssert;
  10. /**
  11.  * @ORM\Entity(repositoryClass=CabeceraRepository::class)
  12.  * @ORM\HasLifecycleCallbacks()
  13.  * @BcAssert\BcGreaterThanOrEqual
  14.  */
  15. class Cabecera
  16. {
  17.     public const PAY_METHOD = array(
  18.         'EFECTIVO' => 1,
  19.         // 'TARJETAS BIGPASS' => 10,
  20.         // 'TARJETA LA FRAGATA' => 11,
  21.         // 'VALE SODEXO' => 12,
  22.         // 'VALE BIGPASS' => 13,
  23.         // 'CREDITO CLIENTES' => 14,
  24.         // 'CORTESIAS' => 15,
  25.         // 'INVITACIONES' => 16,
  26.         // 'MENU EMPLEADO' => 17,
  27.         // 'CAPACITACIONES' => 18,
  28.         // 'GASTOS REPRESENTACION' => 19,
  29.         'TARJETAS' => 2,
  30.         'BONOS CREPES' => 20,
  31.         // 'CUPON ARKADIA' => 21,
  32.         // 'LINK PAGOS E-COMMERCE' => 22,
  33.         // 'RTE FUENTE' => 23,
  34.         // 'I FOOD' => 24,
  35.         // 'ECOMMERCE  PREPAGADA' => 25,
  36.         // 'ECOMMERCE CONTRAENTREGA' => 26,
  37.         // 'ONLINE RAPPI' => 3,
  38.         // 'ONLINE UBER' => 4,
  39.         // 'ONLINE DOMI.COM' => 5,
  40.         'LINK DE PAGOS WOMPI' => 6,
  41.         // 'TARJETA TUYA' => 7,
  42.         // 'TARJETA FALABELLA' => 8,
  43.         // 'TARJETAS SODEXO' => 9,
  44.         'CALL CENTER PREPAGADA' => 30
  45.     );
  46.     public const SERVICE_TYPE = array(
  47.         'DOMICILIO' => 4,
  48.         'RECOGER' => 16,
  49.         'PROGRAMAR' => 100,
  50.     );
  51.     use Timestamp;
  52.     /**
  53.      * @ORM\Id
  54.      * @ORM\GeneratedValue
  55.      * @ORM\Column(type="integer")
  56.      */
  57.     private $id;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true)
  60.      */
  61.     private $nombrecliente;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true)
  64.      */
  65.     private $nombres;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $apellidos;
  70.     /**
  71.      * @ORM\Column(type="string", length=8, nullable=true)
  72.      */
  73.     private $codpostalcliente;
  74.     /**
  75.      * @ORM\Column(type="string", length=255)
  76.      */
  77.     private $direccioncliente;
  78.     /**
  79.      * @ORM\Column(type="string", length=100, nullable=true)
  80.      */
  81.     private $poblacioncliente;
  82.     /**
  83.      * @ORM\Column(type="string", length=100, nullable=true)
  84.      */
  85.     private $provinciacliente;
  86.     /**
  87.      * @ORM\Column(type="string", length=100, nullable=true)
  88.      */
  89.     private $paiscliente;
  90.     /**
  91.      * @ORM\Column(type="string", length=15)
  92.      */
  93.     private $telefonocliente;
  94.     /**
  95.      * @ORM\Column(type="string", length=15, nullable=true)
  96.      */
  97.     private $telefono2cliente;
  98.     /**
  99.      * @ORM\Column(type="string", length=15, nullable=true)
  100.      */
  101.     private $movilcliente;
  102.     /**
  103.      * @ORM\Column(type="string", length=255, nullable=true)
  104.      */
  105.     private $emailcliente;
  106.     /**
  107.      * @ORM\Column(type="integer", nullable=true, nullable=true)
  108.      */
  109.     private $codmonedaminuta;
  110.     /**
  111.      * @ORM\Column(type="string", length=20, nullable=true)
  112.      */
  113.     private $nifcliente;
  114.     /**
  115.      * @ORM\Column(type="string", length=2, nullable=true)
  116.      */
  117.     private $zona;
  118.     /**
  119.      * @ORM\Column(type="datetime", nullable=true)
  120.      */
  121.     private $fechareserva;
  122.     /**
  123.      * @ORM\Column(type="integer", nullable=true)
  124.      */
  125.     private $codcliente;
  126.     /**
  127.      * @ORM\Column(type="string", length=255, nullable=true)
  128.      */
  129.     private $direccion2cliente;
  130.     /**
  131.      * @ORM\OneToMany(targetEntity=Lineas::class, mappedBy="cabecera", cascade={"persist", "remove"})
  132.      * @ORM\OrderBy({"root" = "ASC","lft" = "ASC"})
  133.      */
  134.     private $lineas;
  135.     /**
  136.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="cabeceras")
  137.      */
  138.     private $user;
  139.     /**
  140.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  141.      */
  142.     private $total;
  143.     /**
  144.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  145.      */
  146.     private $totalsiniva;
  147.     /**
  148.      * @ORM\Column(type="string", length=20, nullable=true)
  149.      */
  150.     private $sucursal;
  151.     /**
  152.      * @ORM\Column(type="text", nullable=true)
  153.      */
  154.     private $comentario;
  155.     /**
  156.      * @ORM\Column(type="boolean", nullable=true)
  157.      */
  158.     private $isFinalizada;
  159.     /**
  160.      * @ORM\Column(type="string", length=20, nullable=true)
  161.      */
  162.     private $metododepago;
  163.     /**
  164.      * @ORM\Column(type="integer")
  165.      */
  166.     private $Tipodeservicio 4;
  167.     /**
  168.      * @ORM\Column(type="boolean", nullable=true)
  169.      */
  170.     private $is_enviado false;
  171.     /**
  172.      * @ORM\Column(type="string", length=255, nullable=true)
  173.      */
  174.     private $filename;
  175.     /**
  176.      * @ORM\OneToMany(targetEntity=CabeceraStatus::class, mappedBy="Cabecera")
  177.      */
  178.     private $CabeceraStatus;
  179.     /**
  180.      * @ORM\Column(type="string", length=255)
  181.      */
  182.     private $estado;
  183.     /**
  184.      * @ORM\OneToMany(targetEntity=Domicilios::class, mappedBy="cabecera", cascade={"remove"}, fetch="LAZY")
  185.      */
  186.     private $domicilios;
  187.     /**
  188.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  189.      */
  190.     private $propinatotal;
  191.     /**
  192.      * @ORM\Column(type="decimal", precision=10, scale=0, nullable=true)
  193.      */
  194.     private $propinaporcentaje;
  195.     /**
  196.      * @ORM\Column(type="text", nullable=true)
  197.      */
  198.     private $linkdepago;
  199.     /**
  200.      * @ORM\OneToMany(targetEntity=CabeceraLinkdepago::class, mappedBy="Cabecera", cascade={"persist", "remove"})
  201.      */
  202.     private $CabeceraLinkdepago;
  203.     /**
  204.      * @ORM\Column(type="boolean", nullable=true)
  205.      */
  206.     private $facturaelectronica false;
  207.     // nuevos campos de clientescamposlibres
  208.     /**
  209.      * @var string|null
  210.      *
  211.      * @ORM\Column(name="DIRECCION_2", type="string", length=50, nullable=true, options={"default"="NULL"})
  212.      */
  213.     private $direccion_2 'NULL';
  214.     /**
  215.      * @var string|null
  216.      *
  217.      * @ORM\Column(name="NOMBRE_1", type="string", length=50, nullable=true, options={"default"="NULL"})
  218.      */
  219.     private $nombre_1 'NULL';
  220.     /**
  221.      * @var string|null
  222.      *
  223.      * @ORM\Column(name="OTROS_NOMBRES", type="string", length=50, nullable=true, options={"default"="NULL"})
  224.      */
  225.     private $otros_nombres 'NULL';
  226.     /**
  227.      * @var string|null
  228.      *
  229.      * @ORM\Column(name="APELLIDO_1", type="string", length=50, nullable=true, options={"default"="NULL"})
  230.      */
  231.     private $apellido_1 'NULL';
  232.     /**
  233.      * @var string|null
  234.      *
  235.      * @ORM\Column(name="APELLIDO_2", type="string", length=50, nullable=true, options={"default"="NULL"})
  236.      */
  237.     private $apellido_2 'NULL';
  238.     /**
  239.      * @var string|null
  240.      *
  241.      * @ORM\Column(name="FE_MUNICIPIO", type="string", length=10, nullable=true, options={"default"="NULL"})
  242.      */
  243.     private $fe_municipio 'NULL';
  244.     /**
  245.      * @var string|null
  246.      *
  247.      * @ORM\Column(name="FE_RESPONSABILIDADES", type="string", length=255, nullable=true, options={"default"="NULL"})
  248.      */
  249.     private $fe_responsabilidades 'NULL';
  250.     /**
  251.      * @var string|null
  252.      *
  253.      * @ORM\Column(name="TIPO_DE_DOCUMENTO", type="string", length=100, nullable=true, options={"default"="NULL"})
  254.      */
  255.     private $tipo_de_documento 'NULL';
  256.     /**
  257.      * @var string|null
  258.      *
  259.      * @ORM\Column(name="TIPOPERSONA", type="string", length=50, nullable=true, options={"default"="NULL"})
  260.      */
  261.     private $tipopersona 'NULL';
  262.     /**
  263.      * @var string|null
  264.      *
  265.      * @ORM\Column(name="FE_REGIMEN", type="string", length=50, nullable=true, options={"default"="NULL"})
  266.      */
  267.     private $fe_regimen 'NULL';
  268.     /**
  269.      * @var string|null
  270.      *
  271.      * @ORM\Column(name="FE_DET_TRIBUTARIO", type="string", length=100, nullable=true, options={"default"="NULL"})
  272.      */
  273.     private $fe_det_tributario 'NULL';
  274.     /**
  275.      * @var string|null
  276.      *
  277.      * @ORM\Column(name="CUENTA_ALIMENTACION", type="string", length=50, nullable=true, options={"default"="NULL"})
  278.      */
  279.     private $cuenta_alimentacion 'NULL';
  280.     /**
  281.      * @var string|null
  282.      *
  283.      * @ORM\Column(name="CENTRO_COSTOS", type="string", length=50, nullable=true, options={"default"="NULL"})
  284.      */
  285.     private $centro_costos 'NULL';
  286.     /**
  287.      * @var string|null
  288.      *
  289.      * @ORM\Column(name="CENTRO_OPERACION", type="string", length=50, nullable=true, options={"default"="NULL"})
  290.      */
  291.     private $centro_operacion 'NULL';
  292.     /**
  293.      * @var string|null
  294.      *
  295.      * @ORM\Column(type="integer", nullable=true)
  296.      */
  297.     private $alias 0;
  298.     /**
  299.      * @ORM\Column(type="string", length=255, nullable=true)
  300.      */
  301.     private $email_linkdepago;
  302.     /**
  303.      * @ORM\Column(type="string", length=255, nullable=true)
  304.      */
  305.     private $nombre_receptor;
  306.     /**
  307.      * @ORM\Column(type="string", length=255, nullable=true)
  308.      */
  309.     private $telefono_receptor;
  310.     /**
  311.      * @ORM\Column(type="text", nullable=true)
  312.      */
  313.     private $observaciones_receptor;
  314.     public function __construct()
  315.     {
  316.         $this->lineas = new ArrayCollection();
  317.         $this->CabeceraStatus = new ArrayCollection();
  318.         // $this->domicilios = new ArrayCollection();
  319.         $this->CabeceraLinkdepago = new ArrayCollection();
  320.     }
  321.     public function getId(): ?int
  322.     {
  323.         return $this->id;
  324.     }
  325.     public function getNombrecliente(): ?string
  326.     {
  327.         return $this->nombrecliente;
  328.     }
  329.     // public function setNombrecliente(string $nombrecliente): self
  330.     public function setNombrecliente(): self
  331.     {
  332.         // $this->nombrecliente = $nombrecliente;
  333.         // return $this;
  334.         $nombreCompleto $this->nombres;
  335.         if ($this->apellidos) {
  336.             $nombreCompleto .= ' ' $this->apellidos;
  337.         }
  338.         $this->nombrecliente $nombreCompleto;
  339.         return $this;
  340.     }
  341.     public function getNombres(): ?string
  342.     {
  343.         return $this->nombres;
  344.     }
  345.     public function setNombres(string $nombres): self
  346.     {
  347.         $this->nombres $nombres;
  348.         $this->setNombrecliente();
  349.         return $this;
  350.     }
  351.     public function getApellidos(): ?string
  352.     {
  353.         return $this->apellidos;
  354.     }
  355.     public function setApellidos(?string $apellidos): self
  356.     {
  357.         $this->apellidos $apellidos;
  358.         $this->setNombrecliente();
  359.         return $this;
  360.     }
  361.     public function getCodpostalcliente(): ?string
  362.     {
  363.         return $this->codpostalcliente;
  364.     }
  365.     public function setCodpostalcliente(?string $codpostalcliente): self
  366.     {
  367.         $this->codpostalcliente $codpostalcliente;
  368.         return $this;
  369.     }
  370.     public function getDireccioncliente(): ?string
  371.     {
  372.         return $this->direccioncliente;
  373.     }
  374.     public function setDireccioncliente(string $direccioncliente): self
  375.     {
  376.         $this->direccioncliente $direccioncliente;
  377.         return $this;
  378.     }
  379.     public function getPoblacioncliente(): ?string
  380.     {
  381.         return $this->poblacioncliente;
  382.     }
  383.     public function setPoblacioncliente(string $poblacioncliente): self
  384.     {
  385.         $this->poblacioncliente $poblacioncliente;
  386.         return $this;
  387.     }
  388.     public function getProvinciacliente(): ?string
  389.     {
  390.         return $this->provinciacliente;
  391.     }
  392.     public function setProvinciacliente(string $provinciacliente): self
  393.     {
  394.         $this->provinciacliente $provinciacliente;
  395.         return $this;
  396.     }
  397.     public function getPaiscliente(): ?string
  398.     {
  399.         return $this->paiscliente;
  400.     }
  401.     public function setPaiscliente(string $paiscliente): self
  402.     {
  403.         $this->paiscliente $paiscliente;
  404.         return $this;
  405.     }
  406.     public function getTelefonocliente(): ?string
  407.     {
  408.         return $this->telefonocliente;
  409.     }
  410.     public function setTelefonocliente(string $telefonocliente): self
  411.     {
  412.         $this->telefonocliente $telefonocliente;
  413.         return $this;
  414.     }
  415.     public function getTelefono2cliente(): ?string
  416.     {
  417.         return $this->telefono2cliente;
  418.     }
  419.     public function setTelefono2cliente(?string $telefono2cliente): self
  420.     {
  421.         $this->telefono2cliente $telefono2cliente;
  422.         return $this;
  423.     }
  424.     public function getMovilcliente(): ?string
  425.     {
  426.         return $this->movilcliente;
  427.     }
  428.     public function setMovilcliente(?string $movilcliente): self
  429.     {
  430.         $this->movilcliente $movilcliente;
  431.         return $this;
  432.     }
  433.     public function getEmailcliente(): ?string
  434.     {
  435.         return $this->emailcliente;
  436.     }
  437.     public function setEmailcliente(?string $emailcliente): self
  438.     {
  439.         $this->emailcliente $emailcliente;
  440.         return $this;
  441.     }
  442.     public function getCodmonedaminuta(): ?int
  443.     {
  444.         return $this->codmonedaminuta;
  445.     }
  446.     public function setCodmonedaminuta(?int $codmonedaminuta): self
  447.     {
  448.         $this->codmonedaminuta $codmonedaminuta;
  449.         return $this;
  450.     }
  451.     public function getNifcliente(): ?string
  452.     {
  453.         return $this->nifcliente;
  454.     }
  455.     public function setNifcliente(?string $nifcliente): self
  456.     {
  457.         $this->nifcliente $nifcliente;
  458.         return $this;
  459.     }
  460.     // /**
  461.     //  * @ORM\PrePersist
  462.     //  */
  463.     // public function setNifclienteValue(): void
  464.     // {
  465.     //     if ($this->nifcliente == '') {
  466.     //         $datetime = new \DateTime('now');
  467.     //         // $this->nifcliente = 'BC' . $datetime->format('ymdGisv');
  468.     //         $dayOfYear = sprintf('%03d', $datetime->format('z'));
  469.     //         $miliseconds = sprintf('%03d', $datetime->format('v'));
  470.     //         $this->nifcliente = 'BC' . $datetime->format('y') . $dayOfYear . $datetime->format('His') . $miliseconds;
  471.     //     }
  472.     // }
  473.     public function getZona(): ?string
  474.     {
  475.         return $this->zona;
  476.     }
  477.     public function setZona(?string $zona): self
  478.     {
  479.         $this->zona $zona;
  480.         return $this;
  481.     }
  482.     public function getFechareserva(): ?\DateTimeInterface
  483.     {
  484.         return $this->fechareserva;
  485.     }
  486.     public function setFechareserva(?\DateTimeInterface $fechareserva): self
  487.     {
  488.         $this->fechareserva $fechareserva;
  489.         return $this;
  490.     }
  491.     public function getCodcliente(): ?int
  492.     {
  493.         return $this->codcliente;
  494.     }
  495.     public function setCodcliente(?int $codcliente): self
  496.     {
  497.         $this->codcliente $codcliente;
  498.         return $this;
  499.     }
  500.     public function getDireccion2cliente(): ?string
  501.     {
  502.         return $this->direccion2cliente;
  503.     }
  504.     public function setDireccion2cliente(?string $direccion2cliente): self
  505.     {
  506.         $this->direccion2cliente $direccion2cliente;
  507.         return $this;
  508.     }
  509.     /**
  510.      * @return Collection|Lineas[]
  511.      */
  512.     public function getLineas(): Collection
  513.     {
  514.         return $this->lineas;
  515.     }
  516.     public function addLinea(Lineas $linea): self
  517.     {
  518.         if (!$this->lineas->contains($linea)) {
  519.             $this->lineas[] = $linea;
  520.             $linea->setCabecera($this);
  521.         }
  522.         return $this;
  523.     }
  524.     public function removeLinea(Lineas $linea): self
  525.     {
  526.         if ($this->lineas->removeElement($linea)) {
  527.             // set the owning side to null (unless already changed)
  528.             if ($linea->getCabecera() === $this) {
  529.                 $linea->setCabecera(null);
  530.             }
  531.         }
  532.         return $this;
  533.     }
  534.     public function getUser(): ?user
  535.     {
  536.         return $this->user;
  537.     }
  538.     public function setUser(?user $user): self
  539.     {
  540.         $this->user $user;
  541.         return $this;
  542.     }
  543.     public function getTotal(): ?string
  544.     {
  545.         return $this->total;
  546.     }
  547.     public function setTotal(?string $total): self
  548.     {
  549.         $this->total $total;
  550.         return $this;
  551.     }
  552.     public function getTotalsiniva(): ?string
  553.     {
  554.         return $this->totalsiniva;
  555.     }
  556.     public function setTotalsiniva(?string $totalsiniva): self
  557.     {
  558.         $this->totalsiniva $totalsiniva;
  559.         return $this;
  560.     }
  561.     public function getSucursal(): ?string
  562.     {
  563.         return $this->sucursal;
  564.     }
  565.     public function setSucursal(?string $sucursal): self
  566.     {
  567.         $this->sucursal $sucursal;
  568.         return $this;
  569.     }
  570.     public function getComentario(): ?string
  571.     {
  572.         return $this->comentario;
  573.     }
  574.     public function setComentario(?string $comentario): self
  575.     {
  576.         $this->comentario $comentario;
  577.         return $this;
  578.     }
  579.     public function getIsFinalizada(): ?bool
  580.     {
  581.         return $this->isFinalizada;
  582.     }
  583.     public function setIsFinalizada(?bool $isFinalizada): self
  584.     {
  585.         $this->isFinalizada $isFinalizada;
  586.         return $this;
  587.     }
  588.     public function getMetododepago(): ?string
  589.     {
  590.         return $this->metododepago;
  591.     }
  592.     public function setMetododepago(?string $metododepago): self
  593.     {
  594.         $this->metododepago $metododepago;
  595.         return $this;
  596.     }
  597.     public function getTipodeservicio(): ?int
  598.     {
  599.         return $this->Tipodeservicio;
  600.     }
  601.     public function setTipodeservicio(int $Tipodeservicio): self
  602.     {
  603.         $this->Tipodeservicio $Tipodeservicio;
  604.         return $this;
  605.     }
  606.     public function getIsEnviado(): ?bool
  607.     {
  608.         return $this->is_enviado;
  609.     }
  610.     public function setIsEnviado(?bool $is_enviado): self
  611.     {
  612.         $this->is_enviado $is_enviado;
  613.         return $this;
  614.     }
  615.     public function getFilename(): ?string
  616.     {
  617.         return $this->filename;
  618.     }
  619.     public function setFilename(?string $filename): self
  620.     {
  621.         $this->filename $filename;
  622.         return $this;
  623.     }
  624.     /**
  625.      * @return Collection|CabeceraStatus[]
  626.      */
  627.     public function getCabeceraStatus(): Collection
  628.     {
  629.         return $this->CabeceraStatus;
  630.     }
  631.     public function addCabeceraStatus(CabeceraStatus $cabeceraStatus): self
  632.     {
  633.         if (!$this->CabeceraStatus->contains($cabeceraStatus)) {
  634.             $this->CabeceraStatus[] = $cabeceraStatus;
  635.             $cabeceraStatus->setCabecera($this);
  636.         }
  637.         return $this;
  638.     }
  639.     public function removeCabeceraStatus(CabeceraStatus $cabeceraStatus): self
  640.     {
  641.         if ($this->CabeceraStatus->removeElement($cabeceraStatus)) {
  642.             // set the owning side to null (unless already changed)
  643.             if ($cabeceraStatus->getCabecera() === $this) {
  644.                 $cabeceraStatus->setCabecera(null);
  645.             }
  646.         }
  647.         return $this;
  648.     }
  649.     public function getEstado(): ?string
  650.     {
  651.         return $this->estado;
  652.     }
  653.     public function setEstado(string $estado): self
  654.     {
  655.         $this->estado $estado;
  656.         return $this;
  657.     }
  658.     public function getDomicilios(): ?Domicilios
  659.     {
  660.         return $this->domicilios;
  661.     }
  662.     public function setDomicilios(Domicilios $domicilios): self
  663.     {
  664.         // set the owning side of the relation if necessary
  665.         if ($domicilios->getCabecera() !== $this) {
  666.             $domicilios->setCabecera($this);
  667.         }
  668.         $this->domicilios $domicilios;
  669.         return $this;
  670.     }
  671.     public function getPropinatotal(): ?string
  672.     {
  673.         return $this->propinatotal;
  674.     }
  675.     public function setPropinatotal(?string $propinatotal): self
  676.     {
  677.         $this->propinatotal $propinatotal;
  678.         return $this;
  679.     }
  680.     public function getPropinaporcentaje(): ?string
  681.     {
  682.         return $this->propinaporcentaje;
  683.     }
  684.     public function setPropinaporcentaje(?string $propinaporcentaje): self
  685.     {
  686.         $this->propinaporcentaje $propinaporcentaje;
  687.         return $this;
  688.     }
  689.     public function getLinkdepago(): ?string
  690.     {
  691.         return $this->linkdepago;
  692.     }
  693.     public function setLinkdepago(?string $linkdepago): self
  694.     {
  695.         $this->linkdepago $linkdepago;
  696.         return $this;
  697.     }
  698.     public function getFacturaelectronica(): ?bool
  699.     {
  700.         return $this->facturaelectronica;
  701.     }
  702.     public function setFacturaelectronica(?bool $facturaelectronica): self
  703.     {
  704.         $this->facturaelectronica $facturaelectronica;
  705.         return $this;
  706.     }
  707.     public function __toString(): string
  708.     {
  709.         return '(#' $this->getid() . ') ' $this->getDireccioncliente() . ' - ' $this->getNombrecliente();
  710.     }
  711.     public function isIsFinalizada(): ?bool
  712.     {
  713.         return $this->isFinalizada;
  714.     }
  715.     public function isIsEnviado(): ?bool
  716.     {
  717.         return $this->is_enviado;
  718.     }
  719.     public function isFacturaelectronica(): ?bool
  720.     {
  721.         return $this->facturaelectronica;
  722.     }
  723.     public function getDireccion2(): ?string
  724.     {
  725.         return $this->direccion_2;
  726.     }
  727.     public function setDireccion2(?string $direccion_2): static
  728.     {
  729.         $this->direccion_2 $direccion_2;
  730.         return $this;
  731.     }
  732.     public function getNombre1(): ?string
  733.     {
  734.         return $this->nombre_1;
  735.     }
  736.     public function setNombre1(?string $nombre_1): static
  737.     {
  738.         $this->nombre_1 $nombre_1;
  739.         return $this;
  740.     }
  741.     public function getOtrosNombres(): ?string
  742.     {
  743.         return $this->otros_nombres;
  744.     }
  745.     public function setOtrosNombres(?string $otros_nombres): static
  746.     {
  747.         $this->otros_nombres $otros_nombres;
  748.         return $this;
  749.     }
  750.     public function getApellido1(): ?string
  751.     {
  752.         return $this->apellido_1;
  753.     }
  754.     public function setApellido1(?string $apellido_1): static
  755.     {
  756.         $this->apellido_1 $apellido_1;
  757.         return $this;
  758.     }
  759.     public function getApellido2(): ?string
  760.     {
  761.         return $this->apellido_2;
  762.     }
  763.     public function setApellido2(?string $apellido_2): static
  764.     {
  765.         $this->apellido_2 $apellido_2;
  766.         return $this;
  767.     }
  768.     public function getFeMunicipio(): ?string
  769.     {
  770.         return $this->fe_municipio;
  771.     }
  772.     public function setFeMunicipio(?string $fe_municipio): static
  773.     {
  774.         $this->fe_municipio $fe_municipio;
  775.         return $this;
  776.     }
  777.     public function getFeResponsabilidades(): ?string
  778.     {
  779.         return $this->fe_responsabilidades;
  780.     }
  781.     public function setFeResponsabilidades(?string $fe_responsabilidades): static
  782.     {
  783.         $this->fe_responsabilidades $fe_responsabilidades;
  784.         return $this;
  785.     }
  786.     public function getTipoDeDocumento(): ?string
  787.     {
  788.         return $this->tipo_de_documento;
  789.     }
  790.     public function setTipoDeDocumento(?string $tipo_de_documento): static
  791.     {
  792.         $this->tipo_de_documento $tipo_de_documento;
  793.         return $this;
  794.     }
  795.     public function getTipopersona(): ?string
  796.     {
  797.         return $this->tipopersona;
  798.     }
  799.     public function setTipopersona(?string $tipopersona): static
  800.     {
  801.         $this->tipopersona $tipopersona;
  802.         return $this;
  803.     }
  804.     public function getFeRegimen(): ?string
  805.     {
  806.         return $this->fe_regimen;
  807.     }
  808.     public function setFeRegimen(?string $fe_regimen): static
  809.     {
  810.         $this->fe_regimen $fe_regimen;
  811.         return $this;
  812.     }
  813.     public function getFeDetTributario(): ?string
  814.     {
  815.         return $this->fe_det_tributario;
  816.     }
  817.     public function setFeDetTributario(?string $fe_det_tributario): static
  818.     {
  819.         $this->fe_det_tributario $fe_det_tributario;
  820.         return $this;
  821.     }
  822.     public function getCuentaAlimentacion(): ?string
  823.     {
  824.         return $this->cuenta_alimentacion;
  825.     }
  826.     public function setCuentaAlimentacion(?string $cuenta_alimentacion): static
  827.     {
  828.         $this->cuenta_alimentacion $cuenta_alimentacion;
  829.         return $this;
  830.     }
  831.     public function getCentroCostos(): ?string
  832.     {
  833.         return $this->centro_costos;
  834.     }
  835.     public function setCentroCostos(?string $centro_costos): static
  836.     {
  837.         $this->centro_costos $centro_costos;
  838.         return $this;
  839.     }
  840.     public function getCentroOperacion(): ?string
  841.     {
  842.         return $this->centro_operacion;
  843.     }
  844.     public function setCentroOperacion(?string $centro_operacion): static
  845.     {
  846.         $this->centro_operacion $centro_operacion;
  847.         return $this;
  848.     }
  849.     public function getAlias(): ?string
  850.     {
  851.         return $this->alias;
  852.     }
  853.     public function setAlias(?string $alias): static
  854.     {
  855.         $this->alias $alias;
  856.         return $this;
  857.     }
  858.     public function getEmailLinkdepago(): ?string
  859.     {
  860.         return $this->email_linkdepago;
  861.     }
  862.     public function setEmailLinkdepago(?string $email_linkdepago): self
  863.     {
  864.         $this->email_linkdepago $email_linkdepago;
  865.         return $this;
  866.     }
  867.     // public function addDomicilio(Domicilios $domicilio): static
  868.     // {
  869.     //     if (!$this->domicilios->contains($domicilio)) {
  870.     //         $this->domicilios->add($domicilio);
  871.     //         $domicilio->setCabecera($this);
  872.     //     }
  873.     //     return $this;
  874.     // }
  875.     // public function removeDomicilio(Domicilios $domicilio): static
  876.     // {
  877.     //     if ($this->domicilios->removeElement($domicilio)) {
  878.     //         // set the owning side to null (unless already changed)
  879.     //         if ($domicilio->getCabecera() === $this) {
  880.     //             $domicilio->setCabecera(null);
  881.     //         }
  882.     //     }
  883.     //     return $this;
  884.     // }
  885.     /**
  886.      * @return Collection<int, CabeceraLinkdepago>
  887.      */
  888.     public function getCabeceraLinkdepago(): Collection
  889.     {
  890.         return $this->CabeceraLinkdepago;
  891.     }
  892.     public function addCabeceraLinkdepago(CabeceraLinkdepago $cabeceraLinkdepago): static
  893.     {
  894.         if (!$this->CabeceraLinkdepago->contains($cabeceraLinkdepago)) {
  895.             $this->CabeceraLinkdepago->add($cabeceraLinkdepago);
  896.             $cabeceraLinkdepago->setCabecera($this);
  897.         }
  898.         return $this;
  899.     }
  900.     public function removeCabeceraLinkdepago(CabeceraLinkdepago $cabeceraLinkdepago): static
  901.     {
  902.         if ($this->CabeceraLinkdepago->removeElement($cabeceraLinkdepago)) {
  903.             // set the owning side to null (unless already changed)
  904.             if ($cabeceraLinkdepago->getCabecera() === $this) {
  905.                 $cabeceraLinkdepago->setCabecera(null);
  906.             }
  907.         }
  908.         return $this;
  909.     }
  910.     public function getNombreReceptor(): ?string
  911.     {
  912.         return $this->nombre_receptor;
  913.     }
  914.     public function setNombreReceptor(string $nombre_receptor): self
  915.     {
  916.         $this->nombre_receptor $nombre_receptor;
  917.         return $this;
  918.     }
  919.     public function getTelefonoReceptor(): ?string
  920.     {
  921.         return $this->telefono_receptor;
  922.     }
  923.     public function setTelefonoReceptor(string $telefono_receptor): self
  924.     {
  925.         $this->telefono_receptor $telefono_receptor;
  926.         return $this;
  927.     }
  928.     public function getObservacionesReceptor(): ?string
  929.     {
  930.         return $this->observaciones_receptor;
  931.     }
  932.     public function setObservacionesReceptor(string $observaciones_receptor): self
  933.     {
  934.         $this->observaciones_receptor $observaciones_receptor;
  935.         return $this;
  936.     }
  937.     /**
  938.      * Devuelve el último CabeceraLinkdepago asociado.
  939.      */
  940.     public function getUltimoLinkdepago(): ?string
  941.     {
  942.         if ($this->metododepago != 30) {
  943.             return null;
  944.         }
  945.         $linkdepagos $this->getCabeceraLinkdepago();
  946.         if ($linkdepagos->isEmpty()) {
  947.             return 0;
  948.         }
  949.         // Verificar si alguno de los linkdepagos tiene el estado 1
  950.         foreach ($linkdepagos as $linkdepago) {
  951.             if ($linkdepago->getGlobalpayStatus() == 1) {
  952.                 return $linkdepago->getGlobalpayStatus();
  953.             }
  954.         }
  955.         // Devolver el último linkdepago si no se cumple la condición anterior
  956.         $linkdepagos $linkdepagos->last();
  957.         return $linkdepagos->getGlobalpayStatus();
  958.     }
  959. }