{{-- ICTHospital - day book: billing by department and patient group, doctor and hospital share per line, and collections by payment mode. Copyright (c) DEVtrust Part of ICTHospital Licensed under the GNU General Public License v3.0. --}} @extends('layouts.master') @section('content') @include('app.partials._alerts') @php($buckets = ['Private', 'Panel', 'Charity'])

Day book

Department wise summary net billed

@foreach ($buckets as $b)@endforeach @forelse ($byDept as $dept => $row) @foreach ($buckets as $b)@endforeach @empty @endforelse @if ($byDept) @foreach ($buckets as $b)@endforeach @endif
Department{{ $b }}Grand total
{{ $dept }}{{ number_format($row[$b] ?? 0, 2) }}{{ number_format(array_sum($row), 2) }}
Nothing billed in this range.
Grand total{{ number_format(collect($byDept)->sum(fn ($r) => $r[$b] ?? 0), 2) }}{{ number_format(collect($byDept)->sum(fn ($r) => array_sum($r)), 2) }}

Collected by payment mode, same days

@foreach (\App\Support\PaymentModes::labels() as $k => $label) @endforeach @if ($collections['write_off'] > 0)@endif
{{ $label }}{{ number_format($collections[$k], 2) }}
Subtotal{{ number_format($collections['total'], 2) }}
Written off{{ number_format($collections['write_off'], 2) }}
@if (! empty($kind_summary))

By kind of service

@foreach ($kind_summary as $k => $v){{ \App\Support\ServiceKinds::label($k) }}: {{ number_format($v, 2) }}@endforeach

@endif

Services consultation wise

@foreach ($lines as $l) @endforeach @if ($lines) @foreach (['gross', 'discount', 'net', 'doctor', 'hospital'] as $k)@endforeach @endif
DateInvoicePatientTypeServiceDepartmentTotal saleDiscountNetDoctor shareHospital share
{{ $l['date'] }}#{{ $l['invoice'] }}{{ $l['patient'] }}{{ $l['type'] }}{{ $l['service'] }}{{ $l['department'] }} {{ number_format($l['gross'], 2) }}{{ number_format($l['discount'], 2) }}{{ number_format($l['net'], 2) }}{{ number_format($l['doctor'], 2) }}{{ number_format($l['hospital'], 2) }}
Total{{ number_format(collect($lines)->sum($k), 2) }}
@stop