Skip to content

Commit

Permalink
Fix: Ficha en excel universo cargos
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoftpy committed Sep 22, 2020
1 parent f814113 commit 5f3d1d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/Http/Controllers/ReporteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,19 @@ public function cargoReportClubExcel(Request $request){
$per = Session::get('periodo');
$dbEncuesta = Cabecera_encuesta::where('empresa_id', $dbEmpresa->id)->whereRaw("periodo = '". $per."'")->first();
}else{
$dbEncuesta = Cabecera_encuesta::where('empresa_id', $dbEmpresa->id)->whereRaw('id = (select max(id) from cabecera_encuestas where empresa_id = '. $dbEmpresa->id.')')->first();
$dbFicha = Ficha_dato::activa()
->where('rubro_id', $dbEmpresa->rubro_id)
->first();
if($dbFicha){
$periodo = $dbFicha->periodo;
$dbEncuesta = Cabecera_encuesta::where('empresa_id', $dbEmpresa->id)
->where('periodo', $periodo)->first();
}else{
$dbEncuesta = Cabecera_encuesta::where('empresa_id', $dbEmpresa->id)
->whereRaw('id = (select max(id) from cabecera_encuestas where empresa_id = '. $dbEmpresa->id.')')
->first();
}

}
$reporteEspecial = Session::get('especial');
// periodo de la encuesta actual (semestral para navieras)
Expand Down
1 change: 1 addition & 0 deletions app/Traits/ReportTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3396,6 +3396,7 @@ public function getCargosHomologados($rubro, $periodo){
}

public function excelClubCargos($detalleUniverso, $detalleNacional, $detalleInternacional, $rubro, $filename, $cubo = false){

Excel::create($filename, function($excel) use($detalleUniverso, $detalleNacional, $detalleInternacional, $rubro, $cubo) {
// hoja universo
$excel->sheet("universo", function($sheet) use($detalleUniverso, $rubro, $cubo){
Expand Down

0 comments on commit 5f3d1d7

Please sign in to comment.