Dr-Panel/resources/views/exports/visits-pdf.blade.php

62 lines
3.2 KiB
PHP

<!DOCTYPE html>
<html dir="rtl" lang="fa">
<head>
<meta charset="UTF-8">
<style>
* { font-family: 'tahoma', sans-serif; }
body { font-size: 11px; direction: rtl; margin: 0; padding: 0; color: #333; }
h1 { font-size: 16px; text-align: center; margin-bottom: 4px; color: #1e40af; font-weight: bold; }
.subtitle { text-align: center; color: #6b7280; font-size: 10px; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th { background-color: #1e40af; color: #ffffff; padding: 6px 6px; text-align: right; font-size: 10px; font-weight: bold; border: 1px solid #1e3a8a; }
th.col-num { text-align: center; width: 25px; }
td { padding: 5px 6px; border: 1px solid #e5e7eb; font-size: 10px; text-align: right; }
td.col-num { text-align: center; }
td.col-money { text-align: left; direction: ltr; }
td.remained { color: #dc2626; font-weight: bold; }
td.paid-full { color: #16a34a; }
tr:nth-child(even) td { background-color: #f9fafb; }
.footer { margin-top: 14px; text-align: center; font-size: 9px; color: #9ca3af; }
</style>
</head>
<body>
<h1>{{ __('navigation.visits.title') }}</h1>
<div class="subtitle">{{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d') }}</div>
<table>
<thead>
<tr>
<th class="col-num">#</th>
<th>{{ __('visits.fields.visit_date') }}</th>
<th>{{ __('visits.fields.patient') }}</th>
<th>{{ __('visits.fields.doctor') }}</th>
<th>{{ __('visits.fields.treatment') }}</th>
<th>{{ __('visits.fields.treatment_cost') }}</th>
<th>{{ __('visits.fields.paid_amount') }}</th>
<th>{{ __('visits.fields.remained_amount') }}</th>
<th>{{ __('visits.fields.payment_type') }}</th>
</tr>
</thead>
<tbody>
@foreach ($records as $index => $item)
@php $remained = (int)($item->treatment_cost ?? 0) - (int)($item->paid_amount ?? 0); @endphp
<tr>
<td class="col-num">{{ $index + 1 }}</td>
<td>{{ $item->visit_date ?? '-' }}</td>
<td>{{ $item->patientRecord?->full_name ?? '-' }}</td>
<td>{{ $item->doctorRecord?->full_name ?? '-' }}</td>
<td>{{ $item->treatmentRecord ? ($item->treatmentRecord->treatment_name ?: $item->treatmentRecord->treatment_type) : '-' }}</td>
<td class="col-money">{{ $item->treatment_cost !== null ? number_format((int)$item->treatment_cost) : '-' }}</td>
<td class="col-money">{{ $item->paid_amount !== null ? number_format((int)$item->paid_amount) : '-' }}</td>
<td class="col-money {{ $remained > 0 ? 'remained' : 'paid-full' }}">{{ number_format($remained) }}</td>
<td>{{ $item->paymentTypeRecord?->payment_type ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="footer">
{{ __('navigation.visits.title') }} &mdash; {{ \Morilog\Jalali\Jalalian::now()->format('Y/m/d H:i') }}
</div>
</body>
</html>