function getLiquidaciones($fecha) { include_once "getHoras.php"; include_once "getValorHora.php"; include_once "getExtras.php"; include_once "getTM.php"; include_once dirname(__FILE__) . '/../conexionLocal.php'; $result = array(); //inicializa array result $getTM = getTM(); foreach ($getTM as $info) { $rut = $info['Rut']; $sumaLiquidacion = 0; $contador = 0; $horasRealizadas = getHoras($rut, $fecha); if ($horasRealizadas) { foreach ($horasRealizadas as $horas) { if ($horas['Semana'] == 7) { $semana = 0; } else { $semana = 1; } $valoresHora = getValorHora($rut); if ($valoresHora) { foreach ($valoresHora as $valor) { // aqui hay que hacer la confirmacion y multiplicacion if ($valor['Empresa'] == $horas['NombreEmpresa'] && $semana == $valor['Semana']) { $sumaLiquidacion += $valor['Valor'] * $horas['Horas']; } } } if ($contador == 0) { $contador++; $extrasTM = getExtras($rut, $fecha); if ($extrasTM) { foreach ($extrasTM as $extra) { // aqui se suman los extras del tm $sumaLiquidacion += $extra['Monto']; } } } } //echo $horas ['TMNombre']; //echo $sumaLiquidacion; //echo "<br>"; if ($sumaLiquidacion != 0) { $nombre = $horas['TMNombre'] . " " . $horas['TMApellido']; $rut = $info['Rut']; $result[$rut][] = $nombre; $result[$rut][] = $sumaLiquidacion; } } } return $result; }
include_once "../querys/getValorHora.php"; include_once "../querys/getExtras.php"; if ($_SESSION["usuario"]) { if (isAdmin($_SESSION["idusuario"], $_SESSION["context"]) == 1) { $admin = 1; } else { $admin = 0; } } $mes = $_POST['mes']; $rut = $_POST['rut']; echo "<br>"; //div en caso de errores ( horasRealizadas sin valoresHora asociadas) echo "<div id='errores'></div>"; //aqui parte Resumen Fecha y TM $Horas = getHoras($rut, $mes); echo "<table id='t01' class='table table-hover table-bordered table-condensed table-responsive' style='max-width:80%; white-space: nowrap'>"; echo "<thead><tr class='primary'>"; echo "<th>Fecha: "; echo "<span id='mes'>" . Mes($Horas[0]['Mes']) . "</span>"; echo " "; echo "<span id='year'>" . $Horas[0]['Year'] . "</span>"; echo "</th>"; echo "</tr></thead>"; echo "<thead><tr class='primary'>"; echo "<th>TM: "; echo $Horas[0]['TMNombre']; echo " " . $Horas[0]['TMApellido']; echo " </th>"; echo "</thead></tr>"; // Aqui termina Resumen Fecha y TM