Skip to content

Commit

Permalink
Fix: report trait numeric value
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoftpy committed Oct 21, 2021
1 parent 7b03b1f commit e4d2a88
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/ReporteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1257,14 +1257,14 @@ public function cargosReportExcel(Request $request){

switch ($key) {
case 'detalle_universo':
$this->CargaDetalle($item, $itemArray);
$this->CargaDetalle($item, $itemArray, $empresa);
break;

case 'detalle_nacional':
$this->CargaDetalle($item, $itemArrayNac);
$this->CargaDetalle($item, $itemArrayNac, $empresa);
break;
case 'detalleInternacional':
$this->CargaDetalle($item, $itemArrayInt);
$this->CargaDetalle($item, $itemArrayInt, $empresa);
break;
}

Expand Down
23 changes: 18 additions & 5 deletions app/Traits/ReportTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public function countEmergentesSegmento($rubro, $subRubro, $periodo){
}
return $count;
}
public function cargaDetalle($item, &$itemArray){
public function cargaDetalle($item, &$itemArray, $empresa){

$variableAnual = false;
$efectivoTotal = false;
$efectivoGarantizado = false;
$salarioEmpresa = 0;
$variableAnualEmp = 0;
//dd($item, $itemArray);
// dd($item, $itemArray);
foreach ($item as $key => $value) {
switch ($value["Concepto"]) {
case "Comision":
Expand All @@ -65,6 +65,7 @@ public function cargaDetalle($item, &$itemArray){
case Lang::get('reportReport.concept_annual_cash'):
$efectivoGarantizado = true;
$this->cargador($value, $itemArray, false);

break;
case Lang::get('reportReport.concept_variable_pay'):
$variableAnual = true;
Expand All @@ -88,7 +89,9 @@ public function cargaDetalle($item, &$itemArray){

}
}

/* if($itemArray[0] == "ANALISTA DE SISTEMAS - BANCA DIGITAL - PLENO "){
dd($itemArray, $item, $empresa);
} */
// comparativo salario base
if($itemArray[4] > 0){
$compMinSal = round($salarioEmpresa/$itemArray[4] - 1, 2);
Expand Down Expand Up @@ -304,7 +307,12 @@ public function cargaDetalle($item, &$itemArray){
$ratioSalBaseTotalEfectivo75 = 0;
}
if($itemArray[15] > 0){
$ratioSalBaseTotalEfectivoMax = round(($itemArray[9]*12)/$itemArray[15], 2);
if(!$itemArray[9] == ""){
$ratioSalBaseTotalEfectivoMax = round(($itemArray[9]*12)/$itemArray[15], 2);
}else{
$ratioSalBaseTotalEfectivoMax = 0;
}

}else{
$ratioSalBaseTotalEfectivoMax = 0;
}
Expand Down Expand Up @@ -362,13 +370,18 @@ public function cargador($value, &$itemArray, $casos){
array_push($itemArray, $value["ocupantes"]);
array_push($itemArray, $value["Casos"]);
}

//array_push($itemArray, $value["Concepto"]);
array_push($itemArray, $value["Min"]);
array_push($itemArray, $value["25 Percentil"]);
array_push($itemArray, round($value["Promedio"], 2));
array_push($itemArray, $value["Mediana"]);
array_push($itemArray, $value["75 Percentil"]);
array_push($itemArray, $value["Max"]);
array_push($itemArray, $value["Max"]);

/* if($itemArray[0] == "ANALISTA DE SISTEMAS - BANCA DIGITAL - PLENO "){
dd($itemArray);
} */
}


Expand Down

0 comments on commit e4d2a88

Please sign in to comment.