Treatment Wise Report

Generated: {{ isset($generatedAt) ? $generatedAt : date('Y-m-d H:i') }}

@if(isset($dateFrom) && isset($dateTo) && $dateFrom && $dateTo && $dateFrom !== $dateTo) Period: {{ $dateFrom }} to {{ $dateTo }} @elseif(isset($dateFrom) && $dateFrom) Date: {{ $dateFrom }} @endif

{{-- Summary Section --}} @if(isset($summary) && is_array($summary))

Summary

Total Treatments Gross Total Doctor Discount Net Total
{{ isset($summary['count']) ? $summary['count'] : 0 }} {{ isset($summary['gross']) ? number_format($summary['gross'], 2) : '0.00' }} {{ isset($summary['discount']) ? number_format($summary['discount'], 2) : '0.00' }} {{ isset($summary['net']) ? number_format($summary['net'], 2) : '0.00' }}
@endif {{-- Transaction Details Table --}} @if(isset($rows) && is_array($rows) && count($rows) > 0)

Treatment Details

@php $totalGross = 0; $totalDiscount = 0; $totalNet = 0; @endphp @foreach ($rows as $r) @php $totalGross += (float)($r['gross'] ?? 0); $totalDiscount += (float)($r['doctor_discount'] ?? 0); $totalNet += (float)($r['net_total'] ?? 0); @endphp @endforeach
Invoice # Date Department Patient Procedures Gross Dr Discount Net Doctor
{{ $r['invoice_number'] ?? '' }} {{ $r['invoice_date'] ?? '' }} {{ $r['department_name'] ?? '' }} {{ $r['patient_name'] ?? '' }} {{ str_replace("\n", '; ', $r['procedures'] ?? '') }} {{ number_format($r['gross'] ?? 0, 2) }} {{ number_format($r['doctor_discount'] ?? 0, 2) }} {{ number_format($r['net_total'] ?? 0, 2) }} {{ $r['doctor'] ?? '' }}
Total {{ number_format($totalGross, 2) }} {{ number_format($totalDiscount, 2) }} {{ number_format($totalNet, 2) }}
@else

No treatments found for the selected period.

@endif