Files
rkm-conectasus-ci-sandbox/api/resources/views/impressoes/template/farmacia/relatorio-alto-custo-processo-paciente.blade.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

119 lines
3.5 KiB
PHP

@extends('impressoes.layout1.content')
@section('conteudo')
<style>
.table-relatorio { border: 1px solid #222222; }
.table-relatorio td,
.table-relatorio th { border: 1px solid #222; padding: 5px; vertical-align: middle; }
.table-relatorio th { background: rgba(0,0,0,0.2); text-align: center; }
.row-even { background: rgba(0,0,0,0.1) }
.col-min { width: 1%; }
.text-center { text-align: center; }
</style>
<fieldset>
<legend>Filtros</legend>
<div class="row">
<div class="col-6">
<strong>Unidade:</strong>
</div>
<div class="col-6">
<strong>Local de atendimento:</strong>
</div>
</div>
<div class="row">
<div class="col-6">
{{ $unidade }}
</div>
<div class="col-6">
{{ $infraestrutura }}
</div>
</div>
<div class="row">
<div class="col-6">
<strong>Setor:</strong>
</div>
<div class="col-6">
<strong>Material:</strong>
</div>
</div>
<div class="row">
<div class="col-6">
{{ $setor }}
</div>
<div class="col-6">
{{ $material }}
</div>
</div>
<div class="row">
<div class="col-6">
<strong>Paciente:</strong>
</div>
</div>
<div class="row">
<div class="col-6">
{{ $paciente }}
</div>
</div>
</fieldset>
<table class="table-relatorio">
<thead>
<tr>
@foreach ($colunas as $coluna)
<th class="{{ $coluna['class'] }}">{{ $coluna['label'] }}</th>
@endforeach
</tr>
</thead>
<tbody>
@foreach ($itens as $key => $item)
@php
$rowClass = $key % 2 === 0 ? 'row-even' : 'row-odd';
$rowspanPaciente = 0;
$item->materiais->each(function ($material) use (&$rowspanPaciente) {
$rowspanPaciente += $material->retiradas->count();
});
@endphp
@foreach ($item->materiais as $i => $material)
<tr class="{{ $rowClass }}">
@if ($i == 0)
<td rowspan="{{ $rowspanPaciente }}">{{ $item->paciente_nome }}</td>
@if(!is_null($colunas->where('key', 'paciente_prontuario')->first()))
<td rowspan="{{ $rowspanPaciente }}" class="text-center">{{ $item->paciente_prontuario }}</td>
@endif
@if(!is_null($colunas->where('key', 'paciente_prontuario_unidade')->first()))
<td rowspan="{{ $rowspanPaciente }}" class="text-center">{{ $item->paciente_prontuario_unidade ?? '-' }}</td>
@endif
@endif
<td rowspan="{{ $material->retiradas->count() }}" class="text-center">{{ $material->data_primeira_retirada }}</td>
<td rowspan="{{ $material->retiradas->count() }}">{{ $material->material_descricao }}</td>
<td class="text-center">{{ $material->retiradas[0] }}</td>
</tr>
@foreach ($material->retiradas as $j => $retirada)
@if ($j > 0)
<tr class="{{ $rowClass }}">
<td class="text-center">{{ $retirada }}</td>
</tr>
@endif
@endforeach
@endforeach
@endforeach
</tbody>
</table>
@endsection