Skip to content

Commit

Permalink
Acerto da exibição do saldo
Browse files Browse the repository at this point in the history
  • Loading branch information
alecostaweb committed Dec 20, 2023
1 parent 6bbdf55 commit 4148484
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions resources/views/pessoas/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,17 @@ class="btn btn-secondary"><i class="fa fa-solid fa-arrow-right"></i> Próximo</a
$total_horas = (!empty($arrayTotal)) ? trim(substr($arrayTotal[0], 0, 2)) : 0;
$total_minutos = (!empty($arrayTotal[1])) ? trim(substr($arrayTotal[1], 0, 2)) : 0;
$total_registrado = (!empty($total)) ? $total : '0 horas';
$sdh = $carga_horaria_total - $total_horas;
$sdm = 0 - $total_minutos;
if ($sdm < 0) {
$sdm = $sdm * -1;
}
if ($sdh > 0) {
$sdm = 60 - $total_minutos;
}
if ($sdm == 60) {
$sdm = 0;
}
if ($sdh > 0 && $sdm > 0) {
$sdh = $sdh - 1;
}
$sdt = "$sdh horas";
if ($sdm > 0) {
$sdt = $sdt . " $sdm minutos";
}
$carga_horaria_total_minutos = $carga_horaria_total * 60;
$total_registrado_minutos = ($total_horas * 60) + $total_minutos;
$saldo_minutos = $total_registrado_minutos - $carga_horaria_total_minutos;
$saldo = App\Utils\Util::formatMinutes(abs($saldo_minutos));
@endphp

<strong>Carga horária semanal:</strong> {{ $carga_horaria_semanal }} horas<br />
<strong>Quantidade de dias úteis:</strong> {{ $quantidade_dias_uteis }} <br />
<strong>Carga horária total: </strong>{{ $carga_horaria_total }} horas<br>
<strong>Total registrado: </strong>{{ $total_registrado }} <br />
<strong>Saldo:</strong> <span @if ($total_horas < $carga_horaria_total) style="color: #f00;" @endif>{{ $sdt }}</span>
<strong>Saldo:</strong> <span @if ($total_horas < $carga_horaria_total) style="color: #f00;" @endif>{{ $saldo }}</span>

<br /><br />

Expand Down

0 comments on commit 4148484

Please sign in to comment.