{{-- ICTHospital - OPD visit fees per doctor, visit type and shift. 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($canEdit = \App\Support\Permissions::allows('service_update'))

Doctor visit fee

The fee billed when a visit is checked in. A doctor's own fee beats an all-doctors fee, and a fee for the shift beats an any-time fee. Leave the fee blank to charge the service's price for the patient's type. A patient whose type has its own OPD price for the service, such as a panel or charity rate on Price by Patient Type, always pays that price instead of the fee.

@php($used = $fees->where('active', true)->groupBy(fn ($f) => ($f->doctor_id ?: 0) . '|' . $f->visit_type . '|' . $f->shift)->map(fn ($g) => $g->min('id'))) @php($unused = $fees->where('active', true)->filter(fn ($f) => $used[($f->doctor_id ?: 0) . '|' . $f->visit_type . '|' . $f->shift] !== $f->id)->pluck('id')->all()) @if ($unused)
Some rows below match the same visits as an earlier row, so they are never billed. Only the first row added for a doctor, visit type and shift is used. Remove the rows marked "Not used", or change them to one doctor or one shift.
@endif
@forelse ($fees as $f) @empty @endforelse
DoctorVisit typeShiftService on invoiceVisit fee
{{ $f->doctor_id ? ($doctorNames[$f->doctor_id] ?? $f->doctor_id) : 'All doctors' }} {{ \App\Models\VisitFee::TYPES[$f->visit_type] ?? $f->visit_type }} {{ \App\Models\VisitFee::SHIFTS[$f->shift] ?? $f->shift }} {{ $serviceNames[$f->payment_category_id] ?? '' }} @if (in_array($f->id, $unused, true))Not used@endif {{ $f->fee !== null ? number_format((float) $f->fee, 2) : 'Price list' }} @if ($canEdit)
{{ csrf_field() }}
@endif
No visit fees yet.
@if ($canEdit)

Add visit configuration

{{ csrf_field() }}
@endif
@stop