src/Entity/Factura.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FacturaRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=FacturaRepository::class)
  9.  */
  10. class Factura
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  20.      */
  21.     private $lecturaEnergiaP1;
  22.     /**
  23.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  24.      */
  25.     private $lecturaEnergiaP2;
  26.     /**
  27.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  28.      */
  29.     private $lecturaEnergiaP3;
  30.     /**
  31.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  32.      */
  33.     private $lecturaEnergiaP4;
  34.     /**
  35.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  36.      */
  37.     private $lecturaEnergiaP5;
  38.     /**
  39.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  40.      */
  41.     private $lecturaEnergiaP6;
  42.     /**
  43.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  44.      */
  45.     private $lecturaReactivaP1;
  46.     /**
  47.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  48.      */
  49.     private $lecturaReactivaP2;
  50.     /**
  51.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  52.      */
  53.     private $lecturaReactivaP3;
  54.     /**
  55.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  56.      */
  57.     private $lecturaReactivaP4;
  58.     /**
  59.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  60.      */
  61.     private $lecturaReactivaP5;
  62.     /**
  63.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  64.      */
  65.     private $lecturaReactivaP6;
  66.     /**
  67.      * @ORM\Column(type="boolean", nullable=true)
  68.      */
  69.     private $maximetro;
  70.     /**
  71.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  72.      */
  73.     private $maximetroP1;
  74.     /**
  75.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  76.      */
  77.     private $maximetroP2;
  78.     /**
  79.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  80.      */
  81.     private $maximetroP3;
  82.     /**
  83.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  84.      */
  85.     private $maximetroP4;
  86.     /**
  87.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  88.      */
  89.     private $maximetroP5;
  90.     /**
  91.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  92.      */
  93.     private $maximetroP6;
  94.     /**
  95.      * @ORM\Column(type="date")
  96.      */
  97.     private $fechaLectura;
  98.     /**
  99.      * @ORM\Column(type="date")
  100.      */
  101.     private $fechaLecturaAnterior;
  102.     /**
  103.      * @ORM\ManyToOne(targetEntity=TipoLectura::class, inversedBy="facturas")
  104.      * @ORM\JoinColumn(nullable=false)
  105.      */
  106.     private $tipoLectura;
  107.     /**
  108.      * @ORM\ManyToOne(targetEntity=TipoLectura::class, inversedBy="facturasAnteriores")
  109.      * @ORM\JoinColumn(nullable=false)
  110.      */
  111.     private $tipoLecturaAnterior;
  112.     /**
  113.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  114.      */
  115.     private $otrosCargos;
  116.     /**
  117.      * @ORM\Column(type="boolean")
  118.      */
  119.     private $devuelta;
  120.     /**
  121.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  122.      */
  123.     private $precioPotenciaP1;
  124.     /**
  125.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  126.      */
  127.     private $precioPotenciaP2;
  128.     /**
  129.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  130.      */
  131.     private $precioPotenciaP3;
  132.     /**
  133.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  134.      */
  135.     private $precioPotenciaP4;
  136.     /**
  137.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  138.      */
  139.     private $precioPotenciaP5;
  140.     /**
  141.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  142.      */
  143.     private $precioPotenciaP6;
  144.     /**
  145.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  146.      */
  147.     private $precioEnergiaP1;
  148.     /**
  149.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  150.      */
  151.     private $precioEnergiaP2;
  152.     /**
  153.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  154.      */
  155.     private $precioEnergiaP3;
  156.     /**
  157.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  158.      */
  159.     private $precioEnergiaP4;
  160.     /**
  161.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  162.      */
  163.     private $precioEnergiaP5;
  164.     /**
  165.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  166.      */
  167.     private $precioEnergiaP6;
  168.     /**
  169.      * @ORM\Column(type="string", length=255, nullable=true)
  170.      */
  171.     private $nombreCliente;
  172.     /**
  173.      * @ORM\Column(type="string", length=255, nullable=true)
  174.      */
  175.     private $nifCliente;
  176.     /**
  177.      * @ORM\Column(type="string", length=255, nullable=true)
  178.      */
  179.     private $direccionCliente;
  180.     /**
  181.      * @ORM\Column(type="string", length=255, nullable=true)
  182.      */
  183.     private $cpCliente;
  184.     /**
  185.      * @ORM\Column(type="string", length=255, nullable=true)
  186.      */
  187.     private $poblacionCliente;
  188.     /**
  189.      * @ORM\Column(type="string", length=255, nullable=true)
  190.      */
  191.     private $provinciaCliente;
  192.     /**
  193.      * @ORM\ManyToOne(targetEntity=Contrato::class, inversedBy="facturas")
  194.      */
  195.     private $contrato;
  196.     /**
  197.      * @ORM\ManyToOne(targetEntity=Tarifa::class, inversedBy="facturas")
  198.      * @ORM\JoinColumn(nullable=false)
  199.      */
  200.     private $tarifa;
  201.     /**
  202.      * @ORM\Column(type="date", nullable=true)
  203.      */
  204.     private $fechaEmision;
  205.     /**
  206.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  207.      */
  208.     private $potenciaP1;
  209.     /**
  210.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  211.      */
  212.     private $potenciaP2;
  213.     /**
  214.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  215.      */
  216.     private $potenciaP3;
  217.     /**
  218.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  219.      */
  220.     private $potenciaP4;
  221.     /**
  222.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  223.      */
  224.     private $potenciaP5;
  225.     /**
  226.      * @ORM\Column(type="decimal", precision=10, scale=3, nullable=true)
  227.      */
  228.     private $potenciaP6;
  229.     /**
  230.      * @ORM\Column(type="string", length=255, nullable=true)
  231.      */
  232.     private $iban;
  233.     /**
  234.      * @ORM\Column(type="string", length=255, nullable=true)
  235.      */
  236.     private $ccc;
  237.     /**
  238.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  239.      */
  240.     private $alquilerEquipos;
  241.     /**
  242.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  243.      */
  244.     private $impuesto;
  245.     /**
  246.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  247.      */
  248.     private $iva;
  249.     /**
  250.      * @ORM\Column(type="string", length=255, nullable=true)
  251.      */
  252.     private $numeroFactura;
  253.     /**
  254.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  255.      */
  256.     private $totalFactura;
  257.     /**
  258.      * @ORM\Column(type="string", length=255, nullable=true)
  259.      */
  260.     private $nombreNotificaciones;
  261.     /**
  262.      * @ORM\Column(type="string", length=255, nullable=true)
  263.      */
  264.     private $direccionNotificaciones;
  265.     /**
  266.      * @ORM\Column(type="string", length=255, nullable=true)
  267.      */
  268.     private $cpNotificaciones;
  269.     /**
  270.      * @ORM\Column(type="string", length=255, nullable=true)
  271.      */
  272.     private $poblacionNotificaciones;
  273.     /**
  274.      * @ORM\Column(type="string", length=255, nullable=true)
  275.      */
  276.     private $provinciaNotificaciones;
  277.     /**
  278.      * @ORM\Column(type="boolean")
  279.      */
  280.     private $notificaciones;
  281.     /**
  282.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  283.      */
  284.     private $lecturaAnteriorP1;
  285.     /**
  286.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  287.      */
  288.     private $lecturaAnteriorP2;
  289.     /**
  290.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  291.      */
  292.     private $lecturaAnteriorP3;
  293.     /**
  294.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  295.      */
  296.     private $lecturaAnteriorP4;
  297.     /**
  298.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  299.      */
  300.     private $lecturaAnteriorP5;
  301.     /**
  302.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  303.      */
  304.     private $lecturaAnteriorP6;
  305.     /**
  306.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  307.      */
  308.     private $factorConversion;
  309.     /**
  310.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  311.      */
  312.     private $lecturaReactivaAnteriorP1;
  313.     /**
  314.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  315.      */
  316.     private $lecturaReactivaAnteriorP2;
  317.     /**
  318.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  319.      */
  320.     private $lecturaReactivaAnteriorP3;
  321.     /**
  322.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  323.      */
  324.     private $lecturaReactivaAnteriorP4;
  325.     /**
  326.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  327.      */
  328.     private $lecturaReactivaAnteriorP5;
  329.     /**
  330.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  331.      */
  332.     private $lecturaReactivaAnteriorP6;
  333.     /**
  334.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  335.      */
  336.     private $precioReactivaP1;
  337.     /**
  338.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  339.      */
  340.     private $precioReactivaP2;
  341.     /**
  342.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  343.      */
  344.     private $precioReactivaP3;
  345.     /**
  346.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  347.      */
  348.     private $precioReactivaP4;
  349.     /**
  350.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  351.      */
  352.     private $precioReactivaP5;
  353.     /**
  354.      * @ORM\Column(type="decimal", precision=13, scale=10, nullable=true)
  355.      */
  356.     private $precioReactivaP6;
  357.     /**
  358.      * @ORM\OneToMany(targetEntity=Concepto::class, mappedBy="factura", cascade={"persist", "remove"})
  359.      */
  360.     private $conceptos;
  361.     /**
  362.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  363.      */
  364.     private $totalCompra;
  365.     /**
  366.      * @ORM\Column(type="date", nullable=true)
  367.      */
  368.     private $fechaEmisionCompra;
  369.     /**
  370.      * @ORM\Column(type="date", nullable=true)
  371.      */
  372.     private $fechaCobroCompra;
  373.     /**
  374.      * @ORM\ManyToOne(targetEntity=EstadoCompraFactura::class, inversedBy="facturas")
  375.      */
  376.     private $estadoCompra;
  377.     /**
  378.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  379.      */
  380.     private $precioCompraEnergiaP1;
  381.     /**
  382.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  383.      */
  384.     private $precioCompraEnergiaP2;
  385.     /**
  386.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  387.      */
  388.     private $precioCompraEnergiaP3;
  389.     /**
  390.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  391.      */
  392.     private $precioCompraEnergiaP4;
  393.     /**
  394.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  395.      */
  396.     private $precioCompraEnergiaP5;
  397.     /**
  398.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  399.      */
  400.     private $precioCompraEnergiaP6;
  401.     /**
  402.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  403.      */
  404.     private $precioCompraPotenciaP1;
  405.     /**
  406.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  407.      */
  408.     private $precioCompraPotenciaP2;
  409.     /**
  410.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  411.      */
  412.     private $precioCompraPotenciaP3;
  413.     /**
  414.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  415.      */
  416.     private $precioCompraPotenciaP4;
  417.     /**
  418.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  419.      */
  420.     private $precioCompraPotenciaP5;
  421.     /**
  422.      * @ORM\Column(type="decimal", precision=10, scale=7, nullable=true)
  423.      */
  424.     private $precioCompraPotenciaP6;
  425.     /**
  426.      * @ORM\Column(type="decimal", precision=10, scale=5, nullable=true)
  427.      */
  428.     private $alquilerEquiposReal;
  429.     /**
  430.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  431.      */
  432.     private $totalCompraFactura;
  433.     /**
  434.      * @ORM\Column(type="boolean", nullable=true)
  435.      */
  436.     private $rentable;
  437.     /**
  438.      * @ORM\Column(type="date", nullable=true)
  439.      */
  440.     private $fechaDevolucion;
  441.     /**
  442.      * @ORM\ManyToMany(targetEntity=Fraccionamiento::class, mappedBy="facturas")
  443.      */
  444.     private $fraccionamientos;
  445.     /**
  446.      * @ORM\ManyToOne(targetEntity=EstadoFactura::class, inversedBy="facturas")
  447.      */
  448.     private $estado;
  449.     /**
  450.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  451.      */
  452.     private $importePagado;
  453.     /**
  454.      * @ORM\Column(type="boolean", nullable=true)
  455.      */
  456.     private $logoHosteleria;
  457.     /**
  458.      * @ORM\Column(type="decimal", precision=10, scale=2, nullable=true)
  459.      */
  460.     private $importeBateriaVirtual;
  461.     /**
  462.      * @ORM\Column(type="boolean", nullable=true)
  463.      */
  464.     private $bateriaVirtual;
  465.     public function __construct()
  466.     {
  467.         $this->conceptos = new ArrayCollection();
  468.         $this->fraccionamientos = new ArrayCollection();
  469.     }
  470.     public function getId(): ?int
  471.     {
  472.         return $this->id;
  473.     }
  474.     public function getLecturaEnergiaP1(): ?string
  475.     {
  476.         return $this->lecturaEnergiaP1;
  477.     }
  478.     public function setLecturaEnergiaP1(?string $lecturaEnergiaP1): self
  479.     {
  480.         $this->lecturaEnergiaP1 $lecturaEnergiaP1;
  481.         return $this;
  482.     }
  483.     public function getLecturaEnergiaP2(): ?string
  484.     {
  485.         return $this->lecturaEnergiaP2;
  486.     }
  487.     public function setLecturaEnergiaP2(?string $lecturaEnergiaP2): self
  488.     {
  489.         $this->lecturaEnergiaP2 $lecturaEnergiaP2;
  490.         return $this;
  491.     }
  492.     public function getLecturaEnergiaP3(): ?string
  493.     {
  494.         return $this->lecturaEnergiaP3;
  495.     }
  496.     public function setLecturaEnergiaP3(?string $lecturaEnergiaP3): self
  497.     {
  498.         $this->lecturaEnergiaP3 $lecturaEnergiaP3;
  499.         return $this;
  500.     }
  501.     public function getLecturaEnergiaP4(): ?string
  502.     {
  503.         return $this->lecturaEnergiaP4;
  504.     }
  505.     public function setLecturaEnergiaP4(?string $lecturaEnergiaP4): self
  506.     {
  507.         $this->lecturaEnergiaP4 $lecturaEnergiaP4;
  508.         return $this;
  509.     }
  510.     public function getLecturaEnergiaP5(): ?string
  511.     {
  512.         return $this->lecturaEnergiaP5;
  513.     }
  514.     public function setLecturaEnergiaP5(?string $lecturaEnergiaP5): self
  515.     {
  516.         $this->lecturaEnergiaP5 $lecturaEnergiaP5;
  517.         return $this;
  518.     }
  519.     public function getLecturaEnergiaP6(): ?string
  520.     {
  521.         return $this->lecturaEnergiaP6;
  522.     }
  523.     public function setLecturaEnergiaP6(?string $lecturaEnergiaP6): self
  524.     {
  525.         $this->lecturaEnergiaP6 $lecturaEnergiaP6;
  526.         return $this;
  527.     }
  528.     public function getLecturaReactivaP1(): ?string
  529.     {
  530.         return $this->lecturaReactivaP1;
  531.     }
  532.     public function setLecturaReactivaP1(?string $lecturaReactivaP1): self
  533.     {
  534.         $this->lecturaReactivaP1 $lecturaReactivaP1;
  535.         return $this;
  536.     }
  537.     public function getLecturaReactivaP2(): ?string
  538.     {
  539.         return $this->lecturaReactivaP2;
  540.     }
  541.     public function setLecturaReactivaP2(?string $lecturaReactivaP2): self
  542.     {
  543.         $this->lecturaReactivaP2 $lecturaReactivaP2;
  544.         return $this;
  545.     }
  546.     public function getLecturaReactivaP3(): ?string
  547.     {
  548.         return $this->lecturaReactivaP3;
  549.     }
  550.     public function setLecturaReactivaP3(?string $lecturaReactivaP3): self
  551.     {
  552.         $this->lecturaReactivaP3 $lecturaReactivaP3;
  553.         return $this;
  554.     }
  555.     public function getLecturaReactivaP4(): ?string
  556.     {
  557.         return $this->lecturaReactivaP4;
  558.     }
  559.     public function setLecturaReactivaP4(?string $lecturaReactivaP4): self
  560.     {
  561.         $this->lecturaReactivaP4 $lecturaReactivaP4;
  562.         return $this;
  563.     }
  564.     public function getLecturaReactivaP5(): ?string
  565.     {
  566.         return $this->lecturaReactivaP5;
  567.     }
  568.     public function setLecturaReactivaP5(?string $lecturaReactivaP5): self
  569.     {
  570.         $this->lecturaReactivaP5 $lecturaReactivaP5;
  571.         return $this;
  572.     }
  573.     public function getLecturaReactivaP6(): ?string
  574.     {
  575.         return $this->lecturaReactivaP6;
  576.     }
  577.     public function setLecturaReactivaP6(?string $lecturaReactivaP6): self
  578.     {
  579.         $this->lecturaReactivaP6 $lecturaReactivaP6;
  580.         return $this;
  581.     }
  582.     public function getMaximetro(): ?bool
  583.     {
  584.         return $this->maximetro;
  585.     }
  586.     public function setMaximetro(?bool $maximetro): self
  587.     {
  588.         $this->maximetro $maximetro;
  589.         return $this;
  590.     }
  591.     public function getMaximetroP1(): ?string
  592.     {
  593.         return $this->maximetroP1;
  594.     }
  595.     public function setMaximetroP1(?string $maximetroP1): self
  596.     {
  597.         $this->maximetroP1 $maximetroP1;
  598.         return $this;
  599.     }
  600.     public function getMaximetroP2(): ?string
  601.     {
  602.         return $this->maximetroP2;
  603.     }
  604.     public function setMaximetroP2(?string $maximetroP2): self
  605.     {
  606.         $this->maximetroP2 $maximetroP2;
  607.         return $this;
  608.     }
  609.     public function getMaximetroP3(): ?string
  610.     {
  611.         return $this->maximetroP3;
  612.     }
  613.     public function setMaximetroP3(?string $maximetroP3): self
  614.     {
  615.         $this->maximetroP3 $maximetroP3;
  616.         return $this;
  617.     }
  618.     public function getMaximetroP4(): ?string
  619.     {
  620.         return $this->maximetroP4;
  621.     }
  622.     public function setMaximetroP4(?string $maximetroP4): self
  623.     {
  624.         $this->maximetroP4 $maximetroP4;
  625.         return $this;
  626.     }
  627.     public function getMaximetroP5(): ?string
  628.     {
  629.         return $this->maximetroP5;
  630.     }
  631.     public function setMaximetroP5(?string $maximetroP5): self
  632.     {
  633.         $this->maximetroP5 $maximetroP5;
  634.         return $this;
  635.     }
  636.     public function getMaximetroP6(): ?string
  637.     {
  638.         return $this->maximetroP6;
  639.     }
  640.     public function setMaximetroP6(?string $maximetroP6): self
  641.     {
  642.         $this->maximetroP6 $maximetroP6;
  643.         return $this;
  644.     }
  645.     public function getFechaLectura(): ?\DateTimeInterface
  646.     {
  647.         return $this->fechaLectura;
  648.     }
  649.     public function setFechaLectura(\DateTimeInterface $fechaLectura): self
  650.     {
  651.         $this->fechaLectura $fechaLectura;
  652.         return $this;
  653.     }
  654.     public function getFechaLecturaAnterior(): ?\DateTimeInterface
  655.     {
  656.         return $this->fechaLecturaAnterior;
  657.     }
  658.     public function setFechaLecturaAnterior(\DateTimeInterface $fechaLecturaAnterior): self
  659.     {
  660.         $this->fechaLecturaAnterior $fechaLecturaAnterior;
  661.         return $this;
  662.     }
  663.     public function getTipoLectura(): ?TipoLectura
  664.     {
  665.         return $this->tipoLectura;
  666.     }
  667.     public function setTipoLectura(?TipoLectura $tipoLectura): self
  668.     {
  669.         $this->tipoLectura $tipoLectura;
  670.         return $this;
  671.     }
  672.     public function getTipoLecturaAnterior(): ?TipoLectura
  673.     {
  674.         return $this->tipoLecturaAnterior;
  675.     }
  676.     public function setTipoLecturaAnterior(?TipoLectura $tipoLecturaAnterior): self
  677.     {
  678.         $this->tipoLecturaAnterior $tipoLecturaAnterior;
  679.         return $this;
  680.     }
  681.     public function getOtrosCargos(): ?string
  682.     {
  683.         return $this->otrosCargos;
  684.     }
  685.     public function setOtrosCargos(?string $otrosCargos): self
  686.     {
  687.         $this->otrosCargos $otrosCargos;
  688.         return $this;
  689.     }
  690.     public function getDevuelta(): ?bool
  691.     {
  692.         return $this->devuelta;
  693.     }
  694.     public function setDevuelta(bool $devuelta): self
  695.     {
  696.         $this->devuelta $devuelta;
  697.         return $this;
  698.     }
  699.     public function getPrecioPotenciaP1(): ?string
  700.     {
  701.         return $this->precioPotenciaP1;
  702.     }
  703.     public function setPrecioPotenciaP1(?string $precioPotenciaP1): self
  704.     {
  705.         $this->precioPotenciaP1 $precioPotenciaP1;
  706.         return $this;
  707.     }
  708.     public function getPrecioPotenciaP2(): ?string
  709.     {
  710.         return $this->precioPotenciaP2;
  711.     }
  712.     public function setPrecioPotenciaP2(?string $precioPotenciaP2): self
  713.     {
  714.         $this->precioPotenciaP2 $precioPotenciaP2;
  715.         return $this;
  716.     }
  717.     public function getPrecioPotenciaP3(): ?string
  718.     {
  719.         return $this->precioPotenciaP3;
  720.     }
  721.     public function setPrecioPotenciaP3(?string $precioPotenciaP3): self
  722.     {
  723.         $this->precioPotenciaP3 $precioPotenciaP3;
  724.         return $this;
  725.     }
  726.     public function getPrecioPotenciaP4(): ?string
  727.     {
  728.         return $this->precioPotenciaP4;
  729.     }
  730.     public function setPrecioPotenciaP4(?string $precioPotenciaP4): self
  731.     {
  732.         $this->precioPotenciaP4 $precioPotenciaP4;
  733.         return $this;
  734.     }
  735.     public function getPrecioPotenciaP5(): ?string
  736.     {
  737.         return $this->precioPotenciaP5;
  738.     }
  739.     public function setPrecioPotenciaP5(?string $precioPotenciaP5): self
  740.     {
  741.         $this->precioPotenciaP5 $precioPotenciaP5;
  742.         return $this;
  743.     }
  744.     public function getPrecioPotenciaP6(): ?string
  745.     {
  746.         return $this->precioPotenciaP6;
  747.     }
  748.     public function setPrecioPotenciaP6(?string $precioPotenciaP6): self
  749.     {
  750.         $this->precioPotenciaP6 $precioPotenciaP6;
  751.         return $this;
  752.     }
  753.     public function getPrecioEnergiaP1(): ?string
  754.     {
  755.         return $this->precioEnergiaP1;
  756.     }
  757.     public function setPrecioEnergiaP1(?string $precioEnergiaP1): self
  758.     {
  759.         $this->precioEnergiaP1 $precioEnergiaP1;
  760.         return $this;
  761.     }
  762.     public function getPrecioEnergiaP2(): ?string
  763.     {
  764.         return $this->precioEnergiaP2;
  765.     }
  766.     public function setPrecioEnergiaP2(?string $precioEnergiaP2): self
  767.     {
  768.         $this->precioEnergiaP2 $precioEnergiaP2;
  769.         return $this;
  770.     }
  771.     public function getPrecioEnergiaP3(): ?string
  772.     {
  773.         return $this->precioEnergiaP3;
  774.     }
  775.     public function setPrecioEnergiaP3(?string $precioEnergiaP3): self
  776.     {
  777.         $this->precioEnergiaP3 $precioEnergiaP3;
  778.         return $this;
  779.     }
  780.     public function getPrecioEnergiaP4(): ?string
  781.     {
  782.         return $this->precioEnergiaP4;
  783.     }
  784.     public function setPrecioEnergiaP4(?string $precioEnergiaP4): self
  785.     {
  786.         $this->precioEnergiaP4 $precioEnergiaP4;
  787.         return $this;
  788.     }
  789.     public function getPrecioEnergiaP5(): ?string
  790.     {
  791.         return $this->precioEnergiaP5;
  792.     }
  793.     public function setPrecioEnergiaP5(?string $precioEnergiaP5): self
  794.     {
  795.         $this->precioEnergiaP5 $precioEnergiaP5;
  796.         return $this;
  797.     }
  798.     public function getPrecioEnergiaP6(): ?string
  799.     {
  800.         return $this->precioEnergiaP6;
  801.     }
  802.     public function setPrecioEnergiaP6(?string $precioEnergiaP6): self
  803.     {
  804.         $this->precioEnergiaP6 $precioEnergiaP6;
  805.         return $this;
  806.     }
  807.     public function getNombreCliente(): ?string
  808.     {
  809.         return $this->nombreCliente;
  810.     }
  811.     public function setNombreCliente(?string $nombreCliente): self
  812.     {
  813.         $this->nombreCliente $nombreCliente;
  814.         return $this;
  815.     }
  816.     public function getNifCliente(): ?string
  817.     {
  818.         return $this->nifCliente;
  819.     }
  820.     public function setNifCliente(?string $nifCliente): self
  821.     {
  822.         $this->nifCliente $nifCliente;
  823.         return $this;
  824.     }
  825.     public function getDireccionCliente(): ?string
  826.     {
  827.         return $this->direccionCliente;
  828.     }
  829.     public function setDireccionCliente(?string $direccionCliente): self
  830.     {
  831.         $this->direccionCliente $direccionCliente;
  832.         return $this;
  833.     }
  834.     public function getCpCliente(): ?string
  835.     {
  836.         return $this->cpCliente;
  837.     }
  838.     public function setCpCliente(?string $cpCliente): self
  839.     {
  840.         $this->cpCliente $cpCliente;
  841.         return $this;
  842.     }
  843.     public function getPoblacionCliente(): ?string
  844.     {
  845.         return $this->poblacionCliente;
  846.     }
  847.     public function setPoblacionCliente(?string $poblacionCliente): self
  848.     {
  849.         $this->poblacionCliente $poblacionCliente;
  850.         return $this;
  851.     }
  852.     public function getProvinciaCliente(): ?string
  853.     {
  854.         return $this->provinciaCliente;
  855.     }
  856.     public function setProvinciaCliente(?string $provinciaCliente): self
  857.     {
  858.         $this->provinciaCliente $provinciaCliente;
  859.         return $this;
  860.     }
  861.     public function getContrato(): ?Contrato
  862.     {
  863.         return $this->contrato;
  864.     }
  865.     public function setContrato(?Contrato $contrato): self
  866.     {
  867.         $this->contrato $contrato;
  868.         return $this;
  869.     }
  870.     public function getTarifa(): ?Tarifa
  871.     {
  872.         return $this->tarifa;
  873.     }
  874.     public function setTarifa(?Tarifa $tarifa): self
  875.     {
  876.         $this->tarifa $tarifa;
  877.         return $this;
  878.     }
  879.     public function getFechaEmision(): ?\DateTimeInterface
  880.     {
  881.         return $this->fechaEmision;
  882.     }
  883.     public function setFechaEmision(?\DateTimeInterface $fechaEmision): self
  884.     {
  885.         $this->fechaEmision $fechaEmision;
  886.         return $this;
  887.     }
  888.     public function getPotenciaP1(): ?string
  889.     {
  890.         return $this->potenciaP1;
  891.     }
  892.     public function setPotenciaP1(?string $potenciaP1): self
  893.     {
  894.         $this->potenciaP1 $potenciaP1;
  895.         return $this;
  896.     }
  897.     public function getPotenciaP2(): ?string
  898.     {
  899.         return $this->potenciaP2;
  900.     }
  901.     public function setPotenciaP2(?string $potenciaP2): self
  902.     {
  903.         $this->potenciaP2 $potenciaP2;
  904.         return $this;
  905.     }
  906.     public function getPotenciaP3(): ?string
  907.     {
  908.         return $this->potenciaP3;
  909.     }
  910.     public function setPotenciaP3(?string $potenciaP3): self
  911.     {
  912.         $this->potenciaP3 $potenciaP3;
  913.         return $this;
  914.     }
  915.     public function getPotenciaP4(): ?string
  916.     {
  917.         return $this->potenciaP4;
  918.     }
  919.     public function setPotenciaP4(?string $potenciaP4): self
  920.     {
  921.         $this->potenciaP4 $potenciaP4;
  922.         return $this;
  923.     }
  924.     public function getPotenciaP5(): ?string
  925.     {
  926.         return $this->potenciaP5;
  927.     }
  928.     public function setPotenciaP5(?string $potenciaP5): self
  929.     {
  930.         $this->potenciaP5 $potenciaP5;
  931.         return $this;
  932.     }
  933.     public function getPotenciaP6(): ?string
  934.     {
  935.         return $this->potenciaP6;
  936.     }
  937.     public function setPotenciaP6(?string $potenciaP6): self
  938.     {
  939.         $this->potenciaP6 $potenciaP6;
  940.         return $this;
  941.     }
  942.     public function getIban(): ?string
  943.     {
  944.         return $this->iban;
  945.     }
  946.     public function setIban(?string $iban): self
  947.     {
  948.         $this->iban $iban;
  949.         return $this;
  950.     }
  951.     public function getCcc(): ?string
  952.     {
  953.         return $this->ccc;
  954.     }
  955.     public function setCcc(string $ccc): self
  956.     {
  957.         $this->ccc $ccc;
  958.         return $this;
  959.     }
  960.     public function getAlquilerEquipos(): ?string
  961.     {
  962.         return $this->alquilerEquipos;
  963.     }
  964.     public function setAlquilerEquipos(?string $alquilerEquipos): self
  965.     {
  966.         $this->alquilerEquipos $alquilerEquipos;
  967.         return $this;
  968.     }
  969.     public function getImpuesto(): ?string
  970.     {
  971.         return $this->impuesto;
  972.     }
  973.     public function setImpuesto(?string $impuesto): self
  974.     {
  975.         $this->impuesto $impuesto;
  976.         return $this;
  977.     }
  978.     public function getIva(): ?string
  979.     {
  980.         return $this->iva;
  981.     }
  982.     public function setIva(?string $iva): self
  983.     {
  984.         $this->iva $iva;
  985.         return $this;
  986.     }
  987.     public function getNumeroFactura(): ?string
  988.     {
  989.         return $this->numeroFactura;
  990.     }
  991.     public function setNumeroFactura(?string $numeroFactura): self
  992.     {
  993.         $this->numeroFactura $numeroFactura;
  994.         return $this;
  995.     }
  996.     public function getTotalFactura(): ?string
  997.     {
  998.         return $this->totalFactura;
  999.     }
  1000.     public function setTotalFactura(?string $totalFactura): self
  1001.     {
  1002.         $this->totalFactura $totalFactura;
  1003.         return $this;
  1004.     }
  1005.     public function getNombreNotificaciones(): ?string
  1006.     {
  1007.         return $this->nombreNotificaciones;
  1008.     }
  1009.     public function setNombreNotificaciones(?string $nombreNotificaciones): self
  1010.     {
  1011.         $this->nombreNotificaciones $nombreNotificaciones;
  1012.         return $this;
  1013.     }
  1014.     public function getDireccionNotificaciones(): ?string
  1015.     {
  1016.         return $this->direccionNotificaciones;
  1017.     }
  1018.     public function setDireccionNotificaciones(?string $direccionNotificaciones): self
  1019.     {
  1020.         $this->direccionNotificaciones $direccionNotificaciones;
  1021.         return $this;
  1022.     }
  1023.     public function getCpNotificaciones(): ?string
  1024.     {
  1025.         return $this->cpNotificaciones;
  1026.     }
  1027.     public function setCpNotificaciones(?string $cpNotificaciones): self
  1028.     {
  1029.         $this->cpNotificaciones $cpNotificaciones;
  1030.         return $this;
  1031.     }
  1032.     public function getPoblacionNotificaciones(): ?string
  1033.     {
  1034.         return $this->poblacionNotificaciones;
  1035.     }
  1036.     public function setPoblacionNotificaciones(?string $poblacionNotificaciones): self
  1037.     {
  1038.         $this->poblacionNotificaciones $poblacionNotificaciones;
  1039.         return $this;
  1040.     }
  1041.     public function getProvinciaNotificaciones(): ?string
  1042.     {
  1043.         return $this->provinciaNotificaciones;
  1044.     }
  1045.     public function setProvinciaNotificaciones(?string $provinciaNotificaciones): self
  1046.     {
  1047.         $this->provinciaNotificaciones $provinciaNotificaciones;
  1048.         return $this;
  1049.     }
  1050.     public function getNotificaciones(): ?bool
  1051.     {
  1052.         return $this->notificaciones;
  1053.     }
  1054.     public function setNotificaciones(bool $notificaciones): self
  1055.     {
  1056.         $this->notificaciones $notificaciones;
  1057.         return $this;
  1058.     }
  1059.     public function getLecturaAnteriorP1(): ?string
  1060.     {
  1061.         return $this->lecturaAnteriorP1;
  1062.     }
  1063.     public function setLecturaAnteriorP1(?string $lecturaAnteriorP1): self
  1064.     {
  1065.         $this->lecturaAnteriorP1 $lecturaAnteriorP1;
  1066.         return $this;
  1067.     }
  1068.     public function getLecturaAnteriorP2(): ?string
  1069.     {
  1070.         return $this->lecturaAnteriorP2;
  1071.     }
  1072.     public function setLecturaAnteriorP2(?string $lecturaAnteriorP2): self
  1073.     {
  1074.         $this->lecturaAnteriorP2 $lecturaAnteriorP2;
  1075.         return $this;
  1076.     }
  1077.     public function getLecturaAnteriorP3(): ?string
  1078.     {
  1079.         return $this->lecturaAnteriorP3;
  1080.     }
  1081.     public function setLecturaAnteriorP3(?string $lecturaAnteriorP3): self
  1082.     {
  1083.         $this->lecturaAnteriorP3 $lecturaAnteriorP3;
  1084.         return $this;
  1085.     }
  1086.     public function getLecturaAnteriorP4(): ?string
  1087.     {
  1088.         return $this->lecturaAnteriorP4;
  1089.     }
  1090.     public function setLecturaAnteriorP4(?string $lecturaAnteriorP4): self
  1091.     {
  1092.         $this->lecturaAnteriorP4 $lecturaAnteriorP4;
  1093.         return $this;
  1094.     }
  1095.     public function getLecturaAnteriorP5(): ?string
  1096.     {
  1097.         return $this->lecturaAnteriorP5;
  1098.     }
  1099.     public function setLecturaAnteriorP5(?string $lecturaAnteriorP5): self
  1100.     {
  1101.         $this->lecturaAnteriorP5 $lecturaAnteriorP5;
  1102.         return $this;
  1103.     }
  1104.     public function getLecturaAnteriorP6(): ?string
  1105.     {
  1106.         return $this->lecturaAnteriorP6;
  1107.     }
  1108.     public function setLecturaAnteriorP6(?string $lecturaAnteriorP6): self
  1109.     {
  1110.         $this->lecturaAnteriorP6 $lecturaAnteriorP6;
  1111.         return $this;
  1112.     }
  1113.     public function calcularTotal(): float {
  1114.         $importeTotal=$this->getBaseImponible();
  1115.         $importeIva=round($this->iva*$importeTotal/100,2);
  1116.         $totalFactura=round($importeTotal+$importeIva,2);
  1117.         $this->totalFactura=$totalFactura;
  1118.         return $totalFactura;
  1119.     }
  1120.     public function calcularTotalCompra(): float {
  1121.         $importeTotal=$this->getBaseImponibleCompra();
  1122.         $importeIva=round($this->iva*$importeTotal/100,2);
  1123.         $totalFactura=round($importeTotal+$importeIva,2);
  1124.         return $totalFactura;
  1125.     }
  1126.     public function getBaseImponible(): float
  1127.     {
  1128.         return round($this->getImporteEnergia()+$this->getImporteOtrosConceptos(),2);
  1129.     }
  1130.     public function getBaseImponibleCompra(): float
  1131.     {
  1132.         return round($this->getImporteEnergiaCompra()+$this->getImporteOtrosConceptos(),2);
  1133.     }
  1134.     public function getPotenciaFacturada(string $p): ?string
  1135.     {
  1136.         $hasMaximetro=$this->maximetro;
  1137.         $tarifa=$this->tarifa->getNombre();
  1138.         $tarifaId=$this->tarifa->getId();
  1139.         if( $hasMaximetro ){
  1140.             switch ($p){
  1141.                 case 'P1':
  1142.                     $potencia=$this->potenciaP1;
  1143.                     if($tarifa=='3.0A' || $tarifa=='3.1A'){
  1144.                         if($this->maximetroP1>$this->maximetroP4){
  1145.                             $maximetro=$this->maximetroP1;
  1146.                         }else{
  1147.                             $maximetro=$this->maximetroP4;
  1148.                         }
  1149.                     }
  1150.                     else{
  1151.                         $maximetro=$this->maximetroP1;
  1152.                     }
  1153.                     break;
  1154.                 case 'P2':
  1155.                     $potencia=$this->potenciaP2;
  1156.                     if($tarifa=='3.0A' || $tarifa=='3.1A'){
  1157.                         if($this->maximetroP2>$this->maximetroP5){
  1158.                             $maximetro=$this->maximetroP2;
  1159.                         }else{
  1160.                             $maximetro=$this->maximetroP5;
  1161.                         }
  1162.                     }
  1163.                     else{
  1164.                         $maximetro=$this->maximetroP2;
  1165.                     }
  1166.                     break;
  1167.                 case 'P3':
  1168.                     $potencia=$this->potenciaP3;
  1169.                     if($tarifa=='3.0A' || $tarifa=='3.1A'){
  1170.                         if($this->maximetroP3>$this->maximetroP6){
  1171.                             $maximetro=$this->maximetroP3;
  1172.                         }else{
  1173.                             $maximetro=$this->maximetroP6;
  1174.                         }
  1175.                     }
  1176.                     else{
  1177.                         $maximetro=$this->maximetroP3;
  1178.                     }
  1179.                     break;
  1180.                 case 'P4':
  1181.                     $potencia=$this->potenciaP4;
  1182.                     $maximetro=$this->maximetroP4;
  1183.                     break;
  1184.                 case 'P5':
  1185.                     $potencia=$this->potenciaP5;
  1186.                     $maximetro=$this->maximetroP5;
  1187.                     break;
  1188.                 case 'P6':
  1189.                     $potencia=$this->potenciaP6;
  1190.                     $maximetro=$this->maximetroP6;
  1191.                     break;
  1192.                 default:
  1193.                     return 0;
  1194.             }
  1195.             if($maximetro!==null){
  1196.                 if($maximetro>$potencia*1.05){
  1197.                     $potencia=$maximetro+($maximetro-$potencia*1.05)*2;
  1198.                 }
  1199.                 elseif($tarifa=='3.0A' || $tarifa=='3.1A' || $tarifaId==29 || $tarifaId==30){
  1200.                     if ($maximetro>$potencia*0.85){
  1201.                         $potencia=$maximetro;
  1202.                     }
  1203.                     else {
  1204.                         $potencia $potencia 0.85;
  1205.                     }
  1206.                 }
  1207.                 else{
  1208.                     switch ($p){
  1209.                         case 'P1':
  1210.                             $potencia=$this->potenciaP1;
  1211.                             break;
  1212.                         case 'P2':
  1213.                             $potencia=$this->potenciaP2;
  1214.                             break;
  1215.                         case 'P3':
  1216.                             $potencia=$this->potenciaP3;
  1217.                             break;
  1218.                         case 'P4':
  1219.                             $potencia=$this->potenciaP4;
  1220.                             break;
  1221.                         case 'P5':
  1222.                             $potencia=$this->potenciaP5;
  1223.                             break;
  1224.                         case 'P6':
  1225.                             $potencia=$this->potenciaP6;
  1226.                             break;
  1227.                         default:
  1228.                             return 0;
  1229.                     }
  1230.                 }
  1231.             }
  1232.         }else{
  1233.             switch ($p){
  1234.                 case 'P1':
  1235.                     return $this->potenciaP1;
  1236.                 case 'P2':
  1237.                     return $this->potenciaP2;
  1238.                 case 'P3':
  1239.                     return $this->potenciaP3;
  1240.                 case 'P4':
  1241.                     return $this->potenciaP4;
  1242.                 case 'P5':
  1243.                     return $this->potenciaP5;
  1244.                 case 'P6':
  1245.                     return $this->potenciaP6;
  1246.                 default:
  1247.                     return 0;
  1248.             }
  1249.         }
  1250.         return $potencia;
  1251.     }
  1252.     public function getPeriodoFacturacion(): ?string
  1253.     {
  1254.         return date_diff$this->fechaLecturaAnterior$this->fechaLectura )->days+1;
  1255.     }
  1256.     public function getConsumo(): ?string
  1257.     {
  1258.         return ($this->lecturaEnergiaP1??0) - ($this->lecturaAnteriorP1??0) +
  1259.             ($this->lecturaEnergiaP2??0) - ($this->lecturaAnteriorP2??0) +
  1260.             ($this->lecturaEnergiaP3??0) - ($this->lecturaAnteriorP3??0) +
  1261.             ($this->lecturaEnergiaP4??0) - ($this->lecturaAnteriorP4??0) +
  1262.             ($this->lecturaEnergiaP5??0) - ($this->lecturaAnteriorP5??0) +
  1263.             ($this->lecturaEnergiaP6??0) - ($this->lecturaAnteriorP6??0);
  1264.     }
  1265.     public function getImporteEnergia(): ?float
  1266.     {
  1267.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1268.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1269.             $subtotal=round(round($this->getConsumoConvertidoP1()*$this->precioEnergiaP1,2)+round($this->precioPotenciaP1*$periodoFacturacion,2),2);
  1270.             $importeImpuesto=round($this->impuesto*$this->getConsumoConvertidoP1(),2);
  1271.             $importeAlquiler=round($periodoFacturacion*$this->alquilerEquipos,2);
  1272.         }else{
  1273.             $totalPotencia=$this->getImportePotencia();
  1274.             $totalEnergia=$this->getImporteConsumo();
  1275.             $totalReactiva=$this->getImporteReactiva();
  1276.             $subtotal=round($totalEnergia+$totalPotencia+$totalReactiva,2);
  1277.             $importeImpuesto=round($this->impuesto*$subtotal/100,2);
  1278.             $importeAlquiler=round($periodoFacturacion*$this->alquilerEquipos,2);
  1279.         }
  1280.         return round($subtotal+$importeAlquiler+$importeImpuesto,2);
  1281.     }
  1282.     public function getImporteEnergiaCompra(): ?float
  1283.     {
  1284.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1285.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1286.             $subtotal=round(round($this->getConsumoConvertidoP1()*$this->precioCompraEnergiaP1,2)+round($this->precioCompraPotenciaP1*$periodoFacturacion,2),2);
  1287.             $importeImpuesto=round($this->impuesto*$this->getConsumoConvertidoP1(),2);
  1288.             $importeAlquiler=round($periodoFacturacion*$this->alquilerEquiposReal,2);
  1289.         }else{
  1290.             $totalPotencia=$this->getImportePotenciaCompra();
  1291.             $totalEnergia=$this->getImporteConsumoCompra();
  1292.             $totalReactiva=$this->getImporteReactiva();
  1293.             $subtotal=round($totalEnergia+$totalPotencia+$totalReactiva,2);
  1294.             $importeImpuesto=round($this->impuesto*$subtotal/100,2);
  1295.             $importeAlquiler=round($periodoFacturacion*$this->alquilerEquiposReal,2);
  1296.         }
  1297.         return round($subtotal+$importeAlquiler+$importeImpuesto,2);
  1298.     }
  1299.     public function getImportePotencia(): ?float
  1300.     {
  1301.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1302.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1303.             return  round($this->getConsumoConvertidoP1()*$this->precioEnergiaP1,2);
  1304.         }else{
  1305.             switch( $this->getTarifa()->getNombre() ) {
  1306.                 case '3.0A':
  1307.                 case '3.1A':
  1308.                     return
  1309.                         round(($this->getPotenciaFacturada('P1')??0) * ($this->precioPotenciaP1??0) * $periodoFacturacion,2)+
  1310.                         round(($this->getPotenciaFacturada('P2')??0) * ($this->precioPotenciaP2??0) * $periodoFacturacion,2)+
  1311.                         round(($this->getPotenciaFacturada('P3')??0) * ($this->precioPotenciaP3??0) * $periodoFacturacion,2);
  1312.                 default:
  1313.                     return
  1314.                         round(($this->getPotenciaFacturada('P1')??0) * ($this->precioPotenciaP1??0) * $periodoFacturacion,2)+
  1315.                         round(($this->getPotenciaFacturada('P2')??0) * ($this->precioPotenciaP2??0) * $periodoFacturacion,2)+
  1316.                         round(($this->getPotenciaFacturada('P3')??0) * ($this->precioPotenciaP3??0) * $periodoFacturacion,2)+
  1317.                         round(($this->getPotenciaFacturada('P4')??0) * ($this->precioPotenciaP4??0) * $periodoFacturacion,2)+
  1318.                         round(($this->getPotenciaFacturada('P5')??0) * ($this->precioPotenciaP5??0) * $periodoFacturacion,2)+
  1319.                         round(($this->getPotenciaFacturada('P6')??0) * ($this->precioPotenciaP6??0) * $periodoFacturacion,2);
  1320.             }
  1321.         }
  1322.     }
  1323.     public function getImportePotenciaCompra(): ?float
  1324.     {
  1325.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1326.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1327.             return  round($this->getConsumoConvertidoP1()*$this->precioCompraEnergiaP1,2);
  1328.         }else{
  1329.             switch( $this->getTarifa()->getNombre() ) {
  1330.                 case '3.0A':
  1331.                 case '3.1A':
  1332.                     return
  1333.                         round(($this->getPotenciaFacturada('P1')??0) * ($this->precioCompraPotenciaP1??0) * $periodoFacturacion,2)+
  1334.                         round(($this->getPotenciaFacturada('P2')??0) * ($this->precioCompraPotenciaP2??0) * $periodoFacturacion,2)+
  1335.                         round(($this->getPotenciaFacturada('P3')??0) * ($this->precioCompraPotenciaP3??0) * $periodoFacturacion,2);
  1336.                 default:
  1337.                     return
  1338.                         round(($this->getPotenciaFacturada('P1')??0) * ($this->precioCompraPotenciaP1??0) * $periodoFacturacion,2)+
  1339.                         round(($this->getPotenciaFacturada('P2')??0) * ($this->precioCompraPotenciaP2??0) * $periodoFacturacion,2)+
  1340.                         round(($this->getPotenciaFacturada('P3')??0) * ($this->precioCompraPotenciaP3??0) * $periodoFacturacion,2)+
  1341.                         round(($this->getPotenciaFacturada('P4')??0) * ($this->precioCompraPotenciaP4??0) * $periodoFacturacion,2)+
  1342.                         round(($this->getPotenciaFacturada('P5')??0) * ($this->precioCompraPotenciaP5??0) * $periodoFacturacion,2)+
  1343.                         round(($this->getPotenciaFacturada('P6')??0) * ($this->precioCompraPotenciaP6??0) * $periodoFacturacion,2);
  1344.             }
  1345.         }
  1346.     }
  1347.     public function getImporteConsumo(): ?float
  1348.     {
  1349.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1350.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1351.             return  round($this->getConsumoConvertidoP1()*$this->precioEnergiaP1,2);
  1352.         }else{
  1353.             switch( $this->getTarifa()->getNombre() ) {
  1354.                 case '3.0A':
  1355.                 case '3.1A':
  1356.                     $consumoP1Facturado = ($this->getConsumoP1()) + ($this->getConsumoP4());
  1357.                     $consumoP2Facturado = ($this->getConsumoP2()) + ($this->getConsumoP5());
  1358.                     $consumoP3Facturado = ($this->getConsumoP3()) + ($this->getConsumoP6());
  1359.                     $totalEnergiaP1 round($consumoP1Facturado * ($this->precioEnergiaP1 ?? 0), 2);
  1360.                     $totalEnergiaP2 round($consumoP2Facturado * ($this->precioEnergiaP2 ?? 0), 2);
  1361.                     $totalEnergiaP3 round($consumoP3Facturado * ($this->precioEnergiaP3 ?? 0), 2);
  1362.                     return $totalEnergiaP1 $totalEnergiaP2 $totalEnergiaP3;
  1363.                 default:
  1364.                     return
  1365.                         ($this->getConsumoP1() * $this->getPrecioEnergiaP1()) +
  1366.                         ($this->getConsumoP2() * $this->getPrecioEnergiaP2()) +
  1367.                         ($this->getConsumoP3() * $this->getPrecioEnergiaP3()) +
  1368.                         ($this->getConsumoP4() * $this->getPrecioEnergiaP4()) +
  1369.                         ($this->getConsumoP5() * $this->getPrecioEnergiaP5()) +
  1370.                         ($this->getConsumoP6() * $this->getPrecioEnergiaP6());
  1371.             }
  1372.         }
  1373.     }
  1374.     public function getImporteConsumoCompra(): ?float
  1375.     {
  1376.         $periodoFacturacion=date_diff($this->fechaLecturaAnterior$this->fechaLectura)->days+1;
  1377.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1378.             return  round($this->getConsumoConvertidoP1()*$this->precioCompraEnergiaP1,2);
  1379.         }else{
  1380.             switch( $this->getTarifa()->getNombre() ) {
  1381.                 case '3.0A':
  1382.                 case '3.1A':
  1383.                     $consumoP1Facturado = ($this->getConsumoP1()) + ($this->getConsumoP4());
  1384.                     $consumoP2Facturado = ($this->getConsumoP2()) + ($this->getConsumoP5());
  1385.                     $consumoP3Facturado = ($this->getConsumoP3()) + ($this->getConsumoP6());
  1386.                     $totalEnergiaP1 round($consumoP1Facturado * ($this->precioCompraEnergiaP1 ?? 0), 2);
  1387.                     $totalEnergiaP2 round($consumoP2Facturado * ($this->precioCompraEnergiaP2 ?? 0), 2);
  1388.                     $totalEnergiaP3 round($consumoP3Facturado * ($this->precioCompraEnergiaP3 ?? 0), 2);
  1389.                     return $totalEnergiaP1 $totalEnergiaP2 $totalEnergiaP3;
  1390.                 default:
  1391.                     return
  1392.                         ($this->getConsumoP1() * $this->precioCompraEnergiaP1) +
  1393.                         ($this->getConsumoP2() * $this->precioCompraEnergiaP2) +
  1394.                         ($this->getConsumoP3() * $this->precioCompraEnergiaP3) +
  1395.                         ($this->getConsumoP4() * $this->precioCompraEnergiaP4) +
  1396.                         ($this->getConsumoP5() * $this->precioCompraEnergiaP5) +
  1397.                         ($this->getConsumoP6() * $this->precioCompraEnergiaP6);
  1398.             }
  1399.         }
  1400.     }
  1401.     public function getImporteReactiva(): ?float
  1402.     {
  1403.         if($this->getTarifa()->getTipoTarifa()->getNombre()=='Gas'){
  1404.             return 0;
  1405.         }else{
  1406.             switch( $this->getTarifa()->getNombre() ){
  1407.                 case '3.0A': case '3.1A':
  1408.                 $consumoP1Facturado=($this->getConsumoP1()) + ($this->getConsumoP4());
  1409.                 $consumoP2Facturado=($this->getConsumoP2()) + ($this->getConsumoP5());
  1410.                 $excesoReactivaP1=($this->getReactivaP1()+$this->getReactivaP4())-0.33*$consumoP1Facturado;
  1411.                 $excesoReactivaP2=($this->getReactivaP2()+$this->getReactivaP5())-0.33*$consumoP2Facturado;
  1412.                 if($excesoReactivaP1<0)
  1413.                     $excesoReactivaP1=0;
  1414.                 if($excesoReactivaP2<0)
  1415.                     $excesoReactivaP2=0;
  1416.                 $importeReactivaP1=round($excesoReactivaP1*$this->precioReactivaP1,2);
  1417.                 $importeReactivaP2=round($excesoReactivaP2*$this->precioReactivaP2,2);
  1418.                 return $importeReactivaP1+$importeReactivaP2;
  1419.                 default:
  1420.                     $reactivaP1=$this->getReactivaP1();
  1421.                     if($reactivaP1!=0)
  1422.                         $excesoReactivaP1=$reactivaP1-0.33*$this->getConsumoP1();
  1423.                     else
  1424.                         $excesoReactivaP1=0;
  1425.                     $reactivaP2=$this->getReactivaP2();
  1426.                     if($reactivaP2!=0)
  1427.                         $excesoReactivaP2=$reactivaP2-0.33*$this->getConsumoP2();
  1428.                     else
  1429.                         $excesoReactivaP2=0;
  1430.                     $reactivaP3=$this->getReactivaP3();
  1431.                     if($reactivaP3!=0)
  1432.                         $excesoReactivaP3=$reactivaP3-0.33*$this->getConsumoP3();
  1433.                     else
  1434.                         $excesoReactivaP3=0;
  1435.                     $reactivaP4=$this->getReactivaP4();
  1436.                     if($reactivaP4!=0)
  1437.                         $excesoReactivaP4=$reactivaP4-0.33*$this->getConsumoP4();
  1438.                     else
  1439.                         $excesoReactivaP4=0;
  1440.                     $reactivaP5=$this->getReactivaP5();
  1441.                     if($reactivaP5!=0)
  1442.                         $excesoReactivaP5=$reactivaP5-0.33*$this->getConsumoP5();
  1443.                     else
  1444.                         $excesoReactivaP5=0;
  1445.                     $reactivaP6=$this->getReactivaP6();
  1446.                     if($reactivaP6!=0)
  1447.                         $excesoReactivaP6=$reactivaP6-0.33*$this->getConsumoP6();
  1448.                     else
  1449.                         $excesoReactivaP6=0;
  1450.                     if($excesoReactivaP1<0)
  1451.                         $excesoReactivaP1=0;
  1452.                     if($excesoReactivaP2<0)
  1453.                         $excesoReactivaP2=0;
  1454.                     if($excesoReactivaP3<0)
  1455.                         $excesoReactivaP3=0;
  1456.                     if($excesoReactivaP4<0)
  1457.                         $excesoReactivaP4=0;
  1458.                     if($excesoReactivaP5<0)
  1459.                         $excesoReactivaP5=0;
  1460.                     if($excesoReactivaP6<0)
  1461.                         $excesoReactivaP6=0;
  1462.                     $importeReactivaP1=round($excesoReactivaP1*$this->precioReactivaP1,2);
  1463.                     $importeReactivaP2=round($excesoReactivaP2*$this->precioReactivaP2,2);
  1464.                     $importeReactivaP3=round($excesoReactivaP3*$this->precioReactivaP3,2);
  1465.                     $importeReactivaP4=round($excesoReactivaP4*$this->precioReactivaP4,2);
  1466.                     $importeReactivaP5=round($excesoReactivaP5*$this->precioReactivaP5,2);
  1467.                     $importeReactivaP6=round($excesoReactivaP6*$this->precioReactivaP6,2);
  1468.                     return $importeReactivaP1+$importeReactivaP2+$importeReactivaP3+$importeReactivaP4+$importeReactivaP5+$importeReactivaP6;
  1469.             }
  1470.         }
  1471.     }
  1472.     public function getImporteOtrosConceptos(): ?float{
  1473.         $otrosConceptos=0;
  1474.         foreach ($this->conceptos as $concepto){
  1475.             $otrosConceptos+=round($concepto->getImporte(),2);
  1476.         }
  1477.         return round($otrosConceptos,2);
  1478.     }
  1479.     public function getConsumoP1(): ?string
  1480.     {
  1481.         return ($this->lecturaEnergiaP1??0) - ($this->lecturaAnteriorP1??0);
  1482.     }
  1483.     public function getConsumoP2(): ?string
  1484.     {
  1485.         return ($this->lecturaEnergiaP2??0) - ($this->lecturaAnteriorP2??0);
  1486.     }
  1487.     public function getConsumoP3(): ?string
  1488.     {
  1489.         return ($this->lecturaEnergiaP3??0) - ($this->lecturaAnteriorP3??0);
  1490.     }
  1491.     public function getConsumoP4(): ?string
  1492.     {
  1493.         return ($this->lecturaEnergiaP4??0) - ($this->lecturaAnteriorP4??0);
  1494.     }
  1495.     public function getConsumoP5(): ?string
  1496.     {
  1497.         return ($this->lecturaEnergiaP5??0) - ($this->lecturaAnteriorP5??0);
  1498.     }
  1499.     public function getConsumoP6(): ?string
  1500.     {
  1501.         return ($this->lecturaEnergiaP6??0) - ($this->lecturaAnteriorP6??0);
  1502.     }
  1503.     public function getReactivaP1(): ?string
  1504.     {
  1505.         return ($this->lecturaReactivaP1??0) - ($this->lecturaReactivaAnteriorP1??0);
  1506.     }
  1507.     public function getReactivaP2(): ?string
  1508.     {
  1509.         return ($this->lecturaReactivaP2??0) - ($this->lecturaReactivaAnteriorP2??0);
  1510.     }
  1511.     public function getReactivaP3(): ?string
  1512.     {
  1513.         if($this->fechaEmision>date_create('2022-07-31'))
  1514.             return ($this->lecturaReactivaP3??0) - ($this->lecturaReactivaAnteriorP3??0);
  1515.         else
  1516.             return 0;
  1517.     }
  1518.     public function getReactivaP4(): ?string
  1519.     {
  1520.         return ($this->lecturaReactivaP4??0) - ($this->lecturaReactivaAnteriorP4??0);
  1521.     }
  1522.     public function getReactivaP5(): ?string
  1523.     {
  1524.         return ($this->lecturaReactivaP5??0) - ($this->lecturaReactivaAnteriorP5??0);
  1525.     }
  1526.     public function getReactivaP6(): ?string
  1527.     {
  1528.         return ($this->lecturaReactivaP6??0) - ($this->lecturaReactivaAnteriorP6??0);
  1529.     }
  1530.     public function getConsumoConvertidoP1(): ?string
  1531.     {
  1532.         return ( ($this->lecturaEnergiaP1??0) - ($this->lecturaAnteriorP1??0) )*($this->factorConversion??0);
  1533.     }
  1534.     public function getNumeroCuenta(): ?string
  1535.     {
  1536.         return $this->iban.' '.implode(' 'str_split($this->ccc4)) ;
  1537.     }
  1538.     public function getFactorConversion(): ?string
  1539.     {
  1540.         return $this->factorConversion;
  1541.     }
  1542.     public function setFactorConversion(?string $factorConversion): self
  1543.     {
  1544.         $this->factorConversion $factorConversion;
  1545.         return $this;
  1546.     }
  1547.     public function getLecturaReactivaAnteriorP1(): ?string
  1548.     {
  1549.         return $this->lecturaReactivaAnteriorP1;
  1550.     }
  1551.     public function setLecturaReactivaAnteriorP1(?string $lecturaReactivaAnteriorP1): self
  1552.     {
  1553.         $this->lecturaReactivaAnteriorP1 $lecturaReactivaAnteriorP1;
  1554.         return $this;
  1555.     }
  1556.     public function getLecturaReactivaAnteriorP2(): ?string
  1557.     {
  1558.         return $this->lecturaReactivaAnteriorP2;
  1559.     }
  1560.     public function setLecturaReactivaAnteriorP2(?string $lecturaReactivaAnteriorP2): self
  1561.     {
  1562.         $this->lecturaReactivaAnteriorP2 $lecturaReactivaAnteriorP2;
  1563.         return $this;
  1564.     }
  1565.     public function getLecturaReactivaAnteriorP3(): ?string
  1566.     {
  1567.         return $this->lecturaReactivaAnteriorP3;
  1568.     }
  1569.     public function setLecturaReactivaAnteriorP3(?string $lecturaReactivaAnteriorP3): self
  1570.     {
  1571.         $this->lecturaReactivaAnteriorP3 $lecturaReactivaAnteriorP3;
  1572.         return $this;
  1573.     }
  1574.     public function getLecturaReactivaAnteriorP4(): ?string
  1575.     {
  1576.         return $this->lecturaReactivaAnteriorP4;
  1577.     }
  1578.     public function setLecturaReactivaAnteriorP4(?string $lecturaReactivaAnteriorP4): self
  1579.     {
  1580.         $this->lecturaReactivaAnteriorP4 $lecturaReactivaAnteriorP4;
  1581.         return $this;
  1582.     }
  1583.     public function getLecturaReactivaAnteriorP5(): ?string
  1584.     {
  1585.         return $this->lecturaReactivaAnteriorP5;
  1586.     }
  1587.     public function setLecturaReactivaAnteriorP5(?string $lecturaReactivaAnteriorP5): self
  1588.     {
  1589.         $this->lecturaReactivaAnteriorP5 $lecturaReactivaAnteriorP5;
  1590.         return $this;
  1591.     }
  1592.     public function getLecturaReactivaAnteriorP6(): ?string
  1593.     {
  1594.         return $this->lecturaReactivaAnteriorP6;
  1595.     }
  1596.     public function setLecturaReactivaAnteriorP6(?string $lecturaReactivaAnteriorP6): self
  1597.     {
  1598.         $this->lecturaReactivaAnteriorP6 $lecturaReactivaAnteriorP6;
  1599.         return $this;
  1600.     }
  1601.     public function getPrecioReactivaP1(): ?string
  1602.     {
  1603.         return $this->precioReactivaP1;
  1604.     }
  1605.     public function setPrecioReactivaP1(?string $precioReactivaP1): self
  1606.     {
  1607.         $this->precioReactivaP1 $precioReactivaP1;
  1608.         return $this;
  1609.     }
  1610.     public function getPrecioReactivaP2(): ?string
  1611.     {
  1612.         return $this->precioReactivaP2;
  1613.     }
  1614.     public function setPrecioReactivaP2(?string $precioReactivaP2): self
  1615.     {
  1616.         $this->precioReactivaP2 $precioReactivaP2;
  1617.         return $this;
  1618.     }
  1619.     public function getPrecioReactivaP3(): ?string
  1620.     {
  1621.         return $this->precioReactivaP3;
  1622.     }
  1623.     public function setPrecioReactivaP3(?string $precioReactivaP3): self
  1624.     {
  1625.         $this->precioReactivaP3 $precioReactivaP3;
  1626.         return $this;
  1627.     }
  1628.     public function getPrecioReactivaP4(): ?string
  1629.     {
  1630.         return $this->precioReactivaP4;
  1631.     }
  1632.     public function setPrecioReactivaP4(?string $precioReactivaP4): self
  1633.     {
  1634.         $this->precioReactivaP4 $precioReactivaP4;
  1635.         return $this;
  1636.     }
  1637.     public function getPrecioReactivaP5(): ?string
  1638.     {
  1639.         return $this->precioReactivaP5;
  1640.     }
  1641.     public function setPrecioReactivaP5(?string $precioReactivaP5): self
  1642.     {
  1643.         $this->precioReactivaP5 $precioReactivaP5;
  1644.         return $this;
  1645.     }
  1646.     public function getPrecioReactivaP6(): ?string
  1647.     {
  1648.         return $this->precioReactivaP6;
  1649.     }
  1650.     public function setPrecioReactivaP6(?string $precioReactivaP6): self
  1651.     {
  1652.         $this->precioReactivaP6 $precioReactivaP6;
  1653.         return $this;
  1654.     }
  1655.     /**
  1656.      * @return Collection|Concepto[]
  1657.      */
  1658.     public function getConceptos(): Collection
  1659.     {
  1660.         return $this->conceptos;
  1661.     }
  1662.     public function addConcepto(Concepto $concepto): self
  1663.     {
  1664.         if (!$this->conceptos->contains($concepto)) {
  1665.             $this->conceptos[] = $concepto;
  1666.             $concepto->setFactura($this);
  1667.         }
  1668.         return $this;
  1669.     }
  1670.     public function removeConcepto(Concepto $concepto): self
  1671.     {
  1672.         if ($this->conceptos->contains($concepto)) {
  1673.             $this->conceptos->removeElement($concepto);
  1674.             // set the owning side to null (unless already changed)
  1675.             if ($concepto->getFactura() === $this) {
  1676.                 $concepto->setFactura(null);
  1677.             }
  1678.         }
  1679.         return $this;
  1680.     }
  1681.     public function getClassName(){
  1682.         return 'Factura';
  1683.     }
  1684.     public function __toString()
  1685.     {
  1686.         return $this->numeroFactura??'-';
  1687.     }
  1688.     public function getTotalCompra(): ?string
  1689.     {
  1690.         return $this->totalCompra;
  1691.     }
  1692.     public function setTotalCompra(?string $totalCompra): self
  1693.     {
  1694.         $this->totalCompra $totalCompra;
  1695.         return $this;
  1696.     }
  1697.     public function getFechaEmisionCompra(): ?\DateTimeInterface
  1698.     {
  1699.         return $this->fechaEmisionCompra;
  1700.     }
  1701.     public function setFechaEmisionCompra(?\DateTimeInterface $fechaEmisionCompra): self
  1702.     {
  1703.         $this->fechaEmisionCompra $fechaEmisionCompra;
  1704.         return $this;
  1705.     }
  1706.     public function getFechaCobroCompra(): ?\DateTimeInterface
  1707.     {
  1708.         return $this->fechaCobroCompra;
  1709.     }
  1710.     public function setFechaCobroCompra(?\DateTimeInterface $fechaCobroCompra): self
  1711.     {
  1712.         $this->fechaCobroCompra $fechaCobroCompra;
  1713.         return $this;
  1714.     }
  1715.     public function getEstadoCompra(): ?EstadoCompraFactura
  1716.     {
  1717.         return $this->estadoCompra;
  1718.     }
  1719.     public function setEstadoCompra(?EstadoCompraFactura $estadoCompra): self
  1720.     {
  1721.         $this->estadoCompra $estadoCompra;
  1722.         return $this;
  1723.     }
  1724.     public function getPrecioCompraEnergiaP1(): ?string
  1725.     {
  1726.         return $this->precioCompraEnergiaP1;
  1727.     }
  1728.     public function setPrecioCompraEnergiaP1(?string $precioCompraEnergiaP1): self
  1729.     {
  1730.         $this->precioCompraEnergiaP1 $precioCompraEnergiaP1;
  1731.         return $this;
  1732.     }
  1733.     public function getPrecioCompraEnergiaP2(): ?string
  1734.     {
  1735.         return $this->precioCompraEnergiaP2;
  1736.     }
  1737.     public function setPrecioCompraEnergiaP2(?string $precioCompraEnergiaP2): self
  1738.     {
  1739.         $this->precioCompraEnergiaP2 $precioCompraEnergiaP2;
  1740.         return $this;
  1741.     }
  1742.     public function getPrecioCompraEnergiaP3(): ?string
  1743.     {
  1744.         return $this->precioCompraEnergiaP3;
  1745.     }
  1746.     public function setPrecioCompraEnergiaP3(?string $precioCompraEnergiaP3): self
  1747.     {
  1748.         $this->precioCompraEnergiaP3 $precioCompraEnergiaP3;
  1749.         return $this;
  1750.     }
  1751.     public function getPrecioCompraEnergiaP4(): ?string
  1752.     {
  1753.         return $this->precioCompraEnergiaP4;
  1754.     }
  1755.     public function setPrecioCompraEnergiaP4(?string $precioCompraEnergiaP4): self
  1756.     {
  1757.         $this->precioCompraEnergiaP4 $precioCompraEnergiaP4;
  1758.         return $this;
  1759.     }
  1760.     public function getPrecioCompraEnergiaP5(): ?string
  1761.     {
  1762.         return $this->precioCompraEnergiaP5;
  1763.     }
  1764.     public function setPrecioCompraEnergiaP5(?string $precioCompraEnergiaP5): self
  1765.     {
  1766.         $this->precioCompraEnergiaP5 $precioCompraEnergiaP5;
  1767.         return $this;
  1768.     }
  1769.     public function getPrecioCompraEnergiaP6(): ?string
  1770.     {
  1771.         return $this->precioCompraEnergiaP6;
  1772.     }
  1773.     public function setPrecioCompraEnergiaP6(?string $precioCompraEnergiaP6): self
  1774.     {
  1775.         $this->precioCompraEnergiaP6 $precioCompraEnergiaP6;
  1776.         return $this;
  1777.     }
  1778.     public function getPrecioCompraPotenciaP1(): ?string
  1779.     {
  1780.         return $this->precioCompraPotenciaP1;
  1781.     }
  1782.     public function setPrecioCompraPotenciaP1(?string $precioCompraPotenciaP1): self
  1783.     {
  1784.         $this->precioCompraPotenciaP1 $precioCompraPotenciaP1;
  1785.         return $this;
  1786.     }
  1787.     public function getPrecioCompraPotenciaP2(): ?string
  1788.     {
  1789.         return $this->precioCompraPotenciaP2;
  1790.     }
  1791.     public function setPrecioCompraPotenciaP2(?string $precioCompraPotenciaP2): self
  1792.     {
  1793.         $this->precioCompraPotenciaP2 $precioCompraPotenciaP2;
  1794.         return $this;
  1795.     }
  1796.     public function getPrecioCompraPotenciaP3(): ?string
  1797.     {
  1798.         return $this->precioCompraPotenciaP3;
  1799.     }
  1800.     public function setPrecioCompraPotenciaP3(?string $precioCompraPotenciaP3): self
  1801.     {
  1802.         $this->precioCompraPotenciaP3 $precioCompraPotenciaP3;
  1803.         return $this;
  1804.     }
  1805.     public function getPrecioCompraPotenciaP4(): ?string
  1806.     {
  1807.         return $this->precioCompraPotenciaP4;
  1808.     }
  1809.     public function setPrecioCompraPotenciaP4(?string $precioCompraPotenciaP4): self
  1810.     {
  1811.         $this->precioCompraPotenciaP4 $precioCompraPotenciaP4;
  1812.         return $this;
  1813.     }
  1814.     public function getPrecioCompraPotenciaP5(): ?string
  1815.     {
  1816.         return $this->precioCompraPotenciaP5;
  1817.     }
  1818.     public function setPrecioCompraPotenciaP5(?string $precioCompraPotenciaP5): self
  1819.     {
  1820.         $this->precioCompraPotenciaP5 $precioCompraPotenciaP5;
  1821.         return $this;
  1822.     }
  1823.     public function getPrecioCompraPotenciaP6(): ?string
  1824.     {
  1825.         return $this->precioCompraPotenciaP6;
  1826.     }
  1827.     public function setPrecioCompraPotenciaP6(?string $precioCompraPotenciaP6): self
  1828.     {
  1829.         $this->precioCompraPotenciaP6 $precioCompraPotenciaP6;
  1830.         return $this;
  1831.     }
  1832.     public function getAlquilerEquiposReal(): ?string
  1833.     {
  1834.         return $this->alquilerEquiposReal;
  1835.     }
  1836.     public function setAlquilerEquiposReal(?string $alquilerEquiposReal): self
  1837.     {
  1838.         $this->alquilerEquiposReal $alquilerEquiposReal;
  1839.         return $this;
  1840.     }
  1841.     public function getTotalCompraFactura(): ?string
  1842.     {
  1843.         return $this->totalCompraFactura;
  1844.     }
  1845.     public function setTotalCompraFactura(?string $totalCompraFactura): self
  1846.     {
  1847.         $this->totalCompraFactura $totalCompraFactura;
  1848.         return $this;
  1849.     }
  1850.     public function getRentable(): ?bool
  1851.     {
  1852.         return $this->rentable;
  1853.     }
  1854.     public function setRentable(?bool $rentable): self
  1855.     {
  1856.         $this->rentable $rentable;
  1857.         return $this;
  1858.     }
  1859.     public function getFechaDevolucion(): ?\DateTimeInterface
  1860.     {
  1861.         return $this->fechaDevolucion;
  1862.     }
  1863.     public function setFechaDevolucion(?\DateTimeInterface $fechaDevolucion): self
  1864.     {
  1865.         $this->fechaDevolucion $fechaDevolucion;
  1866.         return $this;
  1867.     }
  1868.     /**
  1869.      * @return Collection<int, Fraccionamiento>
  1870.      */
  1871.     public function getFraccionamientos(): Collection
  1872.     {
  1873.         return $this->fraccionamientos;
  1874.     }
  1875.     public function addFraccionamiento(Fraccionamiento $fraccionamiento): self
  1876.     {
  1877.         if (!$this->fraccionamientos->contains($fraccionamiento)) {
  1878.             $this->fraccionamientos[] = $fraccionamiento;
  1879.             $fraccionamiento->addFactura($this);
  1880.         }
  1881.         return $this;
  1882.     }
  1883.     public function removeFraccionamiento(Fraccionamiento $fraccionamiento): self
  1884.     {
  1885.         if ($this->fraccionamientos->removeElement($fraccionamiento)) {
  1886.             $fraccionamiento->removeFactura($this);
  1887.         }
  1888.         return $this;
  1889.     }
  1890.     public function getEstado(): ?EstadoFactura
  1891.     {
  1892.         return $this->estado;
  1893.     }
  1894.     public function setEstado(?EstadoFactura $estado): self
  1895.     {
  1896.         $this->estado $estado;
  1897.         return $this;
  1898.     }
  1899.     public function getImportePagado(): ?string
  1900.     {
  1901.         return $this->importePagado;
  1902.     }
  1903.     public function setImportePagado(?string $importePagado): self
  1904.     {
  1905.         $this->importePagado $importePagado;
  1906.         return $this;
  1907.     }
  1908.     public function isLogoHosteleria(): ?bool
  1909.     {
  1910.         return $this->logoHosteleria;
  1911.     }
  1912.     public function setLogoHosteleria(?bool $logoHosteleria): self
  1913.     {
  1914.         $this->logoHosteleria $logoHosteleria;
  1915.         return $this;
  1916.     }
  1917.     public function getImporteBateriaVirtual(): ?string
  1918.     {
  1919.         return $this->importeBateriaVirtual;
  1920.     }
  1921.     public function setImporteBateriaVirtual(?string $importeBateriaVirtual): self
  1922.     {
  1923.         $this->importeBateriaVirtual $importeBateriaVirtual;
  1924.         return $this;
  1925.     }
  1926.     public function isBateriaVirtual(): ?bool
  1927.     {
  1928.         return $this->bateriaVirtual;
  1929.     }
  1930.     public function setBateriaVirtual(?bool $bateriaVirtual): self
  1931.     {
  1932.         $this->bateriaVirtual $bateriaVirtual;
  1933.         return $this;
  1934.     }
  1935. }