Asignar campo utilidad
This commit is contained in:
@@ -34,6 +34,7 @@ class ShowPlanes extends Component
|
||||
public $roles_modTarifas;
|
||||
public $pantallas_modTarifas;
|
||||
public $precio_modTarifas = 0;
|
||||
public $utilidad = 0;
|
||||
|
||||
public $estadoTarifa = true;
|
||||
public $diasTarifa = '30';
|
||||
@@ -370,11 +371,16 @@ class ShowPlanes extends Component
|
||||
$this->alert('warning', '¡Coloque un precio!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
} elseif (empty($this->utilidad)) {
|
||||
$this->alert('warning', '¡Coloque la utilidad!', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
} else {
|
||||
$tarifa = new Tarifas;
|
||||
$tarifa->pantallas = $this->pantallas_modTarifas;
|
||||
$tarifa->dias = $this->diasTarifa;
|
||||
$tarifa->valor = $this->precio_modTarifas;
|
||||
$tarifa->utilidad = $this->utilidad;
|
||||
$tarifa->estado = $this->estadoTarifa ? 'activo' : 'inactivo';
|
||||
$tarifa->servicio_id = $this->servicio_modTarifas;
|
||||
$tarifa->rol_id = $this->roles_modTarifas;
|
||||
@@ -512,6 +518,7 @@ class ShowPlanes extends Component
|
||||
$this->roles_modTarifas = $tarifa['rol_id'];
|
||||
$this->pantallas_modTarifas = $tarifa['pantallas'];
|
||||
$this->precio_modTarifas = $tarifa['valor'];
|
||||
$this->utilidad = $tarifa['utilidad'];
|
||||
$this->diasTarifa = $tarifa['dias'];
|
||||
$this->estadoTarifa = $tarifa['estado'];
|
||||
$this->servicio_modTarifas = $tarifa['servicio_id'];
|
||||
@@ -523,6 +530,7 @@ class ShowPlanes extends Component
|
||||
'roles_modTarifas'=> 'required',
|
||||
'pantallas_modTarifas' => 'required',
|
||||
'precio_modTarifas'=> 'required',
|
||||
'utilidad'=> 'required',
|
||||
'diasTarifa' => 'required',
|
||||
'estadoTarifa'=> 'required'
|
||||
]);
|
||||
@@ -530,6 +538,7 @@ class ShowPlanes extends Component
|
||||
'pantallas' => $this->pantallas_modTarifas,
|
||||
'dias' => $this->diasTarifa,
|
||||
'valor'=> $this->precio_modTarifas,
|
||||
'utilidad'=> $this->utilidad,
|
||||
'estado'=> $this->estadoTarifa,
|
||||
'rol_id' => $this->roles_modTarifas,
|
||||
'servicio_id' => $this->servicio_modTarifas
|
||||
|
||||
Reference in New Issue
Block a user