{{-- Medicine order form. Create: patient, visit, prescription, delivery details. Edit adds the staff part: status and amounts (total = net cost + center % of it + delivery). Params: $order, $patient (nullable), $bookings, $action, $method. --}} @php($editing = $order->exists)
@csrf @if ($method !== 'POST') @method($method) @endif
{{-- Patient and visit --}}

{{ trans('clinic.medicine_orders.section_patient') }}

@if ($editing)
{{ $patient?->name }} {{ $patient?->phone }}
@else @endif @error('patient_id')
{{ $message }}
@enderror
{{ trans('clinic.medicine_orders.booking_hint') }}
@error('booking_id')
{{ $message }}
@enderror
@error('delivery_phone')
{{ $message }}
@enderror
@error('delivery_address')
{{ $message }}
@enderror
{{-- Prescription --}}

{{ trans('clinic.medicine_orders.section_prescription') }}

@if ($order->prescription_image_url) @endif
{{ trans('clinic.medicine_orders.image_hint') }}
@error('prescription_image')
{{ $message }}
@enderror
{{ trans('clinic.medicine_orders.prescription_hint') }}
@error('prescription_text')
{{ $message }}
@enderror
@error('notes')
{{ $message }}
@enderror
{{-- Staff part: status and amounts (after the request is created) --}} @if ($editing)

{{ trans('clinic.medicine_orders.status') }}

@foreach (\App\Models\Clinic\MedicineOrder::STATUSES as $status) @endforeach

{{ trans('clinic.medicine_orders.section_amounts') }}

@error('medicine_cost')
{{ $message }}
@enderror
%
{{ trans('clinic.medicine_orders.center_amount') }}: 0.00
@error('center_percentage')
{{ $message }}
@enderror
@error('delivery_cost')
{{ $message }}
@enderror
{{ trans('clinic.medicine_orders.total') }} 0.00
{{ trans('clinic.medicine_orders.total_hint') }}
@endif
{{ trans('dash_site.Cancel') }}
@push('medicine-order-scripts') @endpush