@if ($billing->branch_id == 3) @else @endif @php $overall_cost = 0; @endphp {{-- FOR BGL BILLING OUTPUT --}} @if ($billing->branch_id == 3) @foreach ($billing->invoices as $inv) @php $inv = $inv->invoice; $total_cost = 0; $overall_cost += $inv->total; @endphp @endforeach @foreach ($invoices as $inv) @php $total_cost = 0; @endphp @endforeach @else @foreach ($billing->invoices as $inv) @php $inv = $inv->invoice; $total_cost = 0; $overall_cost += $inv->total; @endphp @endforeach @foreach ($invoices as $inv) @php $total_cost = 0; @endphp @endforeach @endif @if ($billing->branch_id == 3) @else @endif
PATIENT ID PATIENT NAME MOTHERS NAME DATE OF BIRTH BARCODE ACCESSION NO. DATE OF SAMPLE RECEPTION COST OTHER/REMARK/S TOTAL COST AMOUNT PAID DATE PREPARED/ GENERATED
REQUEST NO. INSTITUTION SURNAME FIRST NAME MOTHER'S NAME DATE OF BIRTH REFERENCE NO. DATE OF SAMPLE RECEPTION TESTS COST OTHERS/REMARKS TOTAL COST
{{ $inv->patient->code }} {{ $inv->patient->name . ' ' . $inv->patient->last_name }} {{ $inv->patient->mother_name }} {{ date('F d, Y', strtotime($inv->patient->dob)) }} {{ $inv->invoice_no }} @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample)

{{ $gt->sample->barcode }}

@else No Sample @endif @endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample) @if ($gt->sample->lab_receive_date)

{{ date('F d, Y', strtotime($gt->sample->lab_receive_date)) }}

@else

No Lab Received Date

@endif @else No Sample @endif @endforeach
@php $package_arr = []; @endphp @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) {{-- IF PACKAGE --}} @if ($gt->package) @php if (!in_array($gt->package_id, $package_arr)) { $package_arr[] = $gt->package_id; $total_cost += $gt->package->price; } @endphp

({{ $gt->package->shortcut }}) {{ number_format($gt->package->price, 2) }}

@else @php $total_cost += $gt->price; @endphp

{{ number_format($gt->price, 2) }}

@endif {{-- MAILING FEE AND DUPLICATE FEE --}} @if ($loop->last) @php $total_cost += $inv->mailing_fee; $total_cost += $inv->duplicate_fee; @endphp {{ $inv->mailing_fee ? 'Mailing Fee: ' . number_format($inv->mailing_fee, 2) : '' }} {!! $inv->duplicate_fee ? '

Duplicate Fee: ' . number_format($inv->duplicate_fee, 2) . '

' : '' !!} @endif @endforeach

{{ number_format($total_cost, 2) }}

{{ date('F d, Y', strtotime($billing->created_at)) }}

{{ $inv->patient->code }} {{ $inv->patient->name . ' ' . $inv->patient->last_name }} {{ $inv->patient->mother_name }} {{ date('F d, Y', strtotime($inv->patient->dob)) }} {{ $inv->invoice_no }} @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample)

{{ $gt->sample->barcode }}

@else No Sample @endif @endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample) @if ($gt->sample->lab_receive_date)

{{ date('F d, Y', strtotime($gt->sample->lab_receive_date)) }}

@else

No Lab Received Date

@endif @else No Sample @endif @endforeach
@php $package_arr = []; @endphp @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) {{-- IF PACKAGE --}} @if ($gt->package) @php if (!in_array($gt->package_id, $package_arr)) { $package_arr[] = $gt->package_id; $total_cost += $gt->package->price; } @endphp

({{ $gt->package->shortcut }}) {{ number_format($gt->package->price, 2) }}

@else @php $total_cost += $gt->price; @endphp

{{ number_format($gt->price, 2) }}

@endif {{-- MAILING FEE AND DUPLICATE FEE --}} @if ($loop->last) @php $total_cost += $inv->mailing_fee; $total_cost += $inv->duplicate_fee; @endphp {{ $inv->mailing_fee ? 'Mailing Fee: ' . number_format($inv->mailing_fee, 2) : '' }} {!! $inv->duplicate_fee ? '

Duplicate Fee: ' . number_format($inv->duplicate_fee, 2) . '

' : '' !!} @endif @endforeach

{{ number_format($total_cost, 2) }}

{{ date('F d, Y', strtotime($billing->created_at)) }}

{{ $inv->invoice_no }} {{ $inv->institution ? $inv->institution->name : '' }} {{ $inv->patient->last_name }} {{ $inv->patient->name }} {{ $inv->patient->mother_name }} {{ date('F d, Y', strtotime($inv->patient->dob)) }} @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample)

{{ $gt->sample->barcode }}

@else No Sample @endif @endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) {{--

{{ date('F d, Y', strtotime($gt->collection_date)) }}

--}} @if ($gt->sample) @if ($gt->sample->lab_receive_date)

{{ date('F d, Y', strtotime($gt->sample->lab_receive_date)) }}

@else

No Lab Received Date

@endif @else No Sample @endif @endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt)

{{ $gt->test->name }}

@if ($loop->last) {{ $inv->mailing_fee ? 'Mailing Fee:' : '' }} {!! $inv->duplicate_fee ? '
Duplicate Fee:' : '' !!} @endif @endforeach
@php $package_arr = []; @endphp @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) {{-- IF PACKAGE --}} @if ($gt->package) @php if (!in_array($gt->package_id, $package_arr)) { $package_arr[] = $gt->package_id; $total_cost += $gt->package->price; } @endphp

({{ $gt->package->shortcut }}) {{ number_format($gt->package->price, 2) }}

@else @php $total_cost += $gt->price; @endphp

{{ number_format($gt->price, 2) }}

@endif @if ($loop->last) @php $total_cost += $inv->mailing_fee; $total_cost += $inv->duplicate_fee; @endphp {{ $inv->mailing_fee ? number_format($inv->mailing_fee, 2) : '' }} {!! $inv->duplicate_fee ? '
' . number_format($inv->duplicate_fee, 2) : '' !!} @endif @endforeach
{{ number_format($total_cost, 2) }}
{{ $inv->invoice_no }} {{ $inv->institution ? $inv->institution->name : '' }} {{ $inv->patient->last_name }} {{ $inv->patient->name }} {{ $inv->patient->mother_name }} {{ date('F d, Y', strtotime($inv->patient->dob)) }} @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) @if ($gt->sample)

{{ $gt->sample->barcode }}

@else No Sample @endif @endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt)

{{ date('F d, Y', strtotime($gt->collection_date)) }}

@endforeach
@foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt)

{{ $gt->test->name }}

@if ($loop->last) {{ $inv->mailing_fee ? 'Mailing Fee:' : '' }} @endif @endforeach
@php $package_arr = []; @endphp @foreach ($inv->all_tests->where('cancelled', '!=', 1) as $gt) {{-- IF PACKAGE --}} @if ($gt->package) @php if (!in_array($gt->package_id, $package_arr)) { $package_arr[] = $gt->package_id; $total_cost += $gt->package->price; } @endphp

({{ $gt->package->shortcut }}) {{ number_format($gt->package->price, 2) }}

@else @php $total_cost += $gt->price; @endphp

{{ number_format($gt->price, 2) }}

@endif @if ($loop->last) @php $total_cost += $inv->mailing_fee; @endphp {{ $inv->mailing_fee ? number_format($inv->mailing_fee, 2) : '' }} @endif @endforeach
{{ number_format($total_cost, 2) }}
TOTAL Php