Skip to content

Commit

Permalink
multiple changes from the begining of times
Browse files Browse the repository at this point in the history
  • Loading branch information
elyambay committed Aug 23, 2018
1 parent a734573 commit 5295a1d
Show file tree
Hide file tree
Showing 387 changed files with 85,858 additions and 8,521 deletions.
7 changes: 6 additions & 1 deletion app/Cargo.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ public function encuestasCargo(){
return $this->hasMany("App\Encuestas_cargo");
}

public function cargosRubro(){
return $this->hasMany("App\Cargos_rubro");
}

public function area(){
return $this->belongsTo("App\Area");
}

public function nivel(){
return $this->belongsTo("App\Nivel");
}
}

}
23 changes: 23 additions & 0 deletions app/Cargos_rubro.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class cargos_rubro extends Model
{
protected $table = "cargos_rubros";

protected $fillable = ["cargo_id", "rubro_id"];

public function rubro(){
return $this->belongsTo("App\Rubro");
}

public function cargo(){
return $this->belongsTo("App\Cargo");
}



}
12 changes: 12 additions & 0 deletions app/Color.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Color extends Model
{
protected $table = "colores";

protected $fillable = ["color", "hexadecimal"];
}
48 changes: 46 additions & 2 deletions app/Detalle_encuesta.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Detalle_encuesta extends Model
{
protected $table = "detalle_encuestas";

protected $fillable = ['encuesta_cabecera_id',
protected $fillable = ['cabecera_encuesta_id',
'encuestas_cargo_id',
'cantidad_ocupantes',
'area_id',
Expand Down Expand Up @@ -100,6 +100,27 @@ public function zona(){
return $this->belongsTo("App\Zonas");
}

public function getAdicionalesBancosAttribute(){
$adicionales = $this->fallo_caja +
$this->fallo_caja_ext +
$this->comision +
$this->gratificacion_contrato +
$this->adicional_nivel_cargo +
$this->adicional_titulo;
return $adicionales;
}

public function getAdicionalesRestoAttribute(){
$adicionales = $this->fallo_caja +
$this->fallo_caja_ext +
$this->gratificacion_contrato +
$this->adicional_nivel_cargo +
$this->adicional_titulo;

return $adicionales;

}

public function getBeneficiosBancosAttribute(){
$beneficios = $this->refrigerio +
$this->costo_seguro_medico * ($this->cobertura_seguro_medico/100) +
Expand All @@ -122,6 +143,7 @@ public function getBeneficiosBancosAttribute(){
return $beneficios;
}


public function getBeneficiosNavierasAttribute(){
$beneficios = $this->refrigerio +
$this->costo_seguro_medico * ($this->cobertura_seguro_medico/100) +
Expand All @@ -138,8 +160,30 @@ public function getBeneficiosNavierasAttribute(){
$this->monto_post_grado * ($this->cobertura_post_grado/100)/ 24 +
$this->monto_celular_corporativo +
$this->monto_vivienda +
$this->monto_colegiatura_hijos;
$this->monto_colegiatura_hijos /12;

return $beneficios;
}

public function getBeneficiosRestoAttribute(){
$beneficios = $this->refrigerio +
$this->costo_seguro_medico * ($this->cobertura_seguro_medico/100) +
$this->costo_seguro_vida +
//$this->costo_poliza_muerte_accidente +
//$this->costo_poliza_muerte_natural +
$this->monto_movil / 60 +
$this->flota+
$this->seguro_movil +
$this->monto_km_recorrido +
$this->monto_ayuda_escolar +
$this->monto_comedor_interno +
$this->monto_curso_idioma * ($this->cobertura_curso_idioma/100) +
$this->monto_post_grado * ($this->cobertura_post_grado/100)/ 24 +
$this->monto_celular_corporativo +
$this->monto_vivienda +
$this->monto_colegiatura_hijos/12;

return $beneficios;
}

}
4 changes: 3 additions & 1 deletion app/Empresa.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class Empresa extends Model
{
protected $table = "empresas";

protected $fillable = ["descripcion", "cantidad_empleados", "cantidad_sucursales", "tipo", "rubro_id", "sub_rubro_id"];
protected $fillable = ["descripcion", "cantidad_empleados", "cantidad_sucursales", "tipo", "rubro_id", "sub_rubro_id", "listable"];

protected $casts = ["listable"=>"boolean"];


public function rubro(){
Expand Down
2 changes: 1 addition & 1 deletion app/Encuestas_cargo.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Encuestas_cargo extends Model
protected $casts = ["incluir" => "boolean", "revisado"=>"boolean"];

public function cabeceraEncuestas(){
return $this->belongsTo("App\Cabecera_encuesta");
return $this->belongsTo("App\Cabecera_encuesta", "cabecera_encuesta_id");
}

public function cargo(){
Expand Down
4 changes: 4 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public function report(Exception $exception)
*/
public function render($request, Exception $exception)
{
if ($exception instanceof \Illuminate\Session\TokenMismatchException){
return redirect()->route('login');
}

return parent::render($request, $exception);
}

Expand Down
16 changes: 16 additions & 0 deletions app/Ficha_dato.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Ficha_dato extends Model
{
protected $table = 'ficha_datos';

protected $fillable = ['rubro_id', 'periodo', 'tipo_cambio', 'cargos_emergentes'];

public function rubro(){
return $this->belongsTo('App\Rubro');
}
}
97 changes: 97 additions & 0 deletions app/Http/Controllers/Admin/ReportController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Cabecera_encuesta;
use App\Encuestas_cargo;
use App\Detalle_encuesta;
use App\Empresa;
use App\Cargo;

class ReportController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$dbEmpresas = empresa::pluck('descripcion', 'id');
$dbCargos = Cargo::pluck('descripcion', 'id');

return view('admin.reportes.filter_empresas')->with('dbEmpresas', $dbEmpresas)
->with('dbCargos', $dbCargos);

}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
//
}


/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
}

/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
return redirect()->route('reportes.show', $id);
}

/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}

/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}

/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}

}
Loading

0 comments on commit 5295a1d

Please sign in to comment.