update
This commit is contained in:
@@ -95,6 +95,8 @@ class ShowPromociones extends Component
|
|||||||
public $img_ver;
|
public $img_ver;
|
||||||
public $fecha_editarPromo;
|
public $fecha_editarPromo;
|
||||||
public $mensaje_servicio;
|
public $mensaje_servicio;
|
||||||
|
|
||||||
|
public $utilidad;
|
||||||
|
|
||||||
|
|
||||||
public $categoria_photo;
|
public $categoria_photo;
|
||||||
@@ -176,6 +178,7 @@ class ShowPromociones extends Component
|
|||||||
//$this->precioAntes = $consulta_verpromocion->tarifas->first()->valor;
|
//$this->precioAntes = $consulta_verpromocion->tarifas->first()->valor;
|
||||||
|
|
||||||
$this->precioAhora = $consulta_verpromocion->precio;
|
$this->precioAhora = $consulta_verpromocion->precio;
|
||||||
|
$this->utilidad = $consulta_verpromocion->utilidad ?? '';
|
||||||
$this->imagen = $consulta_verpromocion->img_publicidad;
|
$this->imagen = $consulta_verpromocion->img_publicidad;
|
||||||
$this->fechaLimite = $consulta_verpromocion->fecha_limite;
|
$this->fechaLimite = $consulta_verpromocion->fecha_limite;
|
||||||
$this->nombrePromo = $consulta_verpromocion->nombre;
|
$this->nombrePromo = $consulta_verpromocion->nombre;
|
||||||
@@ -224,6 +227,7 @@ class ShowPromociones extends Component
|
|||||||
$historial->cliente_id = $usuario_id;
|
$historial->cliente_id = $usuario_id;
|
||||||
$historial->cantidad = $this->cantidad_comprarPromo;
|
$historial->cantidad = $this->cantidad_comprarPromo;
|
||||||
$historial->nombre_cliente = $this->nombre_comprarPromo;
|
$historial->nombre_cliente = $this->nombre_comprarPromo;
|
||||||
|
$historial->utilidad = $this->utilidad*$this->cantidad_comprarPromo;
|
||||||
$historial->save();
|
$historial->save();
|
||||||
|
|
||||||
for ($p = 0; $p < (int)$this->cantidad_comprarPromo; $p++) {
|
for ($p = 0; $p < (int)$this->cantidad_comprarPromo; $p++) {
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class ShowServicios extends Component
|
|||||||
public $verServ;
|
public $verServ;
|
||||||
public $fecha_final_1;
|
public $fecha_final_1;
|
||||||
public $fecha_final_2;
|
public $fecha_final_2;
|
||||||
|
public $utilidad;
|
||||||
|
|
||||||
use LivewireAlert;
|
use LivewireAlert;
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
@@ -168,6 +169,7 @@ class ShowServicios extends Component
|
|||||||
->first();
|
->first();
|
||||||
|
|
||||||
$this->valor_tarjetaPlan = ($usuario_tarifa) ? $usuario_tarifa->precio : $this->tarifas->valor;
|
$this->valor_tarjetaPlan = ($usuario_tarifa) ? $usuario_tarifa->precio : $this->tarifas->valor;
|
||||||
|
$this->utilidad = ($usuario_tarifa) ? $usuario_tarifa->utilidad : $this->tarifas->utilidad;
|
||||||
|
|
||||||
$this->colorFondo_tarjetaPlan = $this->servicio_t->color_fondo;
|
$this->colorFondo_tarjetaPlan = $this->servicio_t->color_fondo;
|
||||||
$this->fechaFinal = $this->fechaActual->addDay($this->tarifas->dias);
|
$this->fechaFinal = $this->fechaActual->addDay($this->tarifas->dias);
|
||||||
@@ -231,6 +233,7 @@ class ShowServicios extends Component
|
|||||||
|
|
||||||
$cantidad_solicitada = (int) $this->cantidad_tarjetaPlan * (int) $this->pantallas_tarjetaPlan;
|
$cantidad_solicitada = (int) $this->cantidad_tarjetaPlan * (int) $this->pantallas_tarjetaPlan;
|
||||||
$total_valor = (int) $this->valor_tarjetaPlan * (int) $this->cantidad_tarjetaPlan;
|
$total_valor = (int) $this->valor_tarjetaPlan * (int) $this->cantidad_tarjetaPlan;
|
||||||
|
$utilidad_total = (int) $this->utilidad * (int) $this->cantidad_tarjetaPlan;
|
||||||
|
|
||||||
$usuario_existe = User::firstWhere('email', $this->email_tarjetaPlan)->id ?? null;
|
$usuario_existe = User::firstWhere('email', $this->email_tarjetaPlan)->id ?? null;
|
||||||
$usuario_id = $usuario_existe;
|
$usuario_id = $usuario_existe;
|
||||||
@@ -258,6 +261,7 @@ class ShowServicios extends Component
|
|||||||
$historial->cliente_id = $usuario_id;
|
$historial->cliente_id = $usuario_id;
|
||||||
$historial->cantidad = $this->cantidad_tarjetaPlan;
|
$historial->cantidad = $this->cantidad_tarjetaPlan;
|
||||||
$historial->nombre_cliente = $this->nombre_tarjetaPlan;
|
$historial->nombre_cliente = $this->nombre_tarjetaPlan;
|
||||||
|
$historial->utilidad = $utilidad_total;
|
||||||
$historial->save();
|
$historial->save();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user